加入用户最近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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,20 +5,23 @@ public class Player_SO : ScriptableObject
|
||||
{
|
||||
[Header("Inspector")]
|
||||
public int player_currentEXP;
|
||||
public int player_currentLevel;
|
||||
|
||||
[Header("economics")]
|
||||
[SerializeField] private int player_coins;
|
||||
[SerializeField] private int player_material;
|
||||
|
||||
[Header("exp bottles")]
|
||||
[SerializeField] private int emptyExpBottle78000;
|
||||
[SerializeField] private int commonExpBottle78001;
|
||||
[SerializeField] private int mediumExpBottle78002;
|
||||
[SerializeField] private int superiorExpBottle78003;
|
||||
[SerializeField] private int supremeExpBottle78004;
|
||||
[SerializeField] private int extraordinaryExpBottle78005;
|
||||
[SerializeField] private int celestialExpBottle78006;
|
||||
|
||||
[Header("combat analytics")]
|
||||
[SerializeField] private float uRankingScore;
|
||||
|
||||
[Header("dush materials")]
|
||||
[SerializeField] private int dushMaterial78021;
|
||||
[SerializeField] private int dushMaterial78022;
|
||||
[SerializeField] private int dushMaterial78023;
|
||||
@@ -37,6 +40,11 @@ public class Player_SO : ScriptableObject
|
||||
get { return player_material; }
|
||||
}
|
||||
|
||||
public float URankingScore
|
||||
{
|
||||
get { return uRankingScore; }
|
||||
}
|
||||
|
||||
public void SetCoins(int value)
|
||||
{
|
||||
player_coins = Mathf.Max(0, value);
|
||||
@@ -74,6 +82,22 @@ public class Player_SO : ScriptableObject
|
||||
PersistEditorChanges();
|
||||
}
|
||||
|
||||
public void SetURankingScore(float value)
|
||||
{
|
||||
uRankingScore = Mathf.Max(0f, value);
|
||||
PersistEditorChanges();
|
||||
}
|
||||
|
||||
public void AddURankingScore(float delta)
|
||||
{
|
||||
if (Mathf.Approximately(delta, 0f))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetURankingScore(uRankingScore + delta);
|
||||
}
|
||||
|
||||
public bool TrySpendCoins(int amount)
|
||||
{
|
||||
if (amount <= 0)
|
||||
@@ -96,29 +120,11 @@ public class Player_SO : ScriptableObject
|
||||
PersistEditorChanges();
|
||||
}
|
||||
|
||||
public int GetLegacyExpBottleCount(string fieldName)
|
||||
{
|
||||
switch (fieldName)
|
||||
{
|
||||
case "emptyExpBottle78000": return emptyExpBottle78000;
|
||||
case "commonExpBottle78001": return commonExpBottle78001;
|
||||
case "mediumExpBottle78002": return mediumExpBottle78002;
|
||||
case "superiorExpBottle78003": return superiorExpBottle78003;
|
||||
case "supremeExpBottle78004": return supremeExpBottle78004;
|
||||
case "extraordinaryExpBottle78005": return extraordinaryExpBottle78005;
|
||||
case "celestialExpBottle78006": return celestialExpBottle78006;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetLegacyExpBottleCount(string fieldName, int value)
|
||||
{
|
||||
int safeValue = Mathf.Max(0, value);
|
||||
switch (fieldName)
|
||||
{
|
||||
case "emptyExpBottle78000":
|
||||
emptyExpBottle78000 = safeValue;
|
||||
break;
|
||||
case "commonExpBottle78001":
|
||||
commonExpBottle78001 = safeValue;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user