Show / Hide Table of Contents

Class ExposedGameObjectExtension

Extends GameObject with a shortcut for the Unity bool operator override.
Inheritance
System.Object
ExposedGameObjectExtension
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Jotunn
Assembly: Jotunn.dll
Syntax
public static class ExposedGameObjectExtension

Methods

| Improve this Doc View Source

AddComponentCopy<T>(GameObject, T)

Adds a new copy of the provided component to a gameObject
Declaration
public static Component AddComponentCopy<T>(this GameObject gameObject, T duplicate)

    where T : Component
Parameters
Type Name Description
GameObject gameObject
T duplicate
Returns
Type Description
Component
Type Parameters
Name Description
T
| Improve this Doc View Source

GetOrAddComponent<T>(GameObject)

Returns the component of Type type. If one doesn't already exist on the GameObject it will be added.
Declaration
public static T GetOrAddComponent<T>(this GameObject gameObject)

    where T : Component
Parameters
Type Name Description
GameObject gameObject The GameObject this Component is attached to.
Returns
Type Description
T Component
Type Parameters
Name Description
T The type of Component to return.
Remarks
Source: https://wiki.unity3d.com/index.php/GetOrAddComponent
| Improve this Doc View Source

OrNull(GameObject)

Facilitates use of null propagation operator for unity GameObjects by respecting op_equality.
Declaration
public static GameObject OrNull(this GameObject this)
Parameters
Type Name Description
GameObject this this
Returns
Type Description
GameObject Returns null when GameObject.op_equality returns false.
| Improve this Doc View Source

OrNull<T>(T)

Facilitates use of null propagation operator for unity MonBehaviours by respecting op_equality.
Declaration
public static T OrNull<T>(this T this)

    where T : Object
Parameters
Type Name Description
T this this
Returns
Type Description
T Returns null when MonoBehaviours.op_equality returns false.
Type Parameters
Name Description
T Any type that inherits MonoBehaviour
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾