private StateMachine Load_AddStatesToStateMachine(AnimatorStateMachine stateMachine) { if (stateMachine == null) { return(null); } StateMachine returnStateMachine = new StateMachine(this); returnStateMachine.Name = stateMachine.name; returnStateMachine.controllerStateMachine = stateMachine; foreach (var state in stateMachine.states) { var state2 = new StateProxy(this, returnStateMachine); state2.state.Name = state.state.name; state2.state.motion = state.state.motion; returnStateMachine.states.Add(state2); } foreach (var stateMachine2 in stateMachine.stateMachines) { var state2 = new StateProxy(StateType.StateMachine, this, returnStateMachine); Load_AddStatesToStateMachine(stateMachine2.stateMachine); returnStateMachine.states.Add(state2); } return(returnStateMachine); }
public void SetStatesFromInputOptions(List <InputOption> inputOptions) { states.Clear(); if (inputOptions != null) { for (var i = 0; i < inputOptions.Count; i++) { StateProxy state = new StateProxy(data, this); state.state.linkedInputOptionIndex = i; states.Add(state); } } }