加入用户最近100场战绩记录并实现展示
This commit is contained in:
@@ -8,6 +8,7 @@ public class AllyHero_SO : ScriptableObject
|
||||
public string ally_heroName;
|
||||
public string ally_heroDesignation;
|
||||
public int ally_heroID;
|
||||
public bool isUnlocked;
|
||||
|
||||
[Header("Inspector")]
|
||||
public Sprite ally_heroImage;
|
||||
@@ -88,6 +89,7 @@ public class AllyHero_SO : ScriptableObject
|
||||
|
||||
[Header("Inspector")]
|
||||
public int ally_currentEXP;
|
||||
public int ally_battleDeployCount;
|
||||
|
||||
[Header("Skills")]
|
||||
public SkillDefinition[] availableSkills;
|
||||
@@ -201,4 +203,32 @@ public class AllyHero_SO : ScriptableObject
|
||||
if (payload == null) return;
|
||||
equippedSkillGroupIDs = payload.equippedSkillGroupIDs ?? new int[0];
|
||||
}
|
||||
|
||||
public void SetUnlocked(bool value)
|
||||
{
|
||||
if (isUnlocked == value) return;
|
||||
isUnlocked = value;
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void IncrementBattleDeployCount(int amount = 1)
|
||||
{
|
||||
if (amount <= 0) return;
|
||||
AllyHeroDeployLedger.EnsureInstance().IncrementDeployCount(this, amount);
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void LoadBattleDeployCountFromLocal()
|
||||
{
|
||||
ally_battleDeployCount = AllyHeroDeployLedger.EnsureInstance().GetDeployCount(ally_heroID);
|
||||
}
|
||||
|
||||
public void SaveBattleDeployCountToLocal()
|
||||
{
|
||||
AllyHeroDeployLedger.EnsureInstance().SaveNow();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user