GenericCraftingResult
A class in Root.Township, Alta.Crafting.
Component on a finished generic-crafting item (one built from pieces on a crafting station). It maps part hashes to their materials, and lets the item be put back on a station to take it apart. Both sides.
- Listed in Crafting and making
- Inherits or implements
NetworkEntityBehaviour,ISerializationCallbackReceiver,IGenericCraftingComponent,IPreventAtlasing
Constructors
| Member | What it is |
|---|---|
GenericCraftingResult() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private LODBaker baker | LOD baker run on clients after the bake message. |
private MonoBehaviour[] blockDecrafting | Serialized components that implement IBlockGenericDecrafting. Any of them can stop the item being taken apart. |
private IBlockGenericDecrafting[] blockDecraftingComponents | blockDecrafting cast to IBlockGenericDecrafting, filled in after deserialization. |
private int[] hashes | Hashes matching each entry in parts, by index. |
private PhysicalMaterialPart[] parts | Material parts that make up the item. |
private MethodSync syncBake | Method sync that tells clients to bake the item's LODs. |
Properties
| Member | What it is |
|---|---|
Dictionary<int, PhysicalMaterialPart> Parts { get; } | Material parts of the item keyed by their hash. Built after deserialization. |
1 private and internal property
Methods
| Member | What it is |
|---|---|
override void Initialize() | Sets up the SyncBake method sync on the entity. |
override void OnConnected(Player player) | Server: when a player connects, sends them the bake message if the item has an LOD baker. |
7 private and internal methods
| Member | What it is |
|---|---|
private bool Alta.Utilities.Atlas.IPreventAtlasing.IsPreventAtlasing(Renderer renderer) | True if any of the item's material parts says the renderer must not be atlased. |
private void UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() | Rebuilds Parts from the serialized hash and part arrays, and casts the decraft blockers to their interface. |
private void UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize() | Does nothing. |
private void OnValidate() | Editor: keeps hashes the same length as parts, drops empty parts and fills in missing hashes. |
private void Alta.Crafting.IGenericCraftingComponent.Released(GenericCraftingStation station) | Called when the item is let go on a crafting station. Unless a decraft blocker says no, the station sets up a project from this item. |
private void SyncBake(IPlayer player, Stream stream) | Client: on the bake message, waits one second and bakes the LODs. Skipped on headless builds. |
private void Alta.Crafting.IGenericCraftingComponent.Track(GenericCraftingStation station) | Does nothing for a result. |
Used in
Members of other types that take, return or hold a GenericCraftingResult: