public override void OnStart(GameMgr mgr) { if (string.IsNullOrEmpty(map_preview_uuid)) { //没有 地图 id 提供预览 SceneMgr.LoadLevel("GameLogin"); return; } this.LoadNext(); this.mgr = mgr; ins = this; }
void OnDestroy() { if (ins == this) { ins = null; } //do something clean up foreach (var p in GameObject.FindObjectsOfType <DestroyWhenSceneChanged>()) { GameObject.DestroyImmediate(p.gameObject); } if (this.player != null) { GameObject.DestroyImmediate(this.player); this.player = null; } }