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

Description

A base class for ScriptableObjects that act as simple wrappers for plain old class objects.

A class wrapped by the ScriptableWrapper<> can be loaded from Resources using the Find.Resource<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:

Template Parameters
TWrappedType of the plain old class object wrapped by this scriptable object.
Inheritance diagram for Sisus.Init.ScriptableWrapper< TWrapped >:
Sisus.Init.ScriptableObject< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument > Sisus.Init.IWrapper< TWrapped > Sisus.Init.IValueProvider< TWrapped > 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 (ScriptableWrapper< TWrapped > wrapper)
 Defines an implicit conversion of a ScriptableWrapper<TWrapped> to the TWrapped plain old class object that it wraps. More...
 
static operator ScriptableWrapper< TWrapped > (TWrapped wrapped)
 Defines an explicit conversion of a TWrapped to a ScriptableWrapper<TWrapped> 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 OnDisable ()
 This function is called when the scriptable object goes out of scope. More...
 
virtual void OnDestroy ()
 The OnDestroy even function is called when this ScriptableWrapper is destroyed. More...
 
- Protected Member Functions inherited from Sisus.Init.ScriptableObject< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument >
abstract void Init (TArgument argument)
 Provides the ScriptableObject with the 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. This happens as the game is launched and is similar to MonoBehavior.Awake. More...
 
abstract void Init (TFirstArgument firstArgument, TSecondArgument secondArgument)
 Provides the ScriptableObject 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. This happens as the game is launched and is similar to MonoBehavior.Awake. More...
 
abstract void Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument)
 Provides the ScriptableObject 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. This happens as the game is launched and is similar to MonoBehavior.Awake. More...
 
abstract void Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument)
 Provides the ScriptableObject 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. This happens as the game is launched and is similar to MonoBehavior.Awake. More...
 
abstract void Init (TFirstArgument firstArgument, TSecondArgument secondArgument, TThirdArgument thirdArgument, TFourthArgument fourthArgument, TFifthArgument fifthArgument)
 Provides the ScriptableObject 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. This happens as the game is launched and is similar to MonoBehavior.Awake. More...
 

Properties

TWrapped WrappedObject [get]
 The plain old class object wrapped by this scriptable object. More...
 
- Properties inherited from Sisus.Init.ScriptableObject< 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...