App
An application object provides member functions for initializing your application (and each instance of it) and for running the application.
// in the contex class of start scene.
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 OnInitInstance();
Remarks
void OnExitInstance();
Remarks
Example
public class TestApp : App {
public override void OnInitInstance() {
// Application initialize instance function, execute only once.
// You can read config file, initialize manager here.
// 程序初始化入口,整个程序生命周期中仅会执行一次,可以在此读取配置文件,初始化Manager,加解密等.
PoolManager.Init();
}
public override void OnExitInstance() {
// Application exit instance function, execute only once.
// 程序反初始化出口,程序结束前自动调用,用于释放资源等.
PoolManager.UnInit();
}
}
Last updated