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


9.2.2 Collection Manager

Component: CollectionManager

This component handles basic collectible-based scoring. To use, add this to an object in the scene and add a ’Collectible’ component to the prefab for your game’s collectible item. When one is collected, ’Collection Message’ will be sent. When the player reaches the ’Max’ (defined above), ’Maxed Message’ will be sent. For example you could have coins, and set the ’Max’ to 100. Then, if you have ’lives’ in your game you could add an additional life to the player by sending a message to the component which manages player lives. To write a message in a script, simply implement a new method as such:

public void MyNewMessage( ) The message you implement may have 0 arguments, or it may take an integer, float, bool, or string. This will tell MultiGame to add it to the Messages list when you hit ’Refresh Messages’.

Field of CollectionManager: string windowTitle

A name for the window showing collections

Default value: ""

Field of CollectionManager: int windowID

Must be a unique number, different from all other windows in the game

Default value: 53346

Field of CollectionManager: int max

The maximum needed

Default value: 0

Field of CollectionManager: MessageManager.ManagedMessage collectionMessage

Message to send when one is collected

Field of CollectionManager: MessageManager.ManagedMessage maxedMessage

Message to send when we have collected the full quantity

Field of CollectionManager: GameObject target

Managed Message target override

Field of CollectionManager: bool closeOnCompletion

Should the GUI close itself when we are done?

Default value: false

Field of CollectionManager: bool showGUI

Should we show an IMGUI to display the collection score?

Default value: true

Message on CollectionManager: Collect ()

Increments the collection count by one, sending messages as appropriate

Field of CollectionManager: string windowTitle

A name for the window showing collections

Default value: ""

Field of CollectionManager: int windowID

Must be a unique number, different from all other windows in the game

Default value: 53346

Field of CollectionManager: int max

The maximum needed

Default value: 0

Field of CollectionManager: MessageManager.ManagedMessage collectionMessage

Message to send when one is collected

Field of CollectionManager: MessageManager.ManagedMessage maxedMessage

Message to send when we have collected the full quantity

Field of CollectionManager: GameObject target

Managed Message target override

Field of CollectionManager: bool closeOnCompletion

Should the GUI close itself when we are done?

Default value: false

Field of CollectionManager: bool showGUI

Should we show an IMGUI to display the collection score?

Default value: true

Message on CollectionManager: Collect ()

Increments the collection count by one, sending messages as appropriate


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