option for change visual character

This commit is contained in:
Vova
2024-04-28 15:17:19 +03:00
parent 38f8b297f2
commit fb2c0a0c5c
7 changed files with 290 additions and 240 deletions
+8 -3
View File
@@ -7,10 +7,9 @@ public class BlockingAnimation : Attribute { }
public abstract class BaseCharacter : MonoBehaviour
{
[SerializeField]
public NavMeshAgent _navAgent;
[SerializeField]
public Animator _animator;
protected NavMeshAgent _navAgent;
protected Animator _animator;
private const string WALK_VELOCITY = "WalkVelocity";
private readonly Queue<PlayerTasks> _tasks = new Queue<PlayerTasks>();
private PlayerTasks _currentTask;
@@ -18,6 +17,12 @@ public abstract class BaseCharacter : MonoBehaviour
private Action _OnAnimationFinish;
private AnimationStates _currentAnimation;
protected void IntCharacter()
{
_animator=GetComponentInChildren<Animator>();
}
private void Update()
{
if (PlayerHelper.IsBlockingAnimation(_currentAnimation))