Class CloneTemplate
- Namespace
- Nautilus.Assets.PrefabTemplates
- Assembly
- Nautilus.dll
Represents a prefab clone template.
public class CloneTemplate : PrefabTemplate
- Inheritance
-
CloneTemplate
- Inherited Members
- Extension Methods
Constructors
CloneTemplate(PrefabInfo, string)
Creates a CloneTemplate instance.
public CloneTemplate(PrefabInfo info, string classIdToClone)
Parameters
info
PrefabInfo- The prefab info to base this template off of.
classIdToClone
string- The class ID to clone and use for this template.
CloneTemplate(PrefabInfo, TechType)
Creates a CloneTemplate instance.
public CloneTemplate(PrefabInfo info, TechType techTypeToClone)
Parameters
info
PrefabInfo- The prefab info to base this template off of.
techTypeToClone
TechType- The tech type to clone and use for this template.
CloneTemplate(PrefabInfo, AssetReferenceGameObject)
Creates a CloneTemplate instance.
public CloneTemplate(PrefabInfo info, AssetReferenceGameObject prefabToClone)
Parameters
info
PrefabInfo- The prefab info to base this template off of.
prefabToClone
AssetReferenceGameObject- The AssetReferenceGameObject with a valid key to clone and use for this template.
Properties
ModelDatas
Reskinning model data to apply to the clone.
public List<CustomModelData> ModelDatas { get; }
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 cloned prefab.
public override IEnumerator GetPrefabAsync(TaskResult<GameObject> gameObject)
Parameters
gameObject
TaskResult<GameObject>- The cloned prefab is set into this argument.
If the provided task result already has a game object, this method will only call the ModifyPrefab callback on it. Otherwise; Creates a prefab clone, then runs the ModifyPrefab callback.
Returns
- IEnumerator
- A coroutine operation. Must be used with either
yield return
, or StartCoroutine(IEnumerator).