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