Class UnityExtensions
Extensions for Unity objects, and particularly for interacting with Scenes.
Inheritance
UnityExtensions
Assembly: ItemChanger.dll
Syntax
public static class UnityExtensions
Methods
View Source
FindChild(GameObject, IEnumerable<string>)
Declaration
public static GameObject FindChild(this GameObject g, IEnumerable<string> steps)
Parameters
Returns
View Source
FindChild(GameObject, string)
Declaration
public static GameObject? FindChild(this GameObject g, string name)
Parameters
Returns
View Source
FindChildInHierarchy(GameObject, string)
Breadth first search. Returns GameObject with given name, or null if not found. Parent object not included in search.
Declaration
public static GameObject? FindChildInHierarchy(this GameObject g, string name)
Parameters
Returns
View Source
FindGameObject(Scene, string)
Finds a GameObject in the given scene by its full path.
Declaration
public static GameObject? FindGameObject(this Scene s, string path)
Parameters
| Type |
Name |
Description |
| Scene |
s |
|
| string |
path |
The full path to the GameObject, with forward slash ('/') separators.
|
Returns
View Source
FindGameObjectByName(Scene, string)
Breadth first search through the entire hierarchy. Returns the first GameObject with the given name, or null.
Declaration
public static GameObject? FindGameObjectByName(this Scene s, string name)
Parameters
Returns
View Source
Declaration
public static string GetPathInHierarchy(this Transform t)
Parameters
Returns
View Source
Traverse(Scene)
Returns a list of objects in the scene hierarchy, ordered by depth-first-search.
The list consists of pairs where the first entry is the object path and the second entry is the object.
Declaration
public static List<(string path, GameObject go)> Traverse(this Scene s)
Parameters
| Type |
Name |
Description |
| Scene |
s |
|
Returns