示例#1
0
    private void Awake()
    {
        _inst = this;
        //检测是否降低分辨率
        // this.CheckToResetScreenSolution();
        //DeviceInfo.Init();

        Application.lowMemory          += this.OnMemoryWarnning;
        Application.logMessageReceived += this.OnLogCallback;
        //帧率
#if UNITY_EDITOR
        Application.targetFrameRate = 30;
        string strTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        Debug.LogErrorFormat("{0} 开始运行 模式={1}", strTime, runTimeLoaderType);
#else
        Application.targetFrameRate = 60;
#endif
        //禁止休眠
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        //后台运行
#if UNITY_EDITOR
        Application.runInBackground = true;
#else
        Application.runInBackground = false;
#endif

        this._rootObject = gameObject;

        loginTicks = DateTime.Now.Ticks;

        InitPlayerData();

        DontDestroyOnLoad(this.gameObject);
    }
示例#2
0
 void Awake()
 {
     Instance = this;
 }