no message

This commit is contained in:
Baptiste 2023-06-25 20:05:35 -04:00
parent 4a5313a9cf
commit 11d617db90
2 changed files with 16 additions and 8 deletions

View File

@ -187,16 +187,16 @@ AnimatorStateMachine:
m_ChildStates: m_ChildStates:
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 703164551053012985} m_State: {fileID: 703164551053012985}
m_Position: {x: 560, y: 160, z: 0} m_Position: {x: 260, y: 170, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 1028912623824696338} m_State: {fileID: 1028912623824696338}
m_Position: {x: 260, y: 100, z: 0} m_Position: {x: 260, y: 240, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -5615459309368676638} m_State: {fileID: -5615459309368676638}
m_Position: {x: 560, y: 90, z: 0} m_Position: {x: 260, y: 90, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -4316900719387780663} m_State: {fileID: -4316900719387780663}
m_Position: {x: 260, y: 170, z: 0} m_Position: {x: 260, y: 310, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -5723871321714695223} m_State: {fileID: -5723871321714695223}
m_Position: {x: 704.1478, y: -596.24896, z: 0} m_Position: {x: 704.1478, y: -596.24896, z: 0}

View File

@ -7,6 +7,7 @@ public class AnimationEntity : MonoBehaviour
private Animator _animator_entity; private Animator _animator_entity;
private bool _doSomething = false; private bool _doSomething = false;
private bool _isDead = false;
void Start() { void Start() {
_animator_entity = GetComponentInChildren<Animator>(); _animator_entity = GetComponentInChildren<Animator>();
@ -22,21 +23,28 @@ public class AnimationEntity : MonoBehaviour
} }
public void Idle() { public void Idle() {
if(!_isDead) {
_animator_entity.Play("idle", 0, 0f); _animator_entity.Play("idle", 0, 0f);
} }
}
public void Walk() { public void Walk() {
if(!_isDead) {
_animator_entity.Play("walk", 0, 0f); _animator_entity.Play("walk", 0, 0f);
} }
}
public void Attack() { public void Attack() {
if(!_isDead) {
_animator_entity.Play("attack", 0, 0f); _animator_entity.Play("attack", 0, 0f);
_doSomething = true; _doSomething = true;
} }
}
public void Die() { public void Die() {
_animator_entity.Play("die", 0, 0f); _animator_entity.Play("die", 0, 0f);
_doSomething = true; _doSomething = true;
_isDead = true;
} }
} }