![]() |
Init(args)
Scripting Reference
|
A base class for MonoBehaviours that act as simple wrappers for plain old class objects.
A class wrapped by the Wrapper<> component can be added to a GameObject using the GameObjectExtensions.AddComponent<TWrapped, TWrapped> function.
Optionally the wrapped class can receive callbacks during select unity event functions from the wrapper by implementing one or more of the following interfaces:
The wrapped object can start coroutines running on the wrapper component by implementing ICoroutines and then using ICoroutineRunner.StartCoroutine.
TWrapped | Type of the plain old class object wrapped by this component. |
Static Public Member Functions | |
static implicit | operator TWrapped (Wrapper< TWrapped > wrapper) |
Defines an implicit conversion of a Wrapper<TWrapped> to the TWrapped plain old class object that it wraps. More... | |
static | operator Wrapper< TWrapped > (TWrapped wrapped) |
Defines an explicit conversion of a TWrapped to a Wrapper<TWrapped> component that wraps it. More... | |
Protected Member Functions | |
virtual void | Reset () |
Reset state to default values. More... | |
virtual void | Awake () |
Awake is called when the script instance is being loaded and handles calling the Init function with the TWrapped argument. More... | |
virtual void | OnEnable () |
This function is called when the object becomes enabled and active. More... | |
virtual void | Start () |
Start is called on the frame when a script is enabled just before any of the Update methods are called the first time. More... | |
virtual void | OnDisable () |
This function is called when the behaviour becomes disabled. More... | |
virtual void | OnDestroy () |
The OnDestroy even function is called when this Wrapper or the GameObject to which it is attached is destroyed, or the scene which the GameObject is part of is unloaded. More... | |
![]() | |
abstract void | Init (TArgument argument) |
Provides the Component with the argument object that it depends on. More... | |
virtual void | OnReset () |
Reset state to default values. More... | |
virtual void | OnAwake () |
OnAwake is called when the script instance is being loaded during the Awake event after the Init function has finished. More... | |
abstract void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument) |
Provides the Component with the objects that it depends on. More... | |
virtual void | OnReset () |
Reset state to default values. More... | |
virtual void | OnAwake () |
OnAwake is called when the script instance is being loaded during the Awake event after the Init function has finished. More... | |
abstract void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument) |
Provides the Component with the objects that it depends on. More... | |
virtual void | OnReset () |
Reset state to default values. More... | |
virtual void | OnAwake () |
OnAwake is called when the script instance is being loaded during the Awake event after the Init function has finished. More... | |
abstract void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument) |
Provides the Component with the objects that it depends on. More... | |
virtual void | OnReset () |
Reset state to default values. More... | |
virtual void | OnAwake () |
OnAwake is called when the script instance is being loaded during the Awake event after the Init function has finished. More... | |
abstract void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument, TFifthArgument fifthArgument) |
Provides the Component with the objects that it depends on. More... | |
virtual void | OnReset () |
Reset state to default values. More... | |
virtual void | OnAwake () |
OnAwake is called when the script instance is being loaded during the Awake event after the Init function has finished. More... | |
Properties | |
TWrapped | WrappedObject [get] |
The plain old class object wrapped by this component. More... | |
![]() | |
TArgument this[[NotNull] string | memberName [set] |
Assigns an argument received during initialization to a field or property by the memberName given name. More... | |
object this[[NotNull] string | memberName [set] |
Assigns an argument received during initialization to a field or property by the memberName given name. More... | |
![]() | |
new TWrapped | WrappedObject [get] |
The plain old class object wrapped by this UnityEngine.Object. More... | |
object | WrappedObject [get] |
The plain old class object wrapped by this UnityEngine.Object. More... | |
GameObject | gameObject [get] |
The GameObject this wrapper is attached to, if any. More... | |
MonoBehaviour | AsMonoBehaviour [get] |
This wrapper as a MonoBehaviour, or null if the wrapper class does not derive from MonoBehaviour. More... | |
Object | AsObject [get] |
This wrapper as an Object. More... | |
![]() | |
T | Value [get] |
Gets the value of the current IValueProvider<T> object More... | |
Additional Inherited Members | |
![]() | |
void | Init (TArgument argument) |
Initializes the object with an object that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument) |
Initializes the object with two objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument) |
Initializes the object with three objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument) |
Initializes the object with four objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument, TFifthArgument fifthArgument) |
Initializes the object with five objects that it depends on. More... | |
![]() | |
void | Init (TArgument argument) |
Initializes the object with an object that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument) |
Initializes the object with two objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument) |
Initializes the object with three objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument) |
Initializes the object with four objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument, TFifthArgument fifthArgument) |
Initializes the object with five objects that it depends on. More... | |
![]() | |
void | Init (TArgument argument) |
Initializes the object with an object that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument) |
Initializes the object with two objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument) |
Initializes the object with three objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument) |
Initializes the object with four objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument, TFifthArgument fifthArgument) |
Initializes the object with five objects that it depends on. More... | |
![]() | |
void | Init (TArgument argument) |
Initializes the object with an object that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument) |
Initializes the object with two objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument) |
Initializes the object with three objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument) |
Initializes the object with four objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument, TFifthArgument fifthArgument) |
Initializes the object with five objects that it depends on. More... | |
![]() | |
void | Init (TArgument argument) |
Initializes the object with an object that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument) |
Initializes the object with two objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument) |
Initializes the object with three objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument) |
Initializes the object with four objects that it depends on. More... | |
void | Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument, TFifthArgument fifthArgument) |
Initializes the object with five objects that it depends on. More... | |
![]() | |
Coroutine | StartCoroutine (IEnumerator coroutine) |
Starts the provided coroutine . More... | |
void | StopCoroutine (IEnumerator coroutine) |
Stops the provided coroutine . More... | |
void | StopCoroutine (Coroutine coroutine) |
Stops the provided coroutine . More... | |
void | StopAllCoroutines () |
Stops all coroutine coroutines that are currently running on this object, if any. More... | |