Table of Contents

Class EnergySourceTemplate

Namespace
Nautilus.Assets.PrefabTemplates
Assembly
Nautilus.dll
Represents an energy source template. This template is capable of returning a Battery or a Power Cell.
public class EnergySourceTemplate : PrefabTemplate
Inheritance
EnergySourceTemplate
Inherited Members
Extension Methods

Constructors

EnergySourceTemplate(PrefabInfo, int)

Creates an EnergySourceTemplate instance.
public EnergySourceTemplate(PrefabInfo info, int energyAmount)

Parameters

info PrefabInfo
The prefab info to base this template off of.
energyAmount int
The amount of energy this source should have.

Properties

IsPowerCell

Is this energy source a Power Cell?
public bool IsPowerCell { get; set; }

Property Value

bool

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>

UseIonModelAsBase

Determines which model to use as the base. If true, this template will use the Precursor Ion Battery or Power cell.
Otherwise; uses the default Battery or Power Cell models.
public bool UseIonModelAsBase { get; set; }

Property Value

bool

Methods

GetPrefabAsync(TaskResult<GameObject>)

Gets the appropriate energy source prefab.
public override IEnumerator GetPrefabAsync(TaskResult<GameObject> gameObject)

Parameters

gameObject TaskResult<GameObject>
The energy source 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).