拼ui 一些业务逻辑x实现

This commit is contained in:
FloatGaming
2026-03-19 06:15:09 +08:00
parent f5c6f143c0
commit 49e45ac464
1118 changed files with 246518 additions and 5368 deletions
+34 -2
View File
@@ -90,6 +90,8 @@ public class AllyHero_SO : ScriptableObject
[Header("Inspector")]
public int ally_currentEXP;
public int ally_battleDeployCount;
public int ally_finishCount;
public int ally_mvpCount;
[Header("Skills")]
public SkillDefinition[] availableSkills;
@@ -209,7 +211,10 @@ public class AllyHero_SO : ScriptableObject
if (isUnlocked == value) return;
isUnlocked = value;
#if UNITY_EDITOR
UnityEditor.EditorUtility.SetDirty(this);
if (!Application.isPlaying)
{
UnityEditor.EditorUtility.SetDirty(this);
}
#endif
}
@@ -218,7 +223,10 @@ public class AllyHero_SO : ScriptableObject
if (amount <= 0) return;
AllyHeroDeployLedger.EnsureInstance().IncrementDeployCount(this, amount);
#if UNITY_EDITOR
UnityEditor.EditorUtility.SetDirty(this);
if (!Application.isPlaying)
{
UnityEditor.EditorUtility.SetDirty(this);
}
#endif
}
@@ -231,4 +239,28 @@ public class AllyHero_SO : ScriptableObject
{
AllyHeroDeployLedger.EnsureInstance().SaveNow();
}
public void IncrementFinishCount(int amount = 1)
{
if (amount <= 0) return;
AllyHeroDeployLedger.EnsureInstance().IncrementFinishCount(this, amount);
#if UNITY_EDITOR
if (!Application.isPlaying)
{
UnityEditor.EditorUtility.SetDirty(this);
}
#endif
}
public void IncrementMvpCount(int amount = 1)
{
if (amount <= 0) return;
AllyHeroDeployLedger.EnsureInstance().IncrementMvpCount(this, amount);
#if UNITY_EDITOR
if (!Application.isPlaying)
{
UnityEditor.EditorUtility.SetDirty(this);
}
#endif
}
}
+4 -1
View File
@@ -189,7 +189,10 @@ public class Player_SO : ScriptableObject
private void PersistEditorChanges()
{
#if UNITY_EDITOR
UnityEditor.EditorUtility.SetDirty(this);
if (!Application.isPlaying)
{
UnityEditor.EditorUtility.SetDirty(this);
}
#endif
}
}