Ejemplo n.º 1
0
 protected virtual void Start()
 {
     m_CharacterController = gameObject.GetComponent <CharacterController>();
     if (m_ConstantMovement == true)
     {
         m_State = StateOfCharacterControllerMovement.CharacterConstantMovement;
     }
 }
Ejemplo n.º 2
0
 void Move(Vector3 targetPosition)
 {
     m_MovDiff = targetPosition - transform.position;
     m_MovDir  = m_MovDiff.normalized * PlayerAvatar.MovementSpeed * Time.deltaTime;
     if (m_MovDir.sqrMagnitude < m_MovDiff.sqrMagnitude)
     {
         m_CharacterController.Move(m_MovDir);
     }
     else
     {
         m_State = StateOfCharacterControllerMovement.CharacterControllerStay;
     }
 }
Ejemplo n.º 3
0
 public void MovePlayerToPoint(Vector3 targetPosition)
 {
     m_State          = StateOfCharacterControllerMovement.CharacterControllerMove;
     m_TargetPosition = targetPosition;
 }