![]() |
BomberUnits
...a Unity learning project
|
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() | |
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.
|
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.