| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using UnityEngine;
- public class MonsterAnimatorController : MonoBehaviour
- {
- private Animator animator;
- private void Awake()
- {
- animator = GetComponent<Animator>();
- }
- public void PlayMove()
- {
- if (animator == null) return;
- animator.SetBool("IsWalking", true);
- }
- public void StopMove()
- {
- if (animator == null) return;
- animator.SetBool("IsWalking", false);
- }
- public void PlayAttack()
- {
- if (animator == null) return;
- animator.ResetTrigger("Attack");
- animator.SetTrigger("Attack");
- }
- public void PlayHurt()
- {
- if (animator == null) return;
- animator.ResetTrigger("Hurt");
- animator.SetTrigger("Hurt");
- }
- public void PlayDeath()
- {
- if (animator == null) return;
- animator.ResetTrigger("Die");
- animator.SetTrigger("Die");
- }
- }
|