TransformExtensions
Class in ChivalrousGames.Common
Description
A static class used to add extension methods to Transform.
Static Methods
DestroyAllChildren
public static void DestroyAllChildren(this Transform transform);
Parameters
transform | Transform | The current transform |
Description
Destroys all children of a Transform.
GetAllChildren
public static List GetAllChildren(this Transform transform);
Parameters
transform | Transform | The current transform |
Return
List<Transform> | The list of all first level children |
Description
Returns the list of all first level children of a Transform.
Reset
public static void Reset(this Transform transform);
Parameters
transform | Transform | The current transform |
Description
Reset the specified transform. Exactly like “reset” does in the editor.
SafeDestroy
public static void SafeDestroy(this Transform transform, float t = 0.0f);
Parameters
transform | Transform | The transform to destroy. |
t | float | The optional amount of time (in seconds) to delay before destroying the object. (works only at runtime) |
Description
A destroy method for a transform that handles runtime / design time