Tanks Multiplayer  1.4
Public Member Functions | Public Attributes | List of all members
Collectible

Base class for all derived Collectibles (health, shields, etc.) consumed or carried around. Extend this to create highly customized Collectible with specific functionality. More...

Inheritance diagram for Collectible:
CollectibleTeam PowerupBullet PowerupHealth PowerupShield

Public Member Functions

override void OnStartClient ()
 Get component references once the network is initialized. More...
 
virtual void OnTriggerEnter (Collider col)
 Server only: check for players colliding with this item. Possible collision are defined in the Physics Matrix. More...
 
virtual bool Apply (Player p)
 Tries to apply the Collectible to a colliding player. Returns 'true' if consumed. Override this method in your own Collectible script to implement custom behavior. More...
 
virtual void OnPickup ()
 Virtual implementation called when this Collectible gets picked up. This is called for CollectionType = Pickup items only. More...
 
virtual void OnDrop ()
 Virtual implementation called when this Collectible gets dropped on player death. This is called for CollectionType = Pickup items only. More...
 
virtual void OnReturn ()
 Virtual implementation called when this Collectible gets returned. This is called for CollectionType = Pickup items only. More...
 

Public Attributes

NetworkInstanceId parentId
 Network reference to the object that spawned this item in the scene. Used for access to the ObjectSpawner parent in OnDespawn(). More...
 
AudioClip useClip
 Clip to play when this Collectible is consumed by a player. More...
 
NetworkInstanceId carrierId
 Persistent network ID of the Player that picked up this Collectible. More...
 
ObjectSpawner spawner
 Reference to the local object (script) that spawned this Collectible. More...
 

Detailed Description

Base class for all derived Collectibles (health, shields, etc.) consumed or carried around. Extend this to create highly customized Collectible with specific functionality.

Member Function Documentation

virtual bool Apply ( Player  p)
virtual

Tries to apply the Collectible to a colliding player. Returns 'true' if consumed. Override this method in your own Collectible script to implement custom behavior.

Reimplemented in CollectibleTeam, PowerupBullet, PowerupHealth, and PowerupShield.

virtual void OnDrop ( )
virtual

Virtual implementation called when this Collectible gets dropped on player death. This is called for CollectionType = Pickup items only.

Reimplemented in CollectibleTeam.

virtual void OnPickup ( )
virtual

Virtual implementation called when this Collectible gets picked up. This is called for CollectionType = Pickup items only.

virtual void OnReturn ( )
virtual

Virtual implementation called when this Collectible gets returned. This is called for CollectionType = Pickup items only.

Reimplemented in CollectibleTeam.

override void OnStartClient ( )

Get component references once the network is initialized.

virtual void OnTriggerEnter ( Collider  col)
virtual

Server only: check for players colliding with this item. Possible collision are defined in the Physics Matrix.

Reimplemented in CollectibleTeam.

Member Data Documentation

NetworkInstanceId carrierId

Persistent network ID of the Player that picked up this Collectible.

NetworkInstanceId parentId

Network reference to the object that spawned this item in the scene. Used for access to the ObjectSpawner parent in OnDespawn().

ObjectSpawner spawner

Reference to the local object (script) that spawned this Collectible.

AudioClip useClip

Clip to play when this Collectible is consumed by a player.


The documentation for this class was generated from the following file: