Init(args)
Scripting Reference
List of all members | Static Public Member Functions | Protected Member Functions | Properties
Sisus.Init.Wrapper< TWrapped > Class Template Reference

Description

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.

Template Parameters
TWrappedType of the plain old class object wrapped by this component.
Inheritance diagram for Sisus.Init.Wrapper< TWrapped >:
Sisus.Init.MonoBehaviour< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument > Sisus.Init.IWrapper< TWrapped > Sisus.Init.IValueProvider< TWrapped > Sisus.Init.ICoroutineRunner Sisus.Init.IInitializable< TArgument > Sisus.Init.IInitializable< TFirstArgument, TSecondArgument > Sisus.Init.IInitializable< TFirstArgument, TSecondArgument, TThirdArgument > Sisus.Init.IInitializable< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument > Sisus.Init.IInitializable< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument > Sisus.Init.IInitializable< TWrapped > Sisus.Init.IArgs< TArgument > Sisus.Init.IArgs< TFirstArgument, TSecondArgument > Sisus.Init.IArgs< TFirstArgument, TSecondArgument, TThirdArgument > Sisus.Init.IArgs< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument > Sisus.Init.IArgs< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument > Sisus.Init.IFifthArgument< TFifthArgument > Sisus.Init.IThirdArgument< TThirdArgument > Sisus.Init.ISecondArgument< TSecondArgument > Sisus.Init.IFirstArgument< TFirstArgument > Sisus.Init.IFiveArguments Sisus.Init.IFourthArgument< TFourthArgument > Sisus.Init.IThirdArgument< TThirdArgument > Sisus.Init.ISecondArgument< TSecondArgument > Sisus.Init.IFirstArgument< TFirstArgument > Sisus.Init.IFourArguments Sisus.Init.IThirdArgument< TThirdArgument > Sisus.Init.ISecondArgument< TSecondArgument > Sisus.Init.IFirstArgument< TFirstArgument > Sisus.Init.IThreeArguments Sisus.Init.ISecondArgument< TSecondArgument > Sisus.Init.IFirstArgument< TFirstArgument > Sisus.Init.ITwoArguments Sisus.Init.IFirstArgument< TArgument > Sisus.Init.IOneArgument

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...
 
- Protected Member Functions inherited from Sisus.Init.MonoBehaviour< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument >
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...
 
- Properties inherited from Sisus.Init.MonoBehaviour< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument >
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...
 
- Properties inherited from Sisus.Init.IWrapper< TWrapped >
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...
 
- Properties inherited from Sisus.Init.IValueProvider< TWrapped >
Value [get]
 Gets the value of the current IValueProvider<T> object More...
 

Additional Inherited Members

- Public Member Functions inherited from Sisus.Init.IInitializable< TArgument >
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...
 
- Public Member Functions inherited from Sisus.Init.IInitializable< TFirstArgument, TSecondArgument >
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...
 
- Public Member Functions inherited from Sisus.Init.IInitializable< TFirstArgument, TSecondArgument, TThirdArgument >
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...
 
- Public Member Functions inherited from Sisus.Init.IInitializable< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument >
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...
 
- Public Member Functions inherited from Sisus.Init.IInitializable< TWrapped >
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...
 
- Public Member Functions inherited from Sisus.Init.ICoroutineRunner
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...