示例#1
0
 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);
 }
示例#6
0
 private void OnDisable()
 {
     this.RemoveObserver(OnStatChanged, Stats.DidChangeNotification(type), stats);
 }
示例#7
0
 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);
 }
示例#8
0
 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));
 }