RandomPooledObjectDefinition
A class in Root.Township, the global namespace.
Pooled object definition asset that picks one of several pooled definitions by weight each time an object is requested.
Constructors
| Member | What it is |
|---|
RandomPooledObjectDefinition() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
2 private and internal fields
Methods
| Member | What it is |
|---|
override PooledObject Get(Vector3 position, Quaternion rotation) | Meant to pick a definition by weight and get an object from it. The roll is cast to int before scaling, so it almost always picks the first entry with weight above 0. |
override void InitializePool() | Initializes every listed definition's pool and totals their weights. |