Table of Contents

Class PrefabCollection

Namespace
Nautilus.Handlers
Assembly
Nautilus.dll
Represents a collection of PrefabInfo as keys and prefab factory as values.
public class PrefabCollection : IEnumerable<KeyValuePair<PrefabInfo, PrefabFactoryAsync>>, IEnumerable
Inheritance
PrefabCollection
Implements
Inherited Members
Extension Methods

Methods

Add(PrefabInfo, PrefabFactoryAsync, PrefabPostProcessorAsync)

Adds a prefab info with the function that constructs the game object into the game.
public void Add(PrefabInfo info, PrefabFactoryAsync prefabFactory, PrefabPostProcessorAsync postProcessor = null)

Parameters

info PrefabInfo
The prefab info to register.
prefabFactory PrefabFactoryAsync
The function that constructs the game object for this prefab info.
postProcessor PrefabPostProcessorAsync
The prefab post processor that will be invoked after Nautilus's prefab processing.

ContainsPrefabInfo(PrefabInfo)

Determines whether the provided prefab info is registered.
public bool ContainsPrefabInfo(PrefabInfo info)

Parameters

info PrefabInfo
The prefab info to look for

Returns

bool
true if found; otherwise, .

Remove(PrefabInfo)

Removes a prefab info from the game. This leads to unregistering the specified prefab info from the game.
public bool Remove(PrefabInfo info)

Parameters

info PrefabInfo
The prefab info to unregister.

Returns

bool
if the element is successfully found and removed; otherwise, . This method returns if the prefab info is not found.

TryGetInfoForClassId(string, out PrefabInfo)

Gets the prefab info associated with the provided class ID.
public bool TryGetInfoForClassId(string classId, out PrefabInfo info)

Parameters

classId string
The class ID of the prefab info to get.
info PrefabInfo
The returned prefab info. If nothing was found for the class ID specified, this will be set to the default initialization instead.

Returns

bool
True if found; otherwise false.

TryGetInfoForFileName(string, out PrefabInfo)

Gets the prefab info associated with the provided file name.
public bool TryGetInfoForFileName(string fileName, out PrefabInfo info)

Parameters

fileName string
The file name of the prefab info to get.
info PrefabInfo
The returned prefab info. If nothing was found for the file name specified, this will be set to the default initialization instead.

Returns

bool
True if found; otherwise false.

TryGetInfoForTechType(TechType, out PrefabInfo)

Gets the prefab info associated with the provided tech type.
public bool TryGetInfoForTechType(TechType techType, out PrefabInfo info)

Parameters

techType TechType
The tech type of the prefab info to get.
info PrefabInfo
The returned prefab info. If nothing was found for the tech type specified, this will be set to the default initialization instead.

Returns

bool
True if found; otherwise false.

TryGetPostProcessorForInfo(PrefabInfo, out PrefabPostProcessorAsync)

Gets the prefab post processor associated with the provided info.
public bool TryGetPostProcessorForInfo(PrefabInfo info, out PrefabPostProcessorAsync postProcessor)

Parameters

info PrefabInfo
The info of the post processor to get.
postProcessor PrefabPostProcessorAsync
The returned post processor. If nothing was found for the prefab info specified, this will be set to the default initialization instead.

Returns

bool
true if found; otherwise, .

TryGetPrefabForInfo(PrefabInfo, out PrefabFactoryAsync)

Gets the prefab factory associated with the provided info.
public bool TryGetPrefabForInfo(PrefabInfo info, out PrefabFactoryAsync prefabFactory)

Parameters

info PrefabInfo
The info of the prefab factory to get.
prefabFactory PrefabFactoryAsync
The returned prefab factory. If nothing was found for the prefab info specified, this will be set to the default initialization instead.

Returns

bool
true if found; otherwise, .