Next: , Previous: , Up: Interaction.Output   [Contents][Index]


9.2.9 MessageToggle

Component: MessageToggle

This component toggles scripts and game objects based on messages. The ’Toggle’ message takes a boolean value, ’SwapToggle’ will alternate the current setting. Can be used with MultiMenu, Unity 5 UI, or other message senders. Just make sure that the thing you want to toggle appears in one of the lists above. To add scripts, drag and drop the header of the component onto the list itself, and MultiGame will add the reference. To do this on an object not currently being inspected, create a second Inspector by clicking the tiny menu icon next to the lock at the top of the Inspector -> Add Tab -> Inspector. Then dock the new inspector somewhere else, so that both are visible. Select the object that has the component you wish to target, then lock that inspector by clicking the tiny lock at the top. Finally, select this object (the one with the Message Toggle) and drag and drop the component itself (from it’s title text) onto the ’Script Targets’ list. This will tell MultiGame to add it to the list.

Field of MessageToggle: GameObject[] gameObjectTargets

Game Objects we will toggle

Field of MessageToggle: MonoBehaviour[] scriptTargets

Scripts we will toggle

Other Settings

Field of MessageToggle: Light lightTarget

Light we wish to toggle

Available Messages

Message on MessageToggle: ToggleOn ()

Enables all ’Game Object Targets’ and ’Script Targets’

Message on MessageToggle: ToggleOff ()

Disables all ’Game Object Targets’ and ’Script Targets’

Message on MessageToggle: SwapToggle ()

Reverses the state of all targets

Message on MessageToggle: Toggle (bool)

Allows you to set the state of all ’Game Object Targets’ and ’Script Targets’ explicitly

Argument: The new state for the targets

Field of MessageToggle: GameObject[] gameObjectTargets

Game Objects we will toggle

Field of MessageToggle: MonoBehaviour[] scriptTargets

Scripts we will toggle

Other Settings

Field of MessageToggle: Light lightTarget

Light we wish to toggle

Available Messages

Message on MessageToggle: ToggleOn ()

Enables all ’Game Object Targets’ and ’Script Targets’

Message on MessageToggle: ToggleOff ()

Disables all ’Game Object Targets’ and ’Script Targets’

Message on MessageToggle: SwapToggle ()

Reverses the state of all targets

Message on MessageToggle: Toggle (bool)

Allows you to set the state of all ’Game Object Targets’ and ’Script Targets’ explicitly

Argument: The new state for the targets


Next: , Previous: , Up: Interaction.Output   [Contents][Index]