Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        states = stateMachine.GetStates <CharacterState> ();

        if (stateMachine.GetState <CharacterState> (CharacterState.NONE) == true)
        {
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Adds a type of <see cref="State"/> with a sub-state machine in it and its transition to the state <paramref name="stateTo"/>
    /// </summary>
    /// <param name="stateName"></param>
    /// <param name="subStateMachine">The sub-state machine inside the state</param>
    /// <param name="stateTo">The name of the state where the sub-state machine will enter</param>
    /// <returns></returns>
    public State CreateSubStateMachine(string stateName, StateMachineEngine subStateMachine, State stateTo)
    {
        State state = new State(stateName, subStateMachine.GetState("Entry_Machine"), stateTo, subStateMachine, this);

        states.Add(state.Name, state);

        return(state);
    }
Exemplo n.º 3
0
    /// <summary>
    /// Adds a type of <see cref="State"/> with a sub-state machine in it and its transition to the state <paramref name="stateTo"/>
    /// </summary>
    /// <param name="stateName"></param>
    /// <param name="subStateMachine">The sub-state machine inside the state</param>
    /// <param name="stateTo">The name of the state where the sub-state machine will enter</param>
    /// <returns></returns>
    public LeafNode CreateSubBehaviour(string nodeName, StateMachineEngine subStateMachine, State stateTo)
    {
        State    state    = new State(nodeName, subStateMachine.GetState("Entry_Machine"), stateTo, subStateMachine, this);
        LeafNode leafNode = new LeafNode("Node to return", state, this);

        subStateMachine.NodeToReturn = leafNode;
        states.Add(leafNode.StateNode.Name, leafNode.StateNode);

        return(subStateMachine.NodeToReturn);
    }