예제 #1
0
    void Awake()
    {
        instance    = this;
        gameManager = GameManager.Instance;
        DOTween.Init();
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
#if UNITY_STANDALONE_WIN
        Screen.SetResolution(1280, 720, false);
#endif
        Application.targetFrameRate = AppConst.GameFrameRate;

        DontDestroyOnLoad(gameObject);

        //加入输入输出管理器
        inputMgr = gameObject.AddComponent <InputMgr>();

#if SHOW_FPS
        fpsHelperObj = new GameObject("FpsHelperObj");
        fpsHelper    = fpsHelperObj.AddComponent <FPSHelper>();
        GameObject.DontDestroyOnLoad(fpsHelperObj);
#endif

        if (AppConst.isLocalGameServer)
        {
            var ServerObj = new GameObject("SimulateServer");
            ServerObj.AddComponent <ColaFramework.NetWork.SimulateServer>();
            GameObject.DontDestroyOnLoad(ServerObj);
        }

#if BUILD_DEBUG_LOG || UNITY_EDITOR
#if UNITY_2017_1_OR_NEWER
        Debug.unityLogger.logEnabled = true;
#else
        Debug.unityLogger.logEnabled = true;
#endif
#else
#if UNITY_2017_1_OR_NEWER
        Debug.unityLogger.logEnabled = false;
#else
        Debug.logger.logEnabled = false;
#endif
#endif

#if WETEST_SDK
        gameObject.AddComponent <WeTest.U3DAutomation.U3DAutomationBehaviour>();
#endif

#if OUTPUT_LOG
        GameObject logHelperObj = new GameObject("LogHelperObj");
        logHelper = logHelperObj.AddComponent <LogHelper>();
        GameObject.DontDestroyOnLoad(logHelperObj);

        Application.logMessageReceived += logHelper.LogCallback;
#endif
        //初始化多线程工具
        ColaLoom.Initialize();
        StreamingAssetHelper.SetAssetPathDir(assetPath);
    }
예제 #2
0
    void Awake()
    {
        gameManager         = GameManager.GetInstance();
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        DontDestroyOnLoad(gameObject);

#if SHOW_FPS
        fpsHelperObj = new GameObject("FpsHelperObj");
        fpsHelper    = fpsHelperObj.AddComponent <FPSHelper>();
        GameObject.DontDestroyOnLoad(fpsHelperObj);
#endif
    }
예제 #3
0
    void Awake()
    {
        instance = this;
        InitPath();
        gameManager         = GameManager.GetInstance();
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
#if UNITY_STANDALONE_WIN
        Screen.SetResolution(1280, 720, false);
#endif

        DontDestroyOnLoad(gameObject);
        //加入输入输出管理器
        inputMgr = gameObject.AddComponent <InputMgr>();

#if SHOW_FPS
        fpsHelperObj = new GameObject("FpsHelperObj");
        fpsHelper    = fpsHelperObj.AddComponent <FPSHelper>();
        GameObject.DontDestroyOnLoad(fpsHelperObj);
#endif

#if BUILD_DEBUG_LOG || UNITY_EDITOR
#if UNITY_2017
        Debug.unityLogger.logEnabled = true;
#else
        Debug.unityLogger.logEnabled = true;
#endif
#else
#if UNITY_2017
        Debug.unityLogger.logEnabled = false;
#else
        Debug.logger.logEnabled = false;
#endif
#endif

#if WETEST_SDK
        gameObject.AddComponent <WeTest.U3DAutomation.U3DAutomationBehaviour>();
#endif

#if OUTPUT_LOG
        GameObject logHelperObj = new GameObject("LogHelperObj");
        logHelper = logHelperObj.AddComponent <LogHelper>();
        GameObject.DontDestroyOnLoad(logHelperObj);

        Application.logMessageReceived += logHelper.LogCallback;
#endif
        //初始化多线程工具
        ColaLoom.Initialize();
        StreamingAssetHelper.SetAssetPathDir(AssetPath);
    }
예제 #4
0
    void Awake()
    {
        instance    = this;
        gameManager = GameManager.Instance;
        DOTween.Init();
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
#if UNITY_STANDALONE_WIN
        Screen.SetResolution(1280, 720, false);
#endif
        Application.targetFrameRate = AppConst.GameFrameRate;

        DontDestroyOnLoad(gameObject);

        //加入输入输出管理器
        inputMgr = gameObject.AddComponent <InputMgr>();

#if SHOW_FPS
        fpsHelperObj = new GameObject("FpsHelperObj");
        fpsHelper    = fpsHelperObj.AddComponent <FPSHelper>();
        GameObject.DontDestroyOnLoad(fpsHelperObj);
#endif

#if BUILD_DEBUG_LOG || UNITY_EDITOR
#if UNITY_2017_1_OR_NEWER
        Debug.unityLogger.logEnabled = true;
#else
        Debug.unityLogger.logEnabled = true;
#endif
#else
#if UNITY_2017_1_OR_NEWER
        Debug.unityLogger.logEnabled = false;
#else
        Debug.logger.logEnabled = false;
#endif
#endif

#if OUTPUT_LOG
        GameObject logHelperObj = new GameObject("LogHelperObj");
        logHelper = logHelperObj.AddComponent <LogHelper>();
        GameObject.DontDestroyOnLoad(logHelperObj);

        Application.logMessageReceived += logHelper.LogCallback;
#endif
        //初始化多线程工具
        ColaLoom.Initialize();
    }