An abstract class in Root.Township, Alta.Blacksmithing.
Base for items that can be melted down in a smelter (ingots, forged parts). The smelter checks whether every counted heat point is hot enough, then adds IngotValue of the material.
Constructors
| Member | What it is |
|---|
protected MeltingModel() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|
private MeshFilter androidMeshFilter | Mesh filter used for the Android version of the model. |
private HeatPointCollection heatPointCollection | Heat points checked by IsAtMeltingPoint. Found in children if not set. |
private float ingotValue | Backing value for IngotValue: how much of an ingot melting this gives (0.3 by default). |
private bool istriggeringAbilities | Backing field for IsTriggeringAbilities. |
private MeshFilter mainMeshFilter | Mesh filter used for MeshBounds and FilterTransform. Found from a child ForgedModel if not set. |
private MeltingModelModifier[] modifiers | Melting modifiers initialised on the server and terminated when the model goes. |
Properties
| Member | What it is |
|---|
Transform FilterTransform { get; } | Transform of the main mesh. |
float IngotValue { get; } | Amount of material it melts into, after yieldMultiplierFilter handlers. Default 0.3. |
bool IsAtMeltingPoint { get; } | True when every heat point counted for melting is at or above the material's glowing end temperature. |
bool IsMeltingAllowed { get; } | True unless an isAllowedFilter handler says no. The smelter skips items that are not allowed. |
bool IsTriggeringAbilities { get; } | Whether ember composers treat this item as triggering abilities. Default true. |
Bounds MeshBounds { get; } | Bounds of the main mesh. |
abstract PhysicalMaterial PhysicalMaterial { get; } | Material the item is made of. |
Events
| Member | What it is |
|---|
event MeltingModelAllowed isAllowedFilter | Lets other code block melting for this item. |
event MeltingModelYield yieldMultiplierFilter | Lets other code change the melt yield. |
Methods
| Member | What it is |
|---|
override void InitializeAsServer(SpawnData spawnData) | Server: starts the item's melting modifiers. |
virtual void OnValidate() | Finds the heat point collection and main mesh in the editor. |
void Setup(PhysicalMaterial material, float ingotValue) | Sets the material, and optionally the ingot value. |
void Setup(PhysicalMaterial material) | Sets the material, and optionally the ingot value. |
protected abstract void InternalSetup(PhysicalMaterial material) | Sets the item's material. Subclasses implement it. |
2 private and internal methods
| Member | What it is |
|---|
private void OnDestroy() | On the server (unless the entity is being destroyed), terminates the modifiers. Clears the filter events. |
private void SceneDestroy(NetworkEntity entity, bool isUnload) | Server: terminates the modifiers when the entity is destroyed by the scene. |
Used in
Members of other types that take, return or hold a MeltingModel:
CraftingMeltingAllowedModifier.AllowedFilter, CraftingMeltingAllowedModifier.Initialize, CraftingMeltingAllowedModifier.pickupMaps, CraftingMeltingAllowedModifier.Terminate, DurabilityMeltingYieldModifier.Initialize, DurabilityMeltingYieldModifier.Terminate, DurabilityMeltingYieldModifier.YieldMultiplier, MeltingHeatPoint.meltingModel, MeltingModelAllowed.BeginInvoke, MeltingModelAllowed.Invoke, MeltingModelModifier.Initialize, MeltingModelModifier.Terminate, MeltingModelYield.BeginInvoke, MeltingModelYield.Invoke, Recycler.MeltingModelReference.MeltingModel, Recycler.MeltingModelReference.MeltingModelReference.