예제 #1
0
파일: Main.cs 프로젝트: hw233/tpsmoba
 // Use this for initialization
 void Start()
 {
     DontDestroyOnLoad(this.gameObject);
     AppFacade.Instance.StartUp();
     AppFacade.Instance.GetManager <GameManager>(ManagerName.Game).StartGame();
     Application.logMessageReceived += LogHandler;
     LogCenter.Instance().OpenTrace(LogTraceType.File);
     Screen.sleepTimeout = SleepTimeout.NeverSleep;
     if (Application.isMobilePlatform)
     {
         Application.targetFrameRate = AppConst.GameFrameRate;
     }
     OnInitialize();
 }
예제 #2
0
    /// <summary>
    /// 析构函数
    /// </summary>
    void OnDestroy()
    {
        LuaManager lurMgr = AppFacade.Instance.GetManager <LuaManager>(ManagerName.Lua);

        if (lurMgr != null)
        {
            lurMgr.Close();
        }
        if (AppFacade.Instance.networkManager != null)
        {
            AppFacade.Instance.networkManager.Close();
        }
        LogCenter.Instance().Close();

        Util.Log("Game", "~Main was destroyed");
    }
예제 #3
0
    void Start()
    {
        DontDestroyOnLoad(gameObject);  //防止销毁自己
        //#if !UNITY_EDITOR
        Application.logMessageReceived += LogHandler;
        //#endif
        LogCenter.Instance().OpenTrace(LogTraceType.File);

        CheckExtractResource(); //释放资源
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        if (Application.isMobilePlatform)
        {
            Application.targetFrameRate = AppConst.GameFrameRate;
        }
        AppFacade.Instance.gameManager.CullGroup = Camera.main.GetComponent <CullingGroupLoadRes>();
    }