Пример #1
0
    void Awake()
    {
        if (InitCnt > 0)
        {
            DestroyImmediate(gameObject);
            return;
        }
        InitCnt = 1;

        go = gameObject;
        DontDestroyOnLoad(gameObject);
        Application.runInBackground = true;

#if UNITY_STANDALONE_WIN
        //PC版强制某分辨率运行
        Screen.SetResolution(1280, 720, false);
#endif
        //设置日志输出状态
        Debug.unityLogger.logEnabled = GameApp.Instance.IsDebugLog;

        //程序不休眠
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        Application.targetFrameRate = 40;

        Singlton.GetInstance <Debugging>();

        InvokeRepeating("CheckTime", 0f, 60f);
    }