DisplayStateListener

From Headbone Creative
Revision as of 22:54, 15 April 2013 by Tyson Joehler (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This script listens for updates from the DisplayStateManager class. It is designed to be a general purpose listener; it doesn't really do much by itself, except for receive notifications. However, when used in conjunction with other scripts like DisplayStateActivateOnChanged, it becomes quite useful indeed.

Contents

Public Variables

stateMachineID : string

This is actually hidden in the inspector, but the custom editor interface allows the game designer to choose which DisplayStateManager this will be set to from a drop-down box.

Events

This script uses a delegate function to notify other scripts that the state has changed. The delegate has this function signature:

  public delegate void NotifyStateChanged (string newState);

event NotifyStateChanged OnStateChanged

This is called when the display state is updated.

Public Functions

void StateChanged (string stateMachine, string newState)

This is called from a DisplayStateManager. It will call OnStateChanged with the new state if the stateMachine passed into this function matches the stateMachineID of this listener.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox