Exemplo n.º 1
0
    private void Awake()
    {
        Health = new SensitiveIntValue(CompareMode.LessThan, healthInitValue, 0);
        Health.Triggered.AddListener(OnHealthZero);

        Type type = Type.GetType(DeathStrategy.ToString());                     //target type

        healthZeroStrategy = (BehaviourStrategy)Activator.CreateInstance(type); // an instance of target type
    }
Exemplo n.º 2
0
 private void Awake()
 {
     healthZeroEvent = new UnityEvent();
     playerHp        = new SensitiveIntValue(CompareMode.LessThan, levelConfiguration.playerStartHP, 0);
     playerHp.Triggered.AddListener(delegate
     {
         healthZeroEvent?.Invoke();
     });
 }