Contex
Context is a MonoBehaviour that instantiates your command and model.
The Context is where all the delegate and event store. it provides member functions for initializing the scene. You should bind app and command in contex.
void InitApp()
Remarks
Override InitApp to bind app instance to contex.
public override void InitApp() {
// Bind App class to contex.You can ignore this if app class is useless.
// 绑定App类到contex,如果app类无用,或者不需要做全局初始化,可忽略此步.
BindApp(TestApp.Instance<TestApp>());
}void InitScene()
Remarks
Override InitScene to initialize each scene, e.g. create gameobject, make gameobject initialize etc.
void ExitScene()
Remarks
Override ExitScene to clean up each scene.
void InitCommand()
Remarks
Override InitCommand to bind command to contex. You should bind all commands that will be used in the scene.
void OnAwake()
Remarks
Instead of unity function "Awake".
void OnStart()
Remarks
Instead of unity function "Start".
void OnUpdate()
Remarks
Instead of unity function "Update".
Example
Last updated