public void Init(StatTypes type, int value, Func <bool> condition) { this.type = type; this.value = value; this.condition = condition; this.AddObserver(OnStatChanged, Stats.DidChangeNotification(type), stats); }
public void UnEmploy() { Feature[] features = GetComponentsInChildren <Feature>(); for (int i = 0; i < features.Length; ++i) { features[i].Deactivate(); } this.RemoveObserver(OnLvlChangeNotification, Stats.DidChangeNotification(StatTypes.LVL), stats); stats = null; }
public void Employ() { stats = gameObject.GetComponentInParent <Stats>(); this.AddObserver(OnLvlChangeNotification, Stats.DidChangeNotification(StatTypes.LVL), stats); Feature[] features = GetComponentsInChildren <Feature>(); for (int i = 0; i < features.Length; ++i) { features[i].Activate(gameObject); } }
private void OnDisable() { this.RemoveObserver(OnLevelChange, Stats.DidChangeNotification(StatTypes.LVL)); this.RemoveObserver(OnExperienceException, Stats.WillChangeNotification(StatTypes.EXP)); }
private void OnDisable() { this.RemoveObserver(OnHPWillChange, Stats.WillChangeNotification(StatTypes.HP), stats); this.RemoveObserver(OnMaxPDidChange, Stats.DidChangeNotification(StatTypes.MHP), stats); }
private void OnDisable() { this.RemoveObserver(OnStatChanged, Stats.DidChangeNotification(type), stats); }
private void OnDisable() { this.RemoveObserver(OnMPWillChange, Stats.WillChangeNotification(StatTypes.MP), stats); this.RemoveObserver(OnMMPDidChange, Stats.DidChangeNotification(StatTypes.MMP), stats); this.RemoveObserver(OnTurnBegan, TurnOrderController.TurnBeganNotification, unit); }
private void OnDisable() { this.RemoveObserver(OnExpWillChange, Stats.WillChangeNotification(StatTypes.EXP), stats); this.RemoveObserver(OnExpDidChange, Stats.DidChangeNotification(StatTypes.EXP), stats); }
private void OnDestroy() { this.RemoveObserver(OnLvlChangeNotification, Stats.DidChangeNotification(StatTypes.LVL)); }