Exemple #1
0
 public void Hit(float amount)
 {
     if (!isDead)
     {
         if (iFrameTimeTemp <= 0.0f)
         {
             iFrameTimeTemp = iFrameTime;
             health        -= amount;
             if (hurtFlash != null)
             {
                 hurtFlash.Flash();
             }
             CheckHealth();
         }
     }
 }
Exemple #2
0
    // Start is called before the first frame update
    void Start()
    {
        PlayerState playerState = PlayerState.Playing;

        audio      = GetComponent <AudioPlayer>();
        hurtShield = GameObject.Find("HurtShield");
        hurtFlash  = hurtShield.GetComponent <HurtFlash>();
        Cooldown   = false;

        Flash = hurtFlash.Flash();
    }