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); }
private void EvaluateDecisions(CombatStateMachineController _controller) { int transitionCount = m_transitions.Length; for (int i = 0; i < transitionCount; i++) { m_transitions[i].MakeDecision(_controller); } }
private void PerformActions(CombatAction[] _actions, CombatStateMachineController _controller) { int actionCount = _actions.Length; for (int i = 0; i < actionCount; i++) { _actions[i].Act(_controller); } }
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); }
public abstract void Act(CombatStateMachineController _controller);
public abstract bool Decide(CombatStateMachineController _controller);
public void OnAnimaterMoveState(CombatStateMachineController _controller) { PerformActions(m_animatorMoveActions, _controller); }
public void OnFixedUpdateState(CombatStateMachineController _controller) { PerformActions(m_fixedUpdateActions, _controller); }
public void OnUpdateState(CombatStateMachineController _controller) { PerformActions(m_updateActions, _controller); EvaluateDecisions(_controller); }
public void OnStateExit(CombatStateMachineController _controller) { PerformActions(m_onExitActions, _controller); }
public void OnStateEnter(CombatStateMachineController _controller) { PerformActions(m_onEnterActions, _controller); PlayAnimation(_controller); }