diff --git a/Assets/Animations/MonsterBaseAnimator.controller b/Assets/Animations/MonsterBaseAnimator.controller index 62f2cc8..3587c93 100644 --- a/Assets/Animations/MonsterBaseAnimator.controller +++ b/Assets/Animations/MonsterBaseAnimator.controller @@ -187,16 +187,16 @@ AnimatorStateMachine: m_ChildStates: - serializedVersion: 1 m_State: {fileID: 703164551053012985} - m_Position: {x: 560, y: 160, z: 0} + m_Position: {x: 260, y: 170, z: 0} - serializedVersion: 1 m_State: {fileID: 1028912623824696338} - m_Position: {x: 260, y: 100, z: 0} + m_Position: {x: 260, y: 240, z: 0} - serializedVersion: 1 m_State: {fileID: -5615459309368676638} - m_Position: {x: 560, y: 90, z: 0} + m_Position: {x: 260, y: 90, z: 0} - serializedVersion: 1 m_State: {fileID: -4316900719387780663} - m_Position: {x: 260, y: 170, z: 0} + m_Position: {x: 260, y: 310, z: 0} - serializedVersion: 1 m_State: {fileID: -5723871321714695223} m_Position: {x: 704.1478, y: -596.24896, z: 0} diff --git a/Assets/Scripts/AnimationEntity.cs b/Assets/Scripts/AnimationEntity.cs index 97e59fd..c906cde 100644 --- a/Assets/Scripts/AnimationEntity.cs +++ b/Assets/Scripts/AnimationEntity.cs @@ -7,6 +7,7 @@ public class AnimationEntity : MonoBehaviour private Animator _animator_entity; private bool _doSomething = false; + private bool _isDead = false; void Start() { _animator_entity = GetComponentInChildren(); @@ -22,21 +23,28 @@ public class AnimationEntity : MonoBehaviour } public void Idle() { - _animator_entity.Play("idle", 0, 0f); + if(!_isDead) { + _animator_entity.Play("idle", 0, 0f); + } } public void Walk() { - _animator_entity.Play("walk", 0, 0f); + if(!_isDead) { + _animator_entity.Play("walk", 0, 0f); + } } public void Attack() { - _animator_entity.Play("attack", 0, 0f); - _doSomething = true; + if(!_isDead) { + _animator_entity.Play("attack", 0, 0f); + _doSomething = true; + } } public void Die() { _animator_entity.Play("die", 0, 0f); _doSomething = true; + _isDead = true; } }