option for change visual character
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class HoldPoint : MonoBehaviour
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99527458161e16442b3fb76c8f585ec8
|
||||
@@ -8,8 +8,7 @@ public class Player : BaseCharacter
|
||||
public event EventHandler<bool> OnContainerChanged;
|
||||
public static Player Instance { get; private set; }
|
||||
|
||||
[SerializeField]
|
||||
private Transform _holdPoint;
|
||||
private HoldPoint _holdPoint;
|
||||
|
||||
private PlayerStates _currentActing;
|
||||
|
||||
@@ -43,6 +42,8 @@ public class Player : BaseCharacter
|
||||
|
||||
private void Start()
|
||||
{
|
||||
base.IntCharacter();
|
||||
_holdPoint= GetComponentInChildren<HoldPoint>();
|
||||
GameManager.Instance.Time.OnMinuteChanged += UpdateStatsByClock;
|
||||
_animator.applyRootMotion = true;
|
||||
_navAgent.updatePosition = false;
|
||||
@@ -120,7 +121,7 @@ public class Player : BaseCharacter
|
||||
|
||||
public void SetContainerItem(ContainerItem containerItem)
|
||||
{
|
||||
containerItem.transform.parent = _holdPoint;
|
||||
containerItem.transform.parent = _holdPoint.transform;
|
||||
containerItem.transform.localPosition = Vector3.zero;
|
||||
_containerItem = containerItem;
|
||||
OnContainerChanged.Invoke(this,true);
|
||||
|
||||
Reference in New Issue
Block a user