Exemplo n.º 1
0
        void ShowTip(float size, OnDo dofunc)
        {
            string msg = null;

            switch (Application.internetReachability)
            {
            //4g or 3g
            case NetworkReachability.ReachableViaCarrierDataNetwork:
                msg = string.Format(" 本次更新约{0:F2}MB,你当前处于运营商网络,是否开始更新?", size);
                break;

            //wifi
            case NetworkReachability.ReachableViaLocalAreaNetwork:
                msg = string.Format(" 本次更新约{0:F2}MB,你当前处于wifi网络,是否开始更新?", size);
                break;

            default:
                break;
            }

            if (string.IsNullOrEmpty(updateTip))
            {
                UIMessageBoxHelper.Show(msg,
                                        () =>
                {
                    dofunc();
                },
                                        () =>
                {
#if UNITY_EDITOR
                    UnityEditor.EditorApplication.isPlaying = false;
#else
                    Application.Quit();
#endif
                });
            }
            else
            {
                UIMessageBoxHelper.ShowUpdate(updateTip, msg,
                                              () =>
                {
                    timeStart = Time.time;
                    dofunc();
                },
                                              () =>
                {
#if UNITY_EDITOR
                    UnityEditor.EditorApplication.isPlaying = false;
#else
                    Application.Quit();
#endif
                });
            }
        }
Exemplo n.º 2
0
 public InGamePosition Do(GameState state, GameObjectParameters enemyParameters)
 {
     InvocationsCount++;
     return(OnDo?.Invoke(state, enemyParameters));
 }