Class PrefabCollection
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
infoPrefabInfo- The prefab info to register.
prefabFactoryPrefabFactoryAsync- The function that constructs the game object for this prefab info.
postProcessorPrefabPostProcessorAsync- 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
infoPrefabInfo- The prefab info to look for
Returns
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
infoPrefabInfo- 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
classIdstring- The class ID of the prefab info to get.
infoPrefabInfo- 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
fileNamestring- The file name of the prefab info to get.
infoPrefabInfo- 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
techTypeTechType- The tech type of the prefab info to get.
infoPrefabInfo- 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
infoPrefabInfo- The info of the post processor to get.
postProcessorPrefabPostProcessorAsync- The returned post processor. If nothing was found for the prefab info specified, this will be set to the default initialization instead.
Returns
TryGetPrefabForInfo(PrefabInfo, out PrefabFactoryAsync)
Gets the prefab factory associated with the provided info.
public bool TryGetPrefabForInfo(PrefabInfo info, out PrefabFactoryAsync prefabFactory)
Parameters
infoPrefabInfo- The info of the prefab factory to get.
prefabFactoryPrefabFactoryAsync- The returned prefab factory. If nothing was found for the prefab info specified, this will be set to the default initialization instead.