Example #1
0
    void Start()
    {
        windowHandler = GetComponent<WindowStateHandler>();
		SetState(initialState);
	}
Example #2
0
 /// <summary>
 /// Used to manage invoking all actions within the current state.
 /// The update type is passed in to determine if the action should update inside Update(), FixedUpdate(), or LateUpdate()
 /// </summary>
 /// <param name="UpdateType"></param>
 void InvokeCurrentStateAction(WindowStateHandler.Action.UpdateStyle UpdateType)
 {
     foreach (WindowStateHandler.Action action in currentState.possibleActions)
     {
         //these conditions must be met in order to invoke the action in the update type
         if (action.updateFunction == UpdateType && action.continuouslyInvokeAction)
         {
             action.StartAction.Invoke();
         }
     }
 }
 void OnEnable()
 {
     ab = (WindowStateHandler)target;
     stateTarget = new SerializedObject(ab);
     m_states = stateTarget.FindProperty("states");
 }