public void Hit(float amount) { if (!isDead) { if (iFrameTimeTemp <= 0.0f) { iFrameTimeTemp = iFrameTime; health -= amount; if (hurtFlash != null) { hurtFlash.Flash(); } CheckHealth(); } } }
// 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(); }