Exemple #1
0
        public static void AddOrDelEnemy(Iplayer entity, bool add)
        {
            CEvent eve = new CEvent(EGameEvent.eGameEvent_AddOrDelEnemy);

            eve.AddParam("Add", add);
            eve.AddParam("Target", entity);
            EventCenter.SendEvent(eve);
        }
        public void SendTaskMarkObjList(EGameEvent gameEve, List <GameObject> objList)
        {
            CEvent even = new CEvent(gameEve);

            even.AddParam("TaskState", IGuideTask.TaskState.TaskMark);
            even.AddParam("Mark", objList);
            EventCenter.SendEvent(even);
        }
 public void TryInit()
 {
     //说明网络可以
     if (Application.internetReachability != NetworkReachability.NotReachable)
     {
         CheckTimeout checkTimeout = new CheckTimeout();
         checkTimeout.AsynIsNetworkTimeout((result) =>
         {
             //网络良好
             if (result)
             {
                 //开始更新检测
                 DoInit();
             }
             else //说明网络错误
             {
                 Debug.Log("网络错误");
                 //开始消息提示框,重试和退出
                 CEvent evt = new CEvent(EGameEvent.eGameEvent_ShowMessage);
                 evt.AddParam("title", StringConfigManager.GetString("MessageWindow.EMT_NetTryAgain.Title"));
                 evt.AddParam("content", StringConfigManager.GetString("MessageWindow.EMT_NetTryAgain.Content"));
                 EventCenter.SendEvent <EMessageType, Action <bool> >(evt, EMessageType.EMT_Double, (isOk) =>
                 {
                     if (isOk)
                     {
                         TryInit();//重试
                     }
                     else
                     {
                         Application.Quit();//退出
                     }
                 });
             }
         });
     }
     else
     {
         CEvent evt = new CEvent(EGameEvent.eGameEvent_ShowMessage);
         evt.AddParam("title", StringConfigManager.GetString("MessageWindow.EMT_NetTryAgain.Title"));
         evt.AddParam("content", StringConfigManager.GetString("MessageWindow.EMT_NetTryAgain.Content"));
         EventCenter.SendEvent <EMessageType, Action <bool> >(evt, EMessageType.EMT_Double, (isOk) =>
         {
             if (isOk)
             {
                 TryInit();//重试
             }
             else
             {
                 Application.Quit();//退出
             }
         });
     }
 }
Exemple #4
0
    void SendOpenShop(bool tag)
    {
        CEvent eve = new CEvent(EGameEvent.eGameEvent_NotifyOpenShop);

        eve.AddParam("Tag", tag);
        EventCenter.SendEvent(eve);
    }
        private void SendHpLessWarning(bool tag)
        {
            CEvent eve = new CEvent(EGameEvent.eGameEvent_NotifyHpLessWarning);

            eve.AddParam("Tag", tag);
            EventCenter.SendEvent(eve);
        }
        public void SendTaskEffectShow(EGameEvent gameEve)
        {
            CEvent eve = new CEvent(gameEve);

            eve.AddParam("TaskState", IGuideTask.TaskState.TaskShow);
            EventCenter.SendEvent(eve);
        }
Exemple #7
0
    public void OnLoginSumbit(GameObject go)
    {
        string username = this.m_Input_UsernameInput.value;
        string password = this.m_Input_PasswordInput.value;

        //如果用户名或者密码为空的话,就显示提示消息
        if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
        {
            CEvent evt = new CEvent(EGameEvent.eGameEvent_ShowMessage);
            evt.AddParam("content", StringConfigManager.GetString("MessageWindow.EMT_SureTip.LoginNullUsernameOrPassword"));
            EventCenter.SendEvent <EMessageType, Action <bool> >(evt, EMessageType.EMT_SureTip, (isOk) =>
            {
                EventCenter.Broadcast(EGameEvent.eGameEvent_HideMessage);
            });
        }
        LoginCtrl.singleton.Login(username, password);
    }
    private void CheckVersion(Action finished)
    {
        //添加一个解压文件界面提示回调
        Action <bool> fileDecompress = (finish) =>
        {
            LOLGameDriver.Invoke(() =>
            {
                EventCenter.Broadcast(EGameEvent.eGameEvent_HideMessage);
                if (finish)
                {
                    CEvent evt = new CEvent(EGameEvent.eGameEvent_ShowMessage);
                    evt.AddParam("content", StringConfigManager.GetString("EMessageType.EMT_UpdateTip.Content2"));
                    EventCenter.SendEvent <EMessageType, Action <bool> >(evt, EMessageType.EMT_Tip, null);
                    Debug.Log("正在更新本地文件");
                }
                else
                {
                    CEvent evt = new CEvent(EGameEvent.eGameEvent_ShowMessage);
                    evt.AddParam("content", StringConfigManager.GetString("EMessageType.EMT_UpdateTip.Content3"));
                    EventCenter.SendEvent <EMessageType, Action <bool> >(evt, EMessageType.EMT_Tip, null);
                    Debug.Log("数据读取中");
                }
            });
        };
        Action <int, int, string> taskProgress = (total, index, fileName) =>
        {
            LOLGameDriver.Invoke(() =>
            {
                //正在下载更新文件
                Debug.Log(string.Format("正在下载更新文件({0}/{1}:{2})", index + 1, total, fileName));
                CEvent evt = new CEvent(EGameEvent.eGameEvent_ShowMessage);
                evt.AddParam("index", index + 1);
                evt.AddParam("total", total);
                evt.AddParam("fileName", fileName);
                EventCenter.SendEvent <EMessageType, Action <bool> >(evt, EMessageType.EMT_UpdateDownload, (isOk) =>
                {
                    if (isOk)
                    {
                        Application.OpenURL("http://www.baidu.com");
                    }
                    else
                    {
                    }
                });
            });
        };
        Action <int, long, long> progress = (ProgressPercentage, TotalBytesToReceive, BytesReceive) =>
        {
            //处理进度条
            Debug.Log(string.Format("进度:{0}%", ProgressPercentage));
        };
        Action <Exception> error = (ex) =>
        {
            Debug.Log(ex);
        };
        //界面提示版本检查中
        //EventCenter.Broadcast<EMessageType, Action<bool>>(EGameEvent.eGameEvent_ShowMessage, EMessageType.EMT_UpdateTip,null);
        CEvent cEvent = new CEvent(EGameEvent.eGameEvent_ShowMessage);

        cEvent.AddParam("content", StringConfigManager.GetString("EMessageType.EMT_UpdateTip.Content1"));
        EventCenter.SendEvent <EMessageType, Action <bool> >(cEvent, EMessageType.EMT_Tip, null);
        Debug.Log("版本检查中...");
        VersionManager.singleton.CheckVersion(fileDecompress, taskProgress, progress, finished, error);
    }