Init(args)
Scripting Reference
Loading...
Searching...
No Matches
Sisus.Init.Wrapper Class Referenceabstract

Description

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 AddComponentExtensions.AddComponent<TWrapper, TWrapped>(GameObject, TWrapped) method.

Optionally the wrapped class can receive callbacks during select unity event functions from the wrapper by implementing one or more of the following interfaces:

  • IAwake Receive callback during the MonoBehaviour.Awake event.
  • IOnEnable Receive callback during the MonoBehaviour.OnEnable event.
  • IStart Receive callback during the MonoBehaviour.Start event.
  • IUpdate Receive callback during the MonoBehaviour.Update event.
  • IFixedUpdate Receive callback during the MonoBehaviour.FixedUpdate event.
  • ILateUpdate Receive callback during the MonoBehaviour.LateUpdate event.
  • IOnDisable Receive callback during the MonoBehaviour.OnDisable event.
  • IOnDestroy Receive callback during the MonoBehaviour.OnDestroy event.

The wrapped object can start coroutines running on the wrapper component by implementing ICoroutines and then using ICoroutineRunner.StartCoroutine.

Inheritance diagram for Sisus.Init.Wrapper:
Sisus.Init.IWrapper Sisus.Init.IValueProvider Sisus.Init.IValueByTypeProvider Sisus.Init.ICoroutineRunner Sisus.Init.Wrapper< TWrapped >

Protected Member Functions

object GetWrappedObject ()
 Gets the plain old class object wrapped by this component.
 

Properties

object WrappedObject [get]
 Gets the plain old class object wrapped by this component.
 
- Properties inherited from Sisus.Init.IWrapper
GameObject gameObject [get]
 The GameObject this wrapper is attached to, if any.
 
HideFlags hideFlags [get, set]
 Should the object be hidden, saved with the Scene or modifiable by the user?
 
string name [get, set]
 The name of the object.
 
bool isActiveAndEnabled [get]
 Gets a value indicating whether the wrapper is enabled and not attached to an inactive

See also
GameObject

.

 

Additional Inherited Members

- Public Member Functions inherited from Sisus.Init.IWrapper
int GetInstanceID ()
 Returns the instance id of the object.
 
bool CompareTag (string tag)
 Returns true if the wrapper is attached to a GameObject that has the given tag; otherwise, false.
 
Find< T > ()
 Gets a reference to an object of type T found on the GameObject the wrapper is attached to.
 
T[] FindAll< T > ()
 Gets references to all objects of type T found on the GameObject the wrapper is attached to.
 
FindInChildren< T > ()
 Gets a reference to an object of type T found on the GameObject the wrapper is attached to, or any of its children.
 
T[] FindAllInChildren< T > ()
 Gets references to all objects of type T found on the GameObject the wrapper is attached to, or any of its children.
 
FindInParents< T > ()
 Gets a reference to an object of type T found on the GameObject the wrapper is attached to, or any of its parents.
 
T[] FindAllInParents< T > ()
 Gets references to all objects of type T found on the GameObject the wrapper is attached to, or any of its parents.
 
- Public Member Functions inherited from Sisus.Init.ICoroutineRunner
Coroutine StartCoroutine (IEnumerator coroutine)
 Starts the provided coroutine .
 
void StopCoroutine (IEnumerator coroutine)
 Stops the provided coroutine .
 
void StopCoroutine (Coroutine coroutine)
 Stops the provided coroutine .
 
void StopAllCoroutines ()
 Stops all coroutine coroutines that are currently running on this object, if any.
 
- Public Member Functions inherited from Sisus.Init.IValueProvider
bool HasValueFor (Component client)
 Gets a value indicating whether this value provider can provide a value for the client at this time.
 
- Public Member Functions inherited from Sisus.Init.IValueByTypeProvider
bool TryGetFor ([AllowNull] Component client, [DisallowNull] Type valueType, out object value)
 Gets the value of the given type for the client .
 
bool HasValueFor< TValue > (Component client)
 Gets a value indicating whether this value provider can provide a value of type TValue for the client at this time.
 
bool CanProvideValue< TValue > ([AllowNull] Component client)
 Gets a value indicating whether this value provider can potentially provide a value of the given type to the client at runtime.