Class FabricatorTemplate
- Namespace
- Nautilus.Assets.PrefabTemplates
- Assembly
- Nautilus.dll
Represents an fabricator template. This template is capable of returning a Fabricator or a Workbench.
public class FabricatorTemplate : PrefabTemplate
- Inheritance
-
FabricatorTemplate
- Inherited Members
- Extension Methods
Constructors
FabricatorTemplate(PrefabInfo, Type)
Creates a FabricatorTemplate instance.
public FabricatorTemplate(PrefabInfo info, CraftTree.Type craftTreeType)
Parameters
info
PrefabInfo- The prefab info to base this template off of.
craftTreeType
CraftTree.Type- The craft tree type for this template.
Properties
ColorTint
Applies a simple color tint to the fabricator model.
public Color? ColorTint { get; set; }
Property Value
- Color?
ConstructableFlags
Indicates where this fabricator can be placed.
By default, this is set to the following flags:
Inside for all fabricators.
Wall for non-workbench fabricators.
And Ground and Rotatable for workbench.
Inside for all fabricators.
Wall for non-workbench fabricators.
And Ground and Rotatable for workbench.
public ConstructableFlags ConstructableFlags { get; set; }
Property Value
FabricatorModel
The model this template will use. Leave it to Custom if you've got a custom model.
public FabricatorTemplate.Model FabricatorModel { get; set; }
Property Value
ModifyPrefab
Callback that will get called after the prefab is retrieved. Use this to modify or process your prefab further more.
public Action<GameObject> ModifyPrefab { get; set; }
Property Value
- Action<GameObject>
ModifyPrefabAsync
Callback that will get called after the prefab is retrieved. Use this to modify or process your prefab further more asynchronously.
public Func<GameObject, IEnumerator> ModifyPrefabAsync { get; set; }
Property Value
- Func<GameObject, IEnumerator>
Methods
GetPrefabAsync(TaskResult<GameObject>)
Gets the appropriate fabricator prefab.
public override IEnumerator GetPrefabAsync(TaskResult<GameObject> gameObject)
Parameters
gameObject
TaskResult<GameObject>- The fabricator prefab is set into this argument.
If the provided task result already has a game object, it will try to set the necessary components first. Otherwise; sets the standard Battery or Power Cell.
Returns
- IEnumerator
- A coroutine operation. Must be used with either
yield return
, or StartCoroutine(IEnumerator).