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


9.1.5 Collectible

Component: Collectible

This component implements a collectible object. This requires that a CollectionManager be present somewhere in the scene (only one manager should be present, each collectible needs one of these components however). To use, place on an object you would like the player to collect. Either this object, or the player needs a Rigidbody component.

Optional Field of Collectible: string playerTag

If defined, collection will occur on collision with the object tagged. Otherwise you must send ’Collect’ to this object.

Field of Collectible: GameObject deathPrefab

Object to spawn when we are collected. Does not work with object pooling, and will instantiate a new one each time this object is re-used.

Message on Collectible: Collect ()

Causes this object to be collected

Optional Field of Collectible: string playerTag

If defined, collection will occur on collision with the object tagged. Otherwise you must send ’Collect’ to this object.

Field of Collectible: GameObject deathPrefab

Object to spawn when we are collected. Does not work with object pooling, and will instantiate a new one each time this object is re-used.

Message on Collectible: Collect ()

Causes this object to be collected