Class ModPrefabCache
Class used by PrefabInfo to store game objects that used as prefabs.
Game objects in cache are inactive and will not be on scene.
public static class ModPrefabCache
- Inheritance
-
ModPrefabCache
- Inherited Members
Methods
AddPrefab(GameObject, bool)
Add prefab to cache
public static void AddPrefab(GameObject prefab, bool autoremove = true)
Parameters
prefabGameObject- Prefab to add.
autoremovebool- Is prefab needed to be removed from cache after use. Prefabs without autoremove flag can be safely deleted by UnityEngine.Object.Destroy(UnityEngine.Object)
AddPrefabCopy(GameObject, bool)
Add prefab copy to cache (instatiated copy will not run 'Awake')
public static GameObject AddPrefabCopy(GameObject prefab, bool autoremove = true)
Parameters
prefabGameObject- Prefab to copy and add.
autoremovebool- Is prefab copy needed to be removed from cache after use. Prefabs without autoremove flag can be safely deleted by UnityEngine.Object.Destroy(UnityEngine.Object)
Returns
- GameObject
- Prefab copy