예제 #1
0
        private void OnApplicationFocus(bool hasFocus)
        {
            if (_reachabilityChanged || _step == STEP_IDLE)
            {
                return;
            }

#if UNITY_EDITOR
            return;
#else
            if (hasFocus)
            {
                MessageBox.CloseAll();
                if (_step < STEP_DOWNLOAD)
                {
                    StartUpdate();
                }
                else if (_step == STEP_DOWNLOAD)
                {
                    _downloader.Restart();
                }
            }
            else
            {
                if (_step == STEP_DOWNLOAD)
                {
                    _downloader.Stop();
                }
            }
#endif
        }
예제 #2
0
파일: Updater.cs 프로젝트: ymiakill/JEngine
        private void OnApplicationFocus(bool hasFocus)
        {
            if (_reachabilityChanged || _step == Step.Wait)
            {
                return;
            }

            if (hasFocus)
            {
                MessageBox.CloseAll();
                if (_step == Step.Download)
                {
                    _downloader.Restart();
                }
                else
                {
                    StartUpdate();
                }
            }
            else
            {
                if (_step == Step.Download)
                {
                    _downloader.Stop();
                }
            }
        }
예제 #3
0
파일: Updater.cs 프로젝트: ymiakill/JEngine
        public void OnReachablityChanged(NetworkReachability reachability)
        {
            if (_step == Step.Wait)
            {
                return;
            }

            _reachabilityChanged = true;
            if (_step == Step.Download)
            {
                _downloader.Stop();
            }

            if (reachability == NetworkReachability.NotReachable)
            {
                MessageBox.Show("提示!", "找不到网络,请确保手机已经联网", "确定", "退出").onComplete += delegate(MessageBox.EventId id)
                {
                    if (id == MessageBox.EventId.Ok)
                    {
                        if (_step == Step.Download)
                        {
                            _downloader.Restart();
                        }
                        else
                        {
                            StartUpdate();
                        }

                        _reachabilityChanged = false;
                    }
                    else
                    {
                        Quit();
                    }
                };
            }
            else
            {
                if (_step == Step.Download)
                {
                    _downloader.Restart();
                }
                else
                {
                    StartUpdate();
                }

                _reachabilityChanged = false;
                MessageBox.CloseAll();
            }
        }