Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | List of all members
GameObjectExtension Class Reference

Static Public Member Functions

static T AddOrGetComponent< T > (this GameObject obj)
 Add a component to the gameobject, if it doesn't have one already More...
 
static void DestroyGameObject (this GameObject obj)
 
static void DestroyGameObjectImmediate (this GameObject obj)
 
static GameObject GetChild (this GameObject obj, string childName)
 
static T GetComponentCached< T > (this GameObject gameobject, ref T cache)
 Gets a component from the game object once, then caches it to save performance. More...
 
static T GetComponentCached< T > (this Component component, ref T cache)
 Gets a component from the game object once, then caches it to save performance. More...
 
static int GetComponentIndex< T > (this GameObject host, T tgt)
 
static Component GetComponentOnParent (this GameObject obj, string type)
 
static T GetComponentOnParent< T > (this GameObject obj)
 Find a component on the gameobject's parent, if any. (unlike unity's GetComponentInParent, this method does not include the given object in the search) More...
 
static Component GetComponentUpwards (this GameObject obj, string type)
 
static T GetComponentUpwards< T > (this GameObject obj)
 
static void SetLayerRecursive (this GameObject obj, int layer, int ignoreLayersMask=0)
 
static void SetLayerRecursive (this GameObject obj, int layer, bool filterTranslucent, int ignoreLayersMask=0)
 
static void SetTagsRecursive (this GameObject obj, string tag, params string[] ignoreTags)
 

Member Function Documentation

static T GameObjectExtension.AddOrGetComponent< T > ( this GameObject  obj)
inlinestatic

Add a component to the gameobject, if it doesn't have one already

Template Parameters
T
Parameters
obj
Returns
Type Constraints
T :Component 
static void GameObjectExtension.DestroyGameObject ( this GameObject  obj)
inlinestatic
static void GameObjectExtension.DestroyGameObjectImmediate ( this GameObject  obj)
inlinestatic
static GameObject GameObjectExtension.GetChild ( this GameObject  obj,
string  childName 
)
inlinestatic
static T GameObjectExtension.GetComponentCached< T > ( this GameObject  gameobject,
ref T  cache 
)
inlinestatic

Gets a component from the game object once, then caches it to save performance.

Type Constraints
T :Component 
static T GameObjectExtension.GetComponentCached< T > ( this Component  component,
ref T  cache 
)
inlinestatic

Gets a component from the game object once, then caches it to save performance.

Type Constraints
T :Component 
static int GameObjectExtension.GetComponentIndex< T > ( this GameObject  host,
tgt 
)
inlinestatic
static Component GameObjectExtension.GetComponentOnParent ( this GameObject  obj,
string  type 
)
inlinestatic
static T GameObjectExtension.GetComponentOnParent< T > ( this GameObject  obj)
inlinestatic

Find a component on the gameobject's parent, if any. (unlike unity's GetComponentInParent, this method does not include the given object in the search)

Template Parameters
T
Parameters
obj
Returns
Type Constraints
T :Component 
static Component GameObjectExtension.GetComponentUpwards ( this GameObject  obj,
string  type 
)
inlinestatic
static T GameObjectExtension.GetComponentUpwards< T > ( this GameObject  obj)
inlinestatic
Type Constraints
T :Component 
static void GameObjectExtension.SetLayerRecursive ( this GameObject  obj,
int  layer,
int  ignoreLayersMask = 0 
)
inlinestatic
static void GameObjectExtension.SetLayerRecursive ( this GameObject  obj,
int  layer,
bool  filterTranslucent,
int  ignoreLayersMask = 0 
)
inlinestatic
static void GameObjectExtension.SetTagsRecursive ( this GameObject  obj,
string  tag,
params string[]  ignoreTags 
)
inlinestatic

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