StrangeIoC  0.6.0
The IoC/Binding Framework for Unity3D and C#
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Protected Member Functions | Protected Attributes | Properties | List of all members
strange.extensions.mediation.impl.View Class Reference

Parent class for all your Views. More...

Inheritance diagram for strange.extensions.mediation.impl.View:
strange.extensions.mediation.api.IView strange.extensions.mediation.impl.EventView

Protected Member Functions

virtual void Awake ()
 A MonoBehaviour Awake handler. More...
 
virtual void Start ()
 A MonoBehaviour Start handler If the View is not yet registered with the Context, it will attempt to connect again at this moment. More...
 
virtual void OnDestroy ()
 A MonoBehaviour OnDestroy handler The View will inform the Context that it is about to be destroyed. More...
 
virtual void bubbleToContext (MonoBehaviour view, bool toAdd, bool finalTry)
 Recurses through Transform.parent to find the GameObject to which ContextView is attached Has a loop limit of 100 levels. More...
 

Protected Attributes

bool registerWithContext = true
 A flag for allowing the View to register with the Context In general you can ignore this. More...
 

Properties

bool requiresContext [get, set]
 
virtual bool autoRegisterWithContext [get, set]
 
bool registeredWithContext [get, set]
 
- Properties inherited from strange.extensions.mediation.api.IView
bool requiresContext [get, set]
 Indicates whether the View can work absent a context. More...
 
bool registeredWithContext [get, set]
 Indicates whether this View has been registered with a Context.
 
bool autoRegisterWithContext [get]
 Exposure to code of the registerWithContext (Inspector) boolean. If false, the View won't try to register.
 

Detailed Description

Parent class for all your Views.

Extends MonoBehaviour. Bubbles its Awake, Start and OnDestroy events to the ContextView, which allows the Context to know when these critical moments occur in the View lifecycle.

Member Function Documentation

virtual void strange.extensions.mediation.impl.View.Awake ( )
inlineprotectedvirtual

A MonoBehaviour Awake handler.

The View will attempt to connect to the Context at this moment.

virtual void strange.extensions.mediation.impl.View.bubbleToContext ( MonoBehaviour  view,
bool  toAdd,
bool  finalTry 
)
inlineprotectedvirtual

Recurses through Transform.parent to find the GameObject to which ContextView is attached Has a loop limit of 100 levels.

By default, raises an Exception if no Context is found.

virtual void strange.extensions.mediation.impl.View.OnDestroy ( )
inlineprotectedvirtual

A MonoBehaviour OnDestroy handler The View will inform the Context that it is about to be destroyed.

virtual void strange.extensions.mediation.impl.View.Start ( )
inlineprotectedvirtual

A MonoBehaviour Start handler If the View is not yet registered with the Context, it will attempt to connect again at this moment.

Member Data Documentation

bool strange.extensions.mediation.impl.View.registerWithContext = true
protected

A flag for allowing the View to register with the Context In general you can ignore this.

But some developers have asked for a way of disabling View registration with a checkbox from Unity, so here it is. If you want to expose this capability either (1) uncomment the commented-out line immediately below, or (2) subclass View and override the autoRegisterWithContext method using your own custom (public) field.


The documentation for this class was generated from the following file: