public void Kill() { State = eGremlinState.Dying; _Animator.SetTrigger("startDying"); OnMonsterKilled(this); _AudioSource.PlayOneShot(KillClip, 1.0f); }
public void Attack() { State = eGremlinState.Attacking; _Animator.SetTrigger("startAttacking"); OnMonsterAttack(this); _AudioSource.PlayOneShot(AttackClip); }
public void Stop() { if (State != eGremlinState.Dying) { State = eGremlinState.Idle; _Animator.Play("Idle"); } }
public void Walk() { State = eGremlinState.Walking; _Animator.SetTrigger("startWalking"); }
/*AudioSource AddAudio(AudioClip clip, bool loop, bool playAwake, float vol) * { * AudioSource newAudio = gameObject.AddComponent<AudioSource>(); * newAudio.clip = clip; * newAudio.loop = loop; * newAudio.playOnAwake = playAwake; * newAudio.volume = vol; * return newAudio; * }*/ public void Awake() { _Animator = GetComponent <Animator>(); _AudioSource = GetComponent <AudioSource>(); State = eGremlinState.Idle; }