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


9.11 Selectable

Component: Selectable

This component implements a generic selection system for your game. To use add some indicators to the prefab you wish to be selectable like green circles around the feet or arrows above the head. Also determine if you want any functionality to occur when the object is selected for example opening a production menu on unit production structures. Add all of these to the appropriate lists above. Then, send the ’Select’ and ’Deselect’ messages to the object when appropriate using any message sender.

Field of Selectable: List<GameObject> selectionEnabledObjects

Objects that will be toggled on when we are selected

Default value: new List<GameObject>()

Field of Selectable: List<GameObject> selectionDisabledObjects

Objects that will be toggled off when we are selected

Default value: new List<GameObject>()

Field of Selectable: List<MonoBehaviour> selectionEnabledComponents

Scripts that will be toggled on when we are selected

Default value: new List<MonoBehaviour>()

Field of Selectable: List<MonoBehaviour> SelectionDisabledComponents

Scripts that will be toggled off when we are selected

Default value: new List<MonoBehaviour>()

Field of Selectable: List<MessageManager.ManagedMessage> messages

A list of messages which can be sent depending on whether or not the object is selected by the player

Default value: new List<MessageManager.ManagedMessage>()

Available Messages

Message on Selectable: Select ()

Selects this object, activating/deactivating the appropriate scripts and objects, listed above

Message on Selectable: Deselect ()

Deselects this object, activating/deactivating the appropriate scripts and objects, listed above

Message on Selectable: ToggleSelection ()

Swaps the selection state of this object, activating/deactivating the appropriate scripts and objects, listed above

Message on Selectable: RelayIfSelected ()

Sends all ’Messages’, but only if this object is currently selected

Field of Selectable: List<GameObject> selectionEnabledObjects

Objects that will be toggled on when we are selected

Default value: new List<GameObject>()

Field of Selectable: List<GameObject> selectionDisabledObjects

Objects that will be toggled off when we are selected

Default value: new List<GameObject>()

Field of Selectable: List<MonoBehaviour> selectionEnabledComponents

Scripts that will be toggled on when we are selected

Default value: new List<MonoBehaviour>()

Field of Selectable: List<MonoBehaviour> SelectionDisabledComponents

Scripts that will be toggled off when we are selected

Default value: new List<MonoBehaviour>()

Field of Selectable: List<MessageManager.ManagedMessage> messages

A list of messages which can be sent depending on whether or not the object is selected by the player

Default value: new List<MessageManager.ManagedMessage>()

Available Messages

Message on Selectable: Select ()

Selects this object, activating/deactivating the appropriate scripts and objects, listed above

Message on Selectable: Deselect ()

Deselects this object, activating/deactivating the appropriate scripts and objects, listed above

Message on Selectable: ToggleSelection ()

Swaps the selection state of this object, activating/deactivating the appropriate scripts and objects, listed above

Message on Selectable: RelayIfSelected ()

Sends all ’Messages’, but only if this object is currently selected


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