선택 저장
This commit is contained in:
parent
a427a45121
commit
3d328364f1
|
|
@ -214,7 +214,24 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
|
|||
public void Open_Image() { ++m_SaveData.GirlUnLockIndex; }
|
||||
public int Get_UnLockIndex() { return m_SaveData.GirlUnLockIndex; }
|
||||
public int Get_SelectGirlID() { return m_SaveData.SelectGirlID; }
|
||||
public void Set_SelectGirlID(int id) { m_SaveData.SelectGirlID = id; Save(); }
|
||||
public void Set_SelectGirlID(int id)
|
||||
{
|
||||
if (IsObtainGirl(id))
|
||||
{
|
||||
m_SaveData.SelectGirlID = id;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
public bool IsObtainGirl(int id)
|
||||
{
|
||||
var pregirl = id - 1;
|
||||
if (pregirl > 0)
|
||||
{
|
||||
var lst = table_album.Ins.Get_DataList(pregirl);
|
||||
return lst.Count == Get_ImageCount(pregirl) && Get_ImageCount(id) > 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public int Get_ImageCount(int girlid)
|
||||
{
|
||||
var lst = table_album.Ins.Get_DataList(girlid);
|
||||
|
|
|
|||
|
|
@ -20,11 +20,6 @@ public class LobbyCenterProfileUI : MonoBehaviour
|
|||
public void Set()
|
||||
{
|
||||
if (curGirl == 0) curGirl = SaveMgr.Ins.Get_SelectGirlID();
|
||||
else
|
||||
{
|
||||
if (arr_profileCard[1].IsObtain())
|
||||
SaveMgr.Ins.Set_SelectGirlID(curGirl);
|
||||
}
|
||||
|
||||
var pre_girl = curGirl - 1;
|
||||
if (pre_girl <= 0) pre_girl = 8;
|
||||
|
|
@ -48,6 +43,7 @@ public class LobbyCenterProfileUI : MonoBehaviour
|
|||
curGirl = curGirl + dir;
|
||||
if (curGirl > 8) curGirl = 1;
|
||||
else if (curGirl < 1) curGirl = 8;
|
||||
SaveMgr.Ins.Set_SelectGirlID(curGirl);
|
||||
|
||||
isAnimating = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,16 +59,6 @@ public class ProfileCard : MonoBehaviour
|
|||
}
|
||||
return false;
|
||||
}
|
||||
public bool IsObtain()
|
||||
{
|
||||
var pregirl = m_Data.n_GirlID - 1;
|
||||
if (pregirl > 0)
|
||||
{
|
||||
var lst = table_album.Ins.Get_DataList(pregirl);
|
||||
return lst.Count == SaveMgr.Ins.Get_ImageCount(pregirl) && SaveMgr.Ins.Get_ImageCount(m_Data.n_GirlID) > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void OnClick_Profile()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue