Esempio n. 1
0
 public void Kill()
 {
     State = eGremlinState.Dying;
     _Animator.SetTrigger("startDying");
     OnMonsterKilled(this);
     _AudioSource.PlayOneShot(KillClip, 1.0f);
 }
Esempio n. 2
0
 public void Attack()
 {
     State = eGremlinState.Attacking;
     _Animator.SetTrigger("startAttacking");
     OnMonsterAttack(this);
     _AudioSource.PlayOneShot(AttackClip);
 }
Esempio n. 3
0
 public void Stop()
 {
     if (State != eGremlinState.Dying)
     {
         State = eGremlinState.Idle;
         _Animator.Play("Idle");
     }
 }
Esempio n. 4
0
 public void Walk()
 {
     State = eGremlinState.Walking;
     _Animator.SetTrigger("startWalking");
 }
Esempio n. 5
0
    /*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;
    }