BomberUnits
...a Unity learning project
LootSpawner Class Reference

Provides the 'LootSpawner' attribute to game objects, giving them the 'RollDropLoot()' method. More...

+ Inheritance diagram for LootSpawner:
+ Collaboration diagram for LootSpawner:

Public Member Functions

void RollDropLoot ()
 Randomly decides whether and which loot shall be generated. More...
 

Public Attributes

GameObject [] lootPrefabs
 
float lootChance = 0.5f
 

Private Member Functions

GameObject RollLootType ()
 

Private Attributes

bool hasSpawned = false
 Debounce flag against multiple invocations of RollDropLoot()
 

Detailed Description

Provides the 'LootSpawner' attribute to game objects, giving them the 'RollDropLoot()' method.

The Loot game objects are set in the lootPrefabs list.

Definition at line 9 of file LootSpawner.cs.

Member Function Documentation

◆ RollDropLoot()

void RollDropLoot ( )
inline

Randomly decides whether and which loot shall be generated.

Is debounced, so can only act once. Also the function can only act if this client is the master.

Definition at line 31 of file LootSpawner.cs.


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