LiquidVisualChunkDefinition
A class in Root.Township, Alta.Cooking.
An asset that spawns floating chunk visuals in a liquid (such as pieces in a stew), with random count and size variation.
- Listed in Crafting and making
- Inherits or implements
HashedGeneralValue<LiquidVisualChunkDefinition> - Derived types
LiquidVisualChunkDefinition - Attributes
HashedPath - Documented in Cooking
Constructors
| Member | What it is |
|---|---|
LiquidVisualChunkDefinition() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private float amountVariation | Random variation in the count, as a share of numberPerServing. 0 by default. |
private const string AssetPathFormat | Editor asset path pattern for chunk definitions. GetOrCreate does nothing in this build. |
private int numberPerServing | How many chunk visuals spawn per serving. 3 by default. |
private PooledObjectDefinition pooledObjectDefinition | Pooled object spawned for each chunk visual. |
private float size | Base scale of each chunk. 1 by default. |
private float sizeVariation | Random variation in size, as a share of size. 0.1 by default. |
Methods
| Member | What it is |
|---|---|
static LiquidVisualChunkDefinition GetOrCreate(string name, out bool wasCreated) | Editor helper to find or create the asset by name. Returns null in this build. |
IEnumerable<PooledObject> SpawnVisuals(Transform targetTransform, float sizeMultiplier) (iterator) | Spawns pooled chunk objects under the target, about numberPerServing of them, each scaled by the random size times the multiplier. |
1 private and internal method
Used in
Members of other types that take, return or hold a LiquidVisualChunkDefinition:
CookableItem.chunkVisual, CookableItem.ChunkVisual, LiquidChunkVisuals.AddNewChunkVisuals, LiquidChunkVisuals.CreateVisualForIngredient, LiquidChunkVisuals.existingLiquidChunks, LiquidChunkVisuals.RemoveChunkVisuals, LiquidChunkVisuals.LiquidChunkData.Definition, StewManager.GetChunkVisuals, LiquidContainerSaveData.CustomData.chunks, LiquidData.chunkVisuals, LiquidData.ChunkVisuals, LiquidData.LiquidData.