Class EggTemplate
- Namespace
- Nautilus.Assets.PrefabTemplates
- Assembly
- Nautilus.dll
Represents a creature egg prefab template.
public class EggTemplate : PrefabTemplate
- Inheritance
-
EggTemplate
- Inherited Members
- Extension Methods
Constructors
EggTemplate(PrefabInfo, AssetBundleTemplate)
Creates a EggTemplate instance and sets the specified asset bundle prefab as the base model.
public EggTemplate(PrefabInfo info, AssetBundleTemplate assetBundleTemplate)
Parameters
info
PrefabInfo- The prefab info to base this template off of.
assetBundleTemplate
AssetBundleTemplate- The asset bundle prefab to set as the model.
EggTemplate(PrefabInfo, string)
Creates a EggTemplate instance and sets a class ID as the base model.
public EggTemplate(PrefabInfo info, string classId)
Parameters
info
PrefabInfo- The prefab info to base this template off of.
classId
string- The class ID to clone and use as the base.
EggTemplate(PrefabInfo, TechType)
Creates a EggTemplate instance and sets a tech type as the base model.
public EggTemplate(PrefabInfo info, TechType techType)
Parameters
info
PrefabInfo- The prefab info to base this template off of.
techType
TechType- The tech type to clone and use as the base.
EggTemplate(PrefabInfo, GameObject)
Creates a EggTemplate instance and sets the specified game object as the base model.
public EggTemplate(PrefabInfo info, GameObject model)
Parameters
info
PrefabInfo- The prefab info to base this template off of.
model
GameObject- The game object to set as the model.
Properties
CellLevel
Determines how close you have to be to the egg for it to appear. Defaults to LargeWorldEntity.CellLevel.Medium.
public LargeWorldEntity.CellLevel CellLevel { get; set; }
Property Value
- LargeWorldEntity.CellLevel
HatchingCreature
the creature that's going to hatch from this egg.
public TechType HatchingCreature { get; set; }
Property Value
- TechType
HatchingTime
amount of in-game days this egg will take to hatch the HatchingCreature.
public float HatchingTime { get; set; }
Property Value
Mass
Mass of the egg by KG. defaulted to 100.
public float Mass { get; set; }
Property Value
MaxHealth
Health of the egg. defaulted to 60.
public float MaxHealth { 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>
UndiscoveredTechType
The Undiscovered Techtype of this egg.
public TechType UndiscoveredTechType { get; }
Property Value
- TechType
- The undiscovered TechType if the SetUndiscoveredTechType() was invoked; otherwise TechType.None.
Methods
GetPrefabAsync(TaskResult<GameObject>)
Gets the appropriate egg prefab.
public override IEnumerator GetPrefabAsync(TaskResult<GameObject> gameObject)
Parameters
gameObject
TaskResult<GameObject>- The egg prefab is is set to this argument.
Returns
- IEnumerator
- A coroutine operation. Must be used with either
yield return
, or StartCoroutine(IEnumerator).
OnModifyPrefab(Action<GameObject>)
Callback that will get called after the prefab is retrieved. Use this to modify or process your prefab further more.
public EggTemplate OnModifyPrefab(Action<GameObject> modifyPrefabAction)
Parameters
modifyPrefabAction
Action<GameObject>- The callback.
Returns
- EggTemplate
- A reference to this instance after the operation is completed.
OnModifyPrefabAsync(Func<GameObject, IEnumerator>)
Callback that will get called after the prefab is retrieved. Use this to modify or process your prefab further more asynchronously.
public EggTemplate OnModifyPrefabAsync(Func<GameObject, IEnumerator> modifyPrefabAsyncAction)
Parameters
modifyPrefabAsyncAction
Func<GameObject, IEnumerator>- The callback.
Returns
- EggTemplate
- A reference to this instance after the operation is completed.
SetUndiscoveredTechType()
Makes this egg have an unidentified egg tech type before hatching. Once it hatches, it will receive the main egg tech type.
public EggTemplate SetUndiscoveredTechType()
Returns
- EggTemplate
- A reference to this instance after the operation is completed.
WithCellLevel(CellLevel)
Determines how close you have to be to the egg for it to appear.
public EggTemplate WithCellLevel(LargeWorldEntity.CellLevel cellLevel)
Parameters
cellLevel
LargeWorldEntity.CellLevel- The cell level.
Returns
- EggTemplate
- A reference to this instance after the operation is completed.
WithHatchingCreature(TechType)
the creature that's going to hatch from this egg.
public EggTemplate WithHatchingCreature(TechType hatchingCreature)
Parameters
hatchingCreature
TechType- The tech type for the hatching creature.
Returns
- EggTemplate
- A reference to this instance after the operation is completed.
WithHatchingTime(float)
amount of in-game days this egg will take to hatch the HatchingCreature.
public EggTemplate WithHatchingTime(float hatchingTime)
Parameters
hatchingTime
float- The amount of days.
Returns
- EggTemplate
- A reference to this instance after the operation is completed.
WithMass(float)
Mass of the egg by KG.
public EggTemplate WithMass(float mass)
Parameters
mass
float- The mass.
Returns
- EggTemplate
- A reference to this instance after the operation is completed.
WithMaxHealth(float)
Health of the egg.
public EggTemplate WithMaxHealth(float maxHealth)
Parameters
maxHealth
float- The health.
Returns
- EggTemplate
- A reference to this instance after the operation is completed.