protected virtual void OnLevelUp() { CurExp = 0; Level++; Callback_OnLevelUp?.Invoke(Level); Callback_OnLevelChange?.Invoke(Level); Callback_OnExpChange?.Invoke(CurExp); }
/// <summary> /// 增加经验 /// </summary> public virtual void AddExp(int val) { CurExp += val; Callback_OnAddExp?.Invoke(); if (CurExp >= MaxExp) { Callback_OnLevelUp?.Invoke(); OnLevelUp(); } }