Beispiel #1
0
 void OnPlayerHit(hpUpdateType type)
 {
     if (type == hpUpdateType.damage)
     {
         camAnim.SetTrigger("shake" + Random.Range(1, 3));
     }
 }
Beispiel #2
0
    void UpdatePlayerHealth(hpUpdateType type)
    {
        healthLabel.text = ((int)PlayerManager.instance.GetPlayer().GetHealth()).ToString("");
        if (type == hpUpdateType.damage)
        {
        }
        switch (type)
        {
        case hpUpdateType.damage:
            glowAnim.SetTrigger("Hit");
            break;

        case hpUpdateType.heal:
            glowAnim.SetTrigger("Heal");
            break;
        }
    }
Beispiel #3
0
 public void SetHealth(float value, hpUpdateType type = hpUpdateType.reset)
 {
     health = value;
     hpUpdateEvent.Invoke(type);
 }