Exemplo n.º 1
0
    protected void OnTriggerTransitions(AIStateController controller, Collider other, AIStateController.TriggerType triggerType)
    {
        foreach (AIStateTransition transition in transitions)
        {
            AIDecision.DecisionResult decisionResult = transition.decision.OnTrigger(controller, other, triggerType);

            SwitchToState(controller, transition, decisionResult);
        }
    }
Exemplo n.º 2
0
    protected void UpdateTransitions(AIStateController controller)
    {
        foreach (AIStateTransition transition in transitions)
        {
            AIDecision.DecisionResult decisionResult = transition.decision.UpdateDecision(controller);

            SwitchToState(controller, transition, decisionResult);
        }
    }
Exemplo n.º 3
0
    private void OnCollisionTransitions(AIStateController controller, Collision collision, AIStateController.CollisionType collisionType)
    {
        foreach (AIStateTransition transition in transitions)
        {
            AIDecision.DecisionResult decisionResult = transition.decision.OnCollision(controller, collision, collisionType);

            SwitchToState(controller, transition, decisionResult);
        }
    }
Exemplo n.º 4
0
    private void DisposeTransitions(AIStateController controller)
    {
        foreach (AIStateTransition transition in transitions)
        {
            AIDecision.DecisionResult decisionResult = transition.decision.Dispose(controller);

            SwitchToState(controller, transition, decisionResult);
        }
    }
Exemplo n.º 5
0
    private void SwitchToState(AIStateController controller, AIStateTransition transition, AIDecision.DecisionResult decisionResult)
    {
        switch (decisionResult)
        {
        case AIDecision.DecisionResult.None:
            break;

        case AIDecision.DecisionResult.Fail:
            controller.SwitchToState(transition.failState);
            break;

        case AIDecision.DecisionResult.Success:
            controller.SwitchToState(transition.successState);
            break;

        default:
            break;
        }
    }