Class MonoBehaviourExtensions
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Provides useful extension methods for MonoBehaviours.
[Version(1, 0, 0)]
public static class MonoBehaviourExtensions
- Inheritance
-
MonoBehaviourExtensions
- Inherited Members
Methods
- CancelInvoke(MonoBehaviour, Action)
Cancels the action if it was scheduled.
- Clone<T>(T)
Clones a MonoBehaviour using UnityEngine.Object.Instantiate<T>(T).
- Clone<T>(T, int)
Clones a MonoBehaviour a given number of times.
- FindChild(Component, string)
Finds a direct child of the component's transform with the given name.
- FindChild(Component, string, bool)
Finds a child of the component's transform with the given name, optionally searching recursively.
- GetComponentInChildrenAlways<T>(Component)
Finds a component of the type T in on the same object, or on a child down the hierarchy. This method also works in the editor and when the game object is inactive.
- GetComponentsInChildrenAlways<T>(Component)
Finds all components of the type T on the same object and on a children down the hierarchy. This method also works in the editor and when the game object is inactive.
- GetInterfaceComponent<TInterface>(Component)
Gets an attached component that implements the interface of the type parameter.
- GetRequiredComponentInChildren<T>(Component)
Gets a component of the given type in one of the children, or fail if no such component is attached to the given component.
- GetRequiredComponent<T>(Component)
Gets a component of the given type, or fail if no such component is attached to the given component.
- Invoke(MonoBehaviour, Action, float)
Invokes the given action after the given amount of time.
- InvokeRepeating(MonoBehaviour, Action, IGenerator<float>)
Invokes the given action after the given amount of time, and repeats the action after every repeatTime seconds.
- InvokeRepeating(MonoBehaviour, Action, float, float)
Invokes the given action after the given amount of time, and repeats the action after every repeatTime seconds.
- IsInvoking(MonoBehaviour, Action)
Returns whether an invoke is pending on an action.
- Tween<T>(MonoBehaviour, T, T, float, Func<T, T, float, T>, Action<T>)
Tweens a value from
starttofinishovertotalTimeseconds.
- Tween<T>(MonoBehaviour, T, T, float, Func<T, T, float, T>, Action<T>, Func<float>)
Tweens a value from
starttofinishovertotalTimeseconds.