Exemple #1
0
 public void Update(float fTime)
 {
     if (m_BaseWndObject == null || !m_BaseWndObject.activeSelf)
     {
         return;
     }
     if (m_bCharmChange)
     {
         m_CharmChangeTime -= fTime;
         if (m_CharmChangeTime <= 0)
         {
             m_bCharmChange = false;
             m_CardsInfo.m_UICardsInfo[3].color = new Color(1, 1, 1);
         }
     }
     for (int i = 0; i < m_ListBtneff.Count;)
     {
         EffItem pItem = m_ListBtneff[i];
         pItem.fLife -= fTime;
         if (pItem.fLife < 0)
         {
             GameObject.Destroy(pItem.goEff);
             Utility.ListRemoveAt(m_ListBtneff, i);
         }
         else
         {
             i++;
         }
     }
 }
Exemple #2
0
    void OnSendGift(GameObject go)
    {
        if (m_bMysSelf)
        {
            return;
        }
        byte Index = 0;

        for (byte i = 0; i < m_CardsInfo.m_UIGift.Length; ++i)
        {
            if (go == m_CardsInfo.m_UIGift[i].gameObject)
            {
                Index = m_CharmIndex[i];
                break;
            }
        }
        bool bSumEnough  = true;
        bool bGoldEnough = true;

        if (PlayerRole.Instance.ItemManager.GetItemSum(FishConfig.Instance.m_CharmInfo.CharmIndexMap[Index].ItemID, false) < FishConfig.Instance.m_CharmInfo.CharmIndexMap[Index].ItemSum * 1)
        {
            bSumEnough = false;
        }
        if (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() < FishConfig.Instance.m_CharmInfo.CharmIndexMap[Index].UserGlobel ||
            PlayerRole.Instance.RoleInfo.RoleMe.GetMedal() < FishConfig.Instance.m_CharmInfo.CharmIndexMap[Index].UserMedal ||
            PlayerRole.Instance.RoleInfo.RoleMe.GetCurrency() < FishConfig.Instance.m_CharmInfo.CharmIndexMap[Index].UserCurrcey)
        {
            bGoldEnough = false;
        }
        if ((!bSumEnough) && (!bGoldEnough))
        {
            string str = "";
            if (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() < FishConfig.Instance.m_CharmInfo.CharmIndexMap[Index].UserGlobel)
            {
                str = StringTable.GetString("Global_Gold");
            }
            else if (PlayerRole.Instance.RoleInfo.RoleMe.GetCurrency() < FishConfig.Instance.m_CharmInfo.CharmIndexMap[Index].UserCurrcey)
            {
                str = StringTable.GetString("Global_Jewel");
            }
            else
            {
                str = StringTable.GetString("Global_Medal");
            }
            GlobalEffectMgr.Instance.ShowMessageBox(str, MssageType.GoldLack_Msg_4);
            return;
        }
        if (PlayerRole.Instance.CharmManager.AddTargetCharm(m_PlayerID, Index, 1) == false)
        {
            GlobalHallUIMgr.Instance.ShowSystemTipsUI(StringTable.GetString("Charm_Field"), 0.5f, false);
        }
        else
        {
            if (m_ParentType == CardsParentUIType.Friend_Head || m_ParentType == CardsParentUIType.Other_Head)
            {
                GlobalAudioMgr.Instance.PlayCharmMusic(Audio.OrdianryMusic.m_Gift0 + Index);
            }
            EffItem pItem = new EffItem();
            pItem.fLife = 0.4f;
            pItem.goEff = GameObject.Instantiate(GlobalHallUIMgr.Instance.GiftBtnEff) as GameObject;
            pItem.goEff.GetComponent <UISprite>().spriteName = m_CardsInfo.m_UIGift[Index].spriteName;
            pItem.goEff.transform.SetParent(m_CardsInfo.m_UIGift[Index].gameObject.transform, false);
            m_ListBtneff.Add(pItem);
        }
    }