Class LootSpawner
This class handle creating loot. It got a list of events and each events have a list of items with associated weight. When the spawn is triggered through the SpawnLoot function, it will spawn one item per events, with the item being picked randomly per event
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
LootSpawner
Namespace: CreatorKitCode
Assembly: Assembly-CSharp.dll
Syntax
public class LootSpawner : MonoBehaviour
Fields
Events
Declaration
public LootSpawner.SpawnEvent[] Events
Field Value
Type | Description |
---|---|
LootSpawner.SpawnEvent[] |
SpawnedClip
Declaration
public AudioClip SpawnedClip
Field Value
Type | Description |
---|---|
UnityEngine.AudioClip |
Methods
SpawnLoot()
Call this to trigger the spawning of the loot. Will spawn one item per event, picking the item randomly per event using the defined weight. Every call will pick randomly again (but most of the time, the caller will destroy the LootSpawner too as you spawn loot from something only once)
Declaration
public void SpawnLoot()