예제 #1
0
 private void PlayAnimation(CombatStateMachineController _controller)
 {
     if (m_combatAnim == null || m_combatAnim.Clip == null)
     {
         return;
     }
     _controller.AnimHandler.PlayAnimation(m_combatAnim.Clip);
 }
        public override void Act(CombatStateMachineController _controller)
        {
            Vector3 pos = MainCameraReference.MainCamera.WorldToViewportPoint(_controller.MoveHandler.TransformComp.position);

            pos.x = Mathf.Clamp01(pos.x);
            pos.y = Mathf.Clamp01(pos.y);
            _controller.MoveHandler.TransformComp.position = MainCameraReference.MainCamera.ViewportToWorldPoint(pos);
        }
예제 #3
0
        private void EvaluateDecisions(CombatStateMachineController _controller)
        {
            int transitionCount = m_transitions.Length;

            for (int i = 0; i < transitionCount; i++)
            {
                m_transitions[i].MakeDecision(_controller);
            }
        }
예제 #4
0
        private void PerformActions(CombatAction[] _actions, CombatStateMachineController _controller)
        {
            int actionCount = _actions.Length;

            for (int i = 0; i < actionCount; i++)
            {
                _actions[i].Act(_controller);
            }
        }
예제 #5
0
        public void MakeDecision(CombatStateMachineController _controller)
        {
            int decisionCount = m_decisions.Length;

            for (int i = 0; i < decisionCount; i++)
            {
                if (!m_decisions[i].Decide(_controller))
                {
                    return;
                }
            }
            _controller.ChangeState(m_nextState);
        }
예제 #6
0
 public abstract void Act(CombatStateMachineController _controller);
 public abstract bool Decide(CombatStateMachineController _controller);
예제 #8
0
 public void OnAnimaterMoveState(CombatStateMachineController _controller)
 {
     PerformActions(m_animatorMoveActions, _controller);
 }
예제 #9
0
 public void OnFixedUpdateState(CombatStateMachineController _controller)
 {
     PerformActions(m_fixedUpdateActions, _controller);
 }
예제 #10
0
 public void OnUpdateState(CombatStateMachineController _controller)
 {
     PerformActions(m_updateActions, _controller);
     EvaluateDecisions(_controller);
 }
예제 #11
0
 public void OnStateExit(CombatStateMachineController _controller)
 {
     PerformActions(m_onExitActions, _controller);
 }
예제 #12
0
 public void OnStateEnter(CombatStateMachineController _controller)
 {
     PerformActions(m_onEnterActions, _controller);
     PlayAnimation(_controller);
 }