Esempio n. 1
0
        /// <summary>
        /// 这里单独处理view逻辑
        /// </summary>
        public void OnLookUpUpdateView()
        {
            if (!string.IsNullOrEmpty(mDataID))
            {
                m_HeadBars2D.SetBarHudState(eHeadBarHud.FightStateHud, null, mFighting);

                {
                    Hashtable tmp = Johny.HashtablePool.Claim();
                    tmp.Add("TeamType", eTeamId.Player);
                    string uid = mDataID.Split('.')[2];
                    if (AllianceUtil.GetLocalUid().ToString().Equals(uid))
                    {
                        tmp.Add("PlayerType", ePlayerType.LocalPlayer);
                    }
                    else
                    {
                        tmp.Add("PlayerType", ePlayerType.OtherPlayer);
                    }
                    tmp.Add("RedName", mIsRedName);

                    string redNameStatePath = mDataID.Replace("state", "promoid");
                    int    promoid          = 0;
                    DataLookupsCache.Instance.SearchDataByID <int>(redNameStatePath, out promoid);
                    tmp.Add("Promoid", promoid);

                    m_HeadBars2D.SetBarHudState(eHeadBarHud.PlayerHeadBarHud, tmp, true);
                }
                mDataID = null;
            }
        }
Esempio n. 2
0
 public void OnLookupUpdate(string dataID, object value)
 {
     if (dataID != null && value != null)
     {
         string    uname = value.ToString();
         Hashtable tmp   = Johny.HashtablePool.Claim();
         tmp.Add("Name", uname);
         bool     isRedName        = false;
         string[] splitArr         = dataID.Split('.');
         string   redNameStatePath = dataID.Replace(splitArr[splitArr.Length - 1], "") + "state.R";
         DataLookupsCache.Instance.SearchDataByID <bool>(redNameStatePath, out isRedName);
         tmp.Add("RedName", isRedName);
         //if (isRedName)
         //{
         //	tmp.Add("TeamType", eTeamId.Player);
         //	tmp.Add("PlayerType", ePlayerType.EnemyPlayer);  //redName need EnemyPlayer
         //	if (m_HeadBars2D != null)
         //	{
         //		m_HeadBars2D.SetBarHudState(eHeadBarHud.PlayerHeadBarHud, tmp, true);
         //	}
         //}
         //else
         {
             tmp.Add("TeamType", eTeamId.Player);
             string uid = dataID.Split('.')[2];                      //mainlands.pl.1003180.un
             if (AllianceUtil.GetLocalUid().ToString().Equals(uid))
             {
                 tmp.Add("PlayerType", ePlayerType.LocalPlayer);
             }
             else
             {
                 tmp.Add("PlayerType", ePlayerType.OtherPlayer);
             }
             if (m_HeadBars2D != null)
             {
                 m_HeadBars2D.SetBarHudState(eHeadBarHud.PlayerHeadBarHud, tmp, true);
             }
         }
     }
 }