示例#1
0
        /// <summary>
        /// Gets the app lifecycle manager.
        /// </summary>
        /// <returns>The app lifecycle manager.</returns>
        public IPsdkAppLifeCycleManager         GetAppLifecycleManager()
        {
#if UNITY_EDITOR
            return(new PsdkAppLifeCycleMgrStub());
#endif

            if (!isPsdkValid())
            {
                return(null);
            }

            if (null != _appLifeCycleMgrService)
            {
                return(_appLifeCycleMgrService);
            }

            _appLifeCycleMgrService = GettingServiceByReflection <IPsdkAppLifeCycleManager>("PsdkAppLifeCycleManager");

            if (null != _appLifeCycleMgrService)
            {
                return(_appLifeCycleMgrService);
            }

            if (!_silent)
            {
                Debug.Log("Please install PsdkAppLifeCycleManager !");
            }
            return(null);
        }
示例#2
0
        public PsdkAppLifeCycleManager(IPsdkServiceManager sm)
        {
            _sm = sm;

            switch (Application.platform)
            {
            case RuntimePlatform.IPhonePlayer:      _impl = new IphonePsdkAppLifeCycleManager(sm.GetImplementation()); break;

                        #if UNITY_ANDROID
            case RuntimePlatform.Android:           _impl = new AndroidPsdkAppLifeCycleManager(sm.GetImplementation()); break;
                        #endif
            case RuntimePlatform.WindowsEditor:
            case RuntimePlatform.OSXEditor:         _impl = new UnityEditorPsdkAppLifeCycleManager(sm.GetImplementation()); break;

            default: throw new System.Exception("Platform not supported for PsdkAppLifeCycleManager.");
            }

//			#if UNITY_IPHONE && !UNITY_EDITOR
//			_impl = new IphonePsdkAppLifeCycleManager(sm.GetImplementation());
//			#elif UNITY_ANDROID  && !UNITY_EDITOR
//			_impl = new AndroidPsdkAppLifeCycleManager(sm.GetImplementation());
//			#elif UNITY_EDITOR
//			_impl = new UnityEditorPsdkAppLifeCycleManager(sm.GetImplementation());
//			#endif
        }
示例#3
0
        public void AppIsReady()
        {
            IPsdkAppLifeCycleManager alm = GetAppLifecycleManager();

            if (alm != null)
            {
                alm.AppIsReady();
            }
        }
示例#4
0
        /// <summary>
        /// Setups the app lifecycle manager.
        /// </summary>
        /// <returns><c>true</c>, if app lifecycle manager was setuped, <c>false</c> otherwise.</returns>
        public bool     SetupAppLifecycleManager()
        {
            registerInternalService(_appLifeCycleMgrService = GetAppLifecycleManager());
            if (null != _appLifeCycleMgrService)
            {
                return(_appLifeCycleMgrService.Setup());
            }

            return(false);
        }
示例#5
0
        public bool OnBackPressed()
        {
            IPsdkAppLifeCycleManager alm = GetAppLifecycleManager();

            if (alm != null)
            {
                return(alm.OnBackPressed());
            }
            return(false);
        }