PrefabHelper

Class in ChivalrousGames.Common / Inherits from MonoBehaviour

Description

Class that allows revert feature of basic nested prefabs.

Properties

Guid string Gets or sets the GUID of the prefab.
AssetPath string ReadOnly
Gets the asset path.
Linked bool ReadOnly
Gets a value indicating whether this PrefabHelper is linked to an existing prefab.
Prefab GameObject ReadOnly
Gets the prefab associated with this PrefabHelper.

Methods

Revert
public void Revert(bool revertTree = false);
Parameters
revertTree bool Optional
If set to true revert nested prefab helpers as well.
Description

Revert the specified prefab helper object.

CountInstances
public void CountInstances();
Return
int The total number instances found in the project and in all the scenes.
Description

Counts the instances of prefab helpers linked to the same prefab everywhere in the project. Mostly a debug method, also outputs detailed results in the console.

Static Methods

GetAllPrefabHelpersInScene
public static List GetAllPrefabHelpersInScene(Scene scene);
Parameters
scene Scene Scene to search
Return
List All prefab helpers in specified scene.
Description

Gets all prefab helpers in specified scene. You can’t modify them right away though, you would need to load the scene first.

GetAllPrefabHelpersInProject
public static List GetAllPrefabHelpersInProject();
Return
List All the prefab helpers in the project.
Description

Gets all prefab helpers in the project.

GetUnlinkedPrefabHelpers
public static List GetUnlinkedPrefabHelpers(List prefabHelpers);
Parameters
prefabHelpers List Prefab helpers list to search.
Return
List The unlinked prefab helpers.
Description

Gets the unlinked prefab helpers from a specified list.

GetLinkedPrefabHelpers
public static List GetLinkedPrefabHelpers(List prefabHelpers);
Parameters
prefabHelpers List Prefab helpers list to search.
Return
List The linked prefab helpers.
Description

Gets the linked the prefab helpers from a specified list.

GetPrefabHelperLinkedToPrefab
public static List GetPrefabHelperLinkedToPrefab(List prefabHelpers, GameObject prefab);
Parameters
prefabHelpers List Prefab helpers list to search.
prefab GameObject Prefab to which prefab helpers must be linked.
Return
List The prefab helper linked to a specific prefab.
Description

Gets the prefab helper linked to a specific prefab from a specified list.