Пример #1
0
        void OnApplicationPause(bool pauseStatus)
        {
            Debug.Log("OnApplicationPause[" + pauseStatus.ToString() + "]");
#if UNITY_IOS || UNITY_ANDROID
            if (pauseStatus)
            {
                PlatformSDKInterface.SDKPause();
            }
#elif UNITY_WINRT
#endif
#if !UNITY_EDITOR && UNITY_IOS
            OCDelegate.ScreenIdleDisable(false);
#endif
        }
Пример #2
0
        public void OnApplicationInit()
        {
            StreamAssetHelper.AssetPath = Application.streamingAssetsPath + "/";
#if UNITY_ANDROID && !UNITY_EDITOR
            StreamAssetHelper.WWWAssetPath = Application.streamingAssetsPath + "/";
#else
            StreamAssetHelper.WWWAssetPath = "file://" + Application.streamingAssetsPath + "/";
#endif
#if !UNITY_IOS && !UNITY_ANDROID && !UNITY_WINRT
            StreamAssetHelper.WWWNewAssetPath = StreamAssetHelper.WWWAssetPath + "../../Documents/";
            StreamAssetHelper.NewAssetPath    = StreamAssetHelper.AssetPath + "../../Documents/";
            if (!Directory.Exists(StreamAssetHelper.NewAssetPath))
            {
                Directory.CreateDirectory(StreamAssetHelper.NewAssetPath);
            }
#else
#if UNITY_IOS
            StreamAssetHelper.NewAssetPath    = Application.persistentDataPath + "/Updates/";
            StreamAssetHelper.WWWNewAssetPath = "file://" + StreamAssetHelper.NewAssetPath;
#elif UNITY_ANDROID
            StreamAssetHelper.WWWNewAssetPath = StreamAssetHelper.WWWAssetPath + "../../../Documents/";
            StreamAssetHelper.NewAssetPath    = StreamAssetHelper.AssetPath + "../../../Documents/";
#elif NETFX_CORE && UNITY_METRO && !UNITY_EDITOR
            StreamAssetHelper.AssetPath       = StreamAssetHelper.AssetPath.Replace("/", "\\");
            StreamAssetHelper.WWWNewAssetPath = StreamAssetHelper.WWWAssetPath + "../../../Documents/";
            StreamAssetHelper.NewAssetPath    = StreamAssetHelper.AssetPath + "..\\..\\..\\Documents\\";
#endif
#endif
            Application.targetFrameRate = 45;
            SharedUserConfig.Inst.InitSoundConfig();
            StartCoroutine(DoLoadUIHeader());
#if SDK_91 || SDK_WX || SDK_PP || SDK_TBT || SDK_AB
            PlatformSDKInterface.SDKInit(OnSDKInited, SDKController.name);
#elif SDK_HM
            //SDKController
#else
            StartCoroutine(InitHardDevices());

            OnSDKInited(true);
#endif
            StartCoroutine("DoCheckUIController");
#if !UNITY_EDITOR && UNITY_IOS
            OCDelegate.ScreenIdleDisable(true);
#endif
        }