ui基本完毕,修了一大把的bug
This commit is contained in:
@@ -535,14 +535,7 @@ public class SkillBuilder : MonoBehaviour
|
||||
public void ModifyTotalScore(int delta)
|
||||
{
|
||||
if (ScoreManager.Instance == null) { Debug.LogWarning("ModifyTotalScore: ScoreManager.Instance is null"); return; }
|
||||
// adjust total and attempt to update UI
|
||||
ScoreManager.Instance.totalScore += delta;
|
||||
// try to force UI update via ScoreManager.RecalculateTotal() is not appropriate because it recalculates from allies
|
||||
// so instead update displayed total directly if teamUIController present
|
||||
if (teamUIController.Instance != null && teamUIController.Instance.currentTotalScore != null)
|
||||
{
|
||||
teamUIController.Instance.currentTotalScore.text = ScoreManager.Instance.totalScore.ToString();
|
||||
}
|
||||
ScoreManager.Instance.ApplyExternalTotalScoreDelta(delta);
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
@@ -1238,24 +1231,12 @@ public class SkillBuilder : MonoBehaviour
|
||||
var comp = target.GetComponent<ICombatant>();
|
||||
if (comp == null) return false;
|
||||
comp.ReceiveHeal(amount, source);
|
||||
if (source != null)
|
||||
{
|
||||
var sourceAlly = source.GetComponent<AllyCombatant>();
|
||||
if (sourceAlly != null && teamUIController.Instance != null)
|
||||
teamUIController.Instance.RecordHeal(sourceAlly.slotIndex, amount);
|
||||
}
|
||||
return true;
|
||||
|
||||
case EffectType.IncreaseManaOverTime:
|
||||
var ally = target.GetComponent<AllyCombatant>();
|
||||
if (ally == null) return false;
|
||||
ally.ModifyMana(Mathf.CeilToInt(amount), true, true);
|
||||
if (amount > 0f && source != null)
|
||||
{
|
||||
var sourceAlly = source.GetComponent<AllyCombatant>();
|
||||
if (sourceAlly != null && teamUIController.Instance != null)
|
||||
teamUIController.Instance.RecordMana(sourceAlly.slotIndex, amount);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user