void OnEnable() { GetComponent <AudioSource>().clip = Clip; GetComponent <AudioSource>().Play(); hurtEffectController.gameObject.SetActive(true); hurtEffectController.Play(); }
public void Hit() { spawner.Generate(); effectController = spawner.SpawnInstance.GetComponent <OneShotEffectController>(); effectController.Play(); Destroy(gameObject); }
void OnEnable() { GetComponent <AudioSource>().clip = Clip; GetComponent <AudioSource>().Play(); if (player.HurtFront) { hurtFrontEffect.gameObject.SetActive(true); hurtFrontEffect.Play(); } else { hurtBackEffect.gameObject.SetActive(true); hurtBackEffect.Play(); } }
void OnEnable() { hurtEffectController.gameObject.SetActive(true); hurtEffectController.Play(); }