View

View is a MonoBehavior which is focus to show ui elements and fire event.

void InitMediator()

Remarks

Override InitMediator to bind meaitors to view.

protected override void InitMediator() {
        BindMediator(typeof(CubeMediator));
    }

void OnStart()

Remarks

Intead of unity function "Start"

void OnUpdate()

Remarks

Instead of unity function "Update"

void DispatchMediator(enum)

void DispatchMediator(enum, params object[] param)

Param

enum: mediator event type

param: parameters to send

Remarks

Fire a mediator event to other mediators. All the mediators will call the action function if they have listen to the mediator event.

void DispatchObject(GameObject go, enum)

void DispatchObject(GameObject go, enum, params object[] param)

Param

go: this function will fire event to the go object

enum: mediator event type

param: parameters to send

Remarks

Fire a mediator event to the go object, the go object is the only one which gets the event.

void DispatchCommand(enum)

void DispatchCommand(enum, params object[] param)

Param

enum: command event type

param: parameters to send

Remarks

Fire a command event to command. All the commands will call the action function if they have listen to the command event.

Example

Last updated