Beispiel #1
0
 public void HeroRelive()
 {
     ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
     if (ri != null)
     {
         int reliveStoneId                = ArkCrossEngine.ItemConfigProvider.Instance.GetReliveStoneId();
         int reliveStoneCount             = 0;
         ArkCrossEngine.ItemDataInfo item = ri.GetItemData(reliveStoneId, 0);
         if (null != item)
         {
             reliveStoneCount = item.ItemNum;
         }
         if (ri.Gold < 50 && reliveStoneCount <= 0)
         {
             ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_show_dialog", "ui",
                                                                   ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(149), ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(140), null, null, null, false);
         }
         else
         {
             UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("FightUI");
             if (go != null)
             {
                 PveFightInfo pfi = go.GetComponent <PveFightInfo>();
                 if (pfi != null)
                 {
                     pfi.AboutHeroDead();
                 }
             }
             time = 0.0f;
             ArkCrossEngine.GfxSystem.EventChannelForLogic.Publish("ge_request_relive", "lobby", true);
             ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_ui_connect_hint", "ui", true, true);
         }
     }
 }
Beispiel #2
0
 private void RoleDead()
 {
     try
     {
         isRun = true;
         UIManager.Instance.ShowWindowByName("CombatFalse");
         ArkCrossEngine.RoleInfo roleInfo = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
         if (null != roleInfo)
         {
             int reliveStoneId                = ArkCrossEngine.ItemConfigProvider.Instance.GetReliveStoneId();
             int reliveStoneCount             = 0;
             ArkCrossEngine.ItemDataInfo item = roleInfo.GetItemData(reliveStoneId, 0);
             if (null != item)
             {
                 reliveStoneCount = item.ItemNum;
             }
             if (reliveStoneCount <= 0)
             {
                 // 钻石复活
                 SetDiamondActive(true);
                 SetReliveStoneActive(false);
             }
             else
             {
                 // 复活石复活
                 SetDiamondActive(false);
                 SetReliveStoneActive(true);
             }
             UnityEngine.Transform tf = transform.Find("FightBack/shiNum");
             if (null != tf)
             {
                 UILabel reliveStoneLabel = tf.gameObject.GetComponent <UILabel>();
                 if (null != reliveStoneLabel)
                 {
                     reliveStoneLabel.text = reliveStoneCount.ToString();
                 }
             }
             UILabel costStoneLabel = m_ReliveStoneNum.GetComponent <UILabel>();
             if (costStoneLabel != null)
             {
                 costStoneLabel.text = "1";
             }
         }
     }
     catch (Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }