Megadocs 0.0.1
All of megapop's internal libraries
Megapop.MegaCore.TransformExt Class Reference

Static Public Member Functions

static void SwapValues (Transform t1, Transform t2)
 Swap transform values between two transforms More...
 
static void Copy (this Transform t1, Transform copyFrom)
 Set all transform values by copying values from another transform More...
 
static void Set (this Transform t, Vector3 position, Quaternion rotation, Vector3 scale)
 Set all transform values in one go More...
 
static void Clear (this Transform t)
 Zero out all local values (position = Vector3.zero, rotation = Quaternion.identity, scale = Vector3.one) More...
 
static void SetChildrenActive (this Transform t, bool active)
 Sets all children gameObjects active-state More...
 
static void DestroyChildren (this Transform t)
 Removes all children of the transform More...
 
static void DestroyChildrenImmediate (this Transform t)
 Removes all children of the transform immediately (used in editor) More...
 
static void SafeDestroyChildren (this Transform t)
 Removes all children of the transform More...
 
static bool HasActiveChildren (this Transform t)
 Checks if transform has any children that are active self More...
 
static List< Transform > GetChildList (this Transform t, List< Transform > list)
 Returns a list of all the transform's children More...
 
static List< Transform > GetChildList (this Transform t)
 Returns a list of all the transform's children More...
 
static string ObjectPath (this Transform t)
 Returns the transform's path in the hierarchy More...
 
static T FindClosestComponentInParents< T > (this Transform transform, bool dontIncludeThisObject=false)
 Recursively returns the first closest component of type <T> upward in the hierarchy More...
 
static T[] FindClosestComponentsInParents< T > (this Transform transform, bool dontIncludeThisObject=false)
 Recursively returns an array of components of type <T> on the closest component that has them in the hierarchy More...
 
static T[] GetAllComponentsInParents< T > (this Transform transform, bool dontIncludeThisObject=false)
 Recursively returns an array of components of type <T> on the closest component that has them in the hierarchy More...
 
static Transform[] GetAllParentTransforms (this Transform transform)
 

Member Function Documentation

◆ Clear()

static void Megapop.MegaCore.TransformExt.Clear ( this Transform  t)
inlinestatic

Zero out all local values (position = Vector3.zero, rotation = Quaternion.identity, scale = Vector3.one)

◆ Copy()

static void Megapop.MegaCore.TransformExt.Copy ( this Transform  t1,
Transform  copyFrom 
)
inlinestatic

Set all transform values by copying values from another transform

◆ DestroyChildren()

static void Megapop.MegaCore.TransformExt.DestroyChildren ( this Transform  t)
inlinestatic

Removes all children of the transform

◆ DestroyChildrenImmediate()

static void Megapop.MegaCore.TransformExt.DestroyChildrenImmediate ( this Transform  t)
inlinestatic

Removes all children of the transform immediately (used in editor)

◆ FindClosestComponentInParents< T >()

static T Megapop.MegaCore.TransformExt.FindClosestComponentInParents< T > ( this Transform  transform,
bool  dontIncludeThisObject = false 
)
inlinestatic

Recursively returns the first closest component of type <T> upward in the hierarchy

Type Constraints
T :Component 

◆ FindClosestComponentsInParents< T >()

static T[] Megapop.MegaCore.TransformExt.FindClosestComponentsInParents< T > ( this Transform  transform,
bool  dontIncludeThisObject = false 
)
inlinestatic

Recursively returns an array of components of type <T> on the closest component that has them in the hierarchy

Type Constraints
T :Component 

◆ GetAllComponentsInParents< T >()

static T[] Megapop.MegaCore.TransformExt.GetAllComponentsInParents< T > ( this Transform  transform,
bool  dontIncludeThisObject = false 
)
inlinestatic

Recursively returns an array of components of type <T> on the closest component that has them in the hierarchy

Type Constraints
T :Component 

◆ GetAllParentTransforms()

static Transform[] Megapop.MegaCore.TransformExt.GetAllParentTransforms ( this Transform  transform)
inlinestatic

◆ GetChildList() [1/2]

static List< Transform > Megapop.MegaCore.TransformExt.GetChildList ( this Transform  t)
inlinestatic

Returns a list of all the transform's children

◆ GetChildList() [2/2]

static List< Transform > Megapop.MegaCore.TransformExt.GetChildList ( this Transform  t,
List< Transform >  list 
)
inlinestatic

Returns a list of all the transform's children

◆ HasActiveChildren()

static bool Megapop.MegaCore.TransformExt.HasActiveChildren ( this Transform  t)
inlinestatic

Checks if transform has any children that are active self

◆ ObjectPath()

static string Megapop.MegaCore.TransformExt.ObjectPath ( this Transform  t)
inlinestatic

Returns the transform's path in the hierarchy

◆ SafeDestroyChildren()

static void Megapop.MegaCore.TransformExt.SafeDestroyChildren ( this Transform  t)
inlinestatic

Removes all children of the transform

◆ Set()

static void Megapop.MegaCore.TransformExt.Set ( this Transform  t,
Vector3  position,
Quaternion  rotation,
Vector3  scale 
)
inlinestatic

Set all transform values in one go

◆ SetChildrenActive()

static void Megapop.MegaCore.TransformExt.SetChildrenActive ( this Transform  t,
bool  active 
)
inlinestatic

Sets all children gameObjects active-state

◆ SwapValues()

static void Megapop.MegaCore.TransformExt.SwapValues ( Transform  t1,
Transform  t2 
)
inlinestatic

Swap transform values between two transforms


The documentation for this class was generated from the following file: