예제 #1
0
    public void ReflashPetSaleMoneyUI()
    {
        int iMoney    = 0;
        int iCraystal = 0;
        int iTemp     = 0;
        int iUp       = 0;

        foreach (DictionaryEntry info in petIconList)
        {
            sdUIPetSaleSelectCard icon = info.Value as sdUIPetSaleSelectCard;
            if (icon.m_bSelect == true && icon.m_uuDBID != UInt64.MaxValue && icon.m_uuDBID != 0)
            {
                SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(icon.m_uuDBID);
                if (Info == null)
                {
                    continue;
                }

                Hashtable Info2 = sdConfDataMgr.Instance().GetPetTemplate(Info.m_uiTemplateID.ToString());
                if (Info2 == null)
                {
                    continue;
                }

                iTemp   = int.Parse(Info2["SellMoney"].ToString());
                iMoney += iTemp;
                iTemp   = int.Parse(Info2["Crystal"].ToString());
                iUp     = Info.m_iUp;
                if (Info.m_iUp == 0)
                {
                    iUp = 1;
                }
                else if (Info.m_iUp == 1)
                {
                    iUp = 2;
                }
                else if (Info.m_iUp == 2)
                {
                    iUp = 4;
                }
                else if (Info.m_iUp == 3)
                {
                    iUp = 8;
                }

                iTemp      = iTemp * iUp;
                iCraystal += iTemp;
            }
        }

        if (m_moneyNum)
        {
            m_moneyNum.GetComponent <UILabel>().text = iMoney.ToString();
        }

        if (m_craystalNum)
        {
            m_craystalNum.GetComponent <UILabel>().text = iCraystal.ToString();
        }
    }
예제 #2
0
    public bool IsSelectedWonderfulPet()
    {
        bool bResult = false;

        foreach (DictionaryEntry info in petIconList)
        {
            sdUIPetSaleSelectCard icon = info.Value as sdUIPetSaleSelectCard;
            if (icon.m_bSelect == true && icon.m_uuDBID != UInt64.MaxValue && icon.m_uuDBID != 0)
            {
                SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(icon.m_uuDBID);
                if (Info == null)
                {
                    continue;
                }

                if (Info.m_iAbility >= 3)
                {
                    bResult = true;
                    break;
                }
            }
        }

        return(bResult);
    }
예제 #3
0
    void OnClick()
    {
        if (gameObject.name == "petSelect")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetStrongPnl petPnl = wnd.GetComponentInChildren <sdUIPetStrongPnl>();
                if (petPnl)
                {
                    //属性变化的UI显示..
                    SClientPetInfo Info = null;
                    if (petPnl.m_uuDBID == UInt64.MaxValue)
                    {
                        return;
                    }

                    Info = sdNewPetMgr.Instance.GetPetInfo(petPnl.m_uuDBID);
                    if (Info == null)
                    {
                        return;
                    }

                    if (Info.m_iUp >= sdNewPetMgr.MAX_PET_STRONG_LEVEL)
                    {
                        sdUICharacter.Instance.ShowOkMsg("该战魂已经强化到最高级别", null);
                        return;
                    }

                    sdUIPetControl.Instance.ActivePetStrongSelectPnl(null, petPnl.m_uuDBID, sdNewPetMgr.Instance.m_uuPetStrongSelectID);
                }
            }
        }
    }
예제 #4
0
    public void CreateSearchFri(HeaderProto.SFriendInfo info)
    {
        searchFri.id        = info.m_RoleDBID.ToString();
        searchFri.gender    = info.m_Sex;
        searchFri.hairStyle = (byte)info.m_Head;
        searchFri.color     = info.m_SkinColor;
        searchFri.name      = Encoding.UTF8.GetString(info.m_Name).Trim('\0');
        searchFri.level     = info.m_Level.ToString();
        searchFri.job       = info.m_Job.ToString();
        searchFri.power     = info.m_Attack.ToString();
        searchFri.isOnline  = info.m_IsOnline == 1 ? true : false;
        searchFri.point     = (int)info.m_ActionPoint;
        searchFri.canSend   = info.m_CanDonateActionPoint == 1 ? true : false;
        HeaderProto.SRSRoleEquipData equip = info.m_Equip;
        int itemNum = equip.m_Count;

        for (int i = 0; i < itemNum; ++i)
        {
            searchFri.equipList.Add((uint)equip.m_EquipInfo[i].m_TID);
        }

        HeaderProto.SRSRolePetData pet = info.m_Pet;
        int petNum = pet.m_Count;

        for (int i = 0; i < petNum; ++i)
        {
            SClientPetInfo petInfo = new SClientPetInfo();
            petInfo.m_uiTemplateID = (uint)(pet.m_PetInfo[i].m_TemplateID);
            searchFri.petList.Add(petInfo);
        }
    }
예제 #5
0
    public void ReflashPetIcon()
    {
        if (peticon)
        {
            sdUIPetZuheSmallIcon icon = peticon.GetComponent <sdUIPetZuheSmallIcon>();
            SClientPetInfo       Info = sdNewPetMgr.Instance.GetPetInfo(m_uuSelectDBID);

            if (icon != null && Info != null)
            {
                icon.SetIdAndReflashUI((int)Info.m_uiTemplateID);
            }

            if (txtName != null && Info != null)
            {
                sdNewPetMgr.SetLabelColorByAbility(Info.m_iAbility, txtName);
                txtName.GetComponent <UILabel>().text = Info.m_strName;
            }

            if (txtUp != null && Info != null)
            {
                if (Info.m_iUp > 0)
                {
                    txtUp.GetComponent <UILabel>().text = "+" + Info.m_iUp.ToString();
                    txtUp.SetActive(true);
                }
                else
                {
                    txtUp.SetActive(false);
                }
            }
        }
    }
예제 #6
0
    public void ShowRonghePetSelectRightModel()
    {
        SClientPetInfo Info = null;

        if (m_uuPetID1 != UInt64.MaxValue)
        {
            Info = sdNewPetMgr.Instance.GetPetInfo(m_uuPetID1);
            if (Info != null)
            {
                // 载入宠物形象..
                if (m_PetModel1)
                {
                    Destroy(m_PetModel1);
                }
                m_PetModel1 = null;
                ResLoadParams param = new ResLoadParams();
                param.pos = new Vector3(0.0f, -140.0f, -200.0f);
                param.rot.Set(0, 180.0f, 0, 0);
                param.scale = new Vector3(180.0f, 180.0f, 180.0f);
                string strPath = Info.m_strRes.Replace(".prefab", "_UI.prefab");
                sdResourceMgr.Instance.LoadResource(strPath, RightPetLoadInstantiate, param);
                //宠物名字..
                if (m_txt_Sel1)
                {
                    sdNewPetMgr.SetLabelColorByAbility(Info.m_iAbility, m_txt_Sel1);
                    UILabel txtLable = m_txt_Sel1.GetComponent <UILabel>();
                    if (txtLable)
                    {
                        txtLable.text = Info.m_strName;
                    }
                }

                if (btnRhSel1)
                {
                    btnRhSel1.SetActive(false);
                }
            }
        }

        if (m_txt_SelResult != null)
        {
            UILabel txtLable = m_txt_SelResult.GetComponent <UILabel>();
            if (txtLable)
            {
                if (m_uuPetID0 == UInt64.MaxValue && m_uuPetID1 == UInt64.MaxValue)
                {
                    txtLable.text = "任意两只四星以下相同星级的+3战魂,可通过融合随机获得一只星级+1的战魂";
                }
                else if ((m_uuPetID0 == UInt64.MaxValue && m_uuPetID1 != UInt64.MaxValue) ||
                         (m_uuPetID0 != UInt64.MaxValue && m_uuPetID1 == UInt64.MaxValue))
                {
                    txtLable.text = "请选择另一个需要融合的战魂";
                }
                else if (m_uuPetID0 != UInt64.MaxValue && m_uuPetID1 != UInt64.MaxValue)
                {
                    txtLable.text = "请点击融合按钮进行融合";
                }
            }
        }
    }
예제 #7
0
 public void SetInfo(SClientPetInfo sPet)
 {
     m_PetIcon.spriteName  = sPet.m_strIcon;
     m_PetFrame.spriteName = sdConfDataMgr.Instance().GetPetQuilityBorder(sPet.m_iAbility);
     m_PetAdd.SetActive(false);
     if (sPet.m_iAbility >= 1)
     {
         m_PetStar1.SetActive(true);
     }
     else
     {
         m_PetStar1.SetActive(false);
     }
     if (sPet.m_iAbility >= 2)
     {
         m_PetStar2.SetActive(true);
     }
     else
     {
         m_PetStar2.SetActive(false);
     }
     if (sPet.m_iAbility >= 3)
     {
         m_PetStar3.SetActive(true);
     }
     else
     {
         m_PetStar3.SetActive(false);
     }
     if (sPet.m_iAbility >= 4)
     {
         m_PetStar4.SetActive(true);
     }
     else
     {
         m_PetStar4.SetActive(false);
     }
     if (sPet.m_iAbility >= 5)
     {
         m_PetStar5.SetActive(true);
     }
     else
     {
         m_PetStar5.SetActive(false);
     }
     if (sPet.m_iAbility == 2 || sPet.m_iAbility == 4)
     {
         m_PetStar1.transform.localPosition = new Vector3(10.0f, m_PetStar1.transform.localPosition.y, 0);
     }
     else
     {
         m_PetStar1.transform.localPosition = new Vector3(0, m_PetStar1.transform.localPosition.y, 0);
     }
 }
예제 #8
0
    public void OnClickStrongOk()
    {
        //属性变化的UI显示..
        SClientPetInfo Info = null;

        if (m_uuDBID == UInt64.MaxValue)
        {
            return;
        }

        Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
        if (Info == null)
        {
            return;
        }

        if (Info.m_iUp >= sdNewPetMgr.MAX_PET_STRONG_LEVEL)
        {
            sdUICharacter.Instance.ShowOkMsg("该战魂已经强化到最高级别", null);
            return;
        }

        if (sdNewPetMgr.Instance.m_uuPetStrongSelectID == UInt64.MaxValue)
        {
            sdUICharacter.Instance.ShowOkMsg("请选择一个战魂作为强化材料", null);
            return;
        }

        //金钱不足判断..
        uint        uiMyMoney = 0;
        sdGameLevel level     = sdGameLevel.instance;

        if (level != null)
        {
            if (level.mainChar != null)
            {
                Hashtable prop = level.mainChar.GetProperty();
                uiMyMoney = (uint)prop["NonMoney"];
            }
        }
        if (m_iStrongMoney > uiMyMoney)
        {
            sdUICharacter.Instance.ShowOkMsg("没有足够的金币", null);
            return;
        }

        SendPetStrongMsg();
        sdNewPetMgr.Instance.m_uuPetStrongSelectID = UInt64.MaxValue;
        ReflashPetStrongIcon();
    }
예제 #9
0
    public static void msg_SCID_FRIEND_INFO_CHANGE_NTF(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_FRIEND_INFO_CHANGE_NTF refMSG = (CliProto.SC_FRIEND_INFO_CHANGE_NTF)msg;

        sdFriend fri = sdFriendMgr.Instance.GetFriend(refMSG.m_Info.m_RoleDBID.ToString());

        if (fri != null)
        {
            if (refMSG.m_Info.m_Info.m_Type == (byte)HeaderProto.RS_ROLE_PROERTY_TYPE.RS_ROLE_PROPERTY_NULL)
            {
                return;
            }
            else if (refMSG.m_Info.m_Info.m_Type == (byte)HeaderProto.RS_ROLE_PROERTY_TYPE.RS_ROLE_PROPERTY_BASE)
            {
                fri.level = refMSG.m_Info.m_Info.m_Property.m_Base.m_Level.ToString();
                fri.power = refMSG.m_Info.m_Info.m_Property.m_Base.m_Attack.ToString();
            }
            else if (refMSG.m_Info.m_Info.m_Type == (byte)HeaderProto.RS_ROLE_PROERTY_TYPE.RS_ROLE_PROPERTY_PET)
            {
                fri.petList.Clear();
                HeaderProto.SRSRolePetData pet = refMSG.m_Info.m_Info.m_Property.m_Pet;
                int petNum = pet.m_Count;
                for (int i = 0; i < petNum; ++i)
                {
                    SClientPetInfo petInfo = new SClientPetInfo();
                    petInfo.m_uiTemplateID = (uint)(pet.m_PetInfo[i].m_TemplateID);
                    fri.petList.Add(petInfo);
                }
            }
            else if (refMSG.m_Info.m_Info.m_Type == (byte)HeaderProto.RS_ROLE_PROERTY_TYPE.RS_ROLE_PROPERTY_EQUIP)
            {
                fri.equipList.Clear();
                int itemNum = refMSG.m_Info.m_Info.m_Property.m_Equip.m_Count;
                for (int i = 0; i < itemNum; ++i)
                {
                    fri.equipList.Add((uint)refMSG.m_Info.m_Info.m_Property.m_Equip.m_EquipInfo[i].m_TID);
                }
            }
            else if (refMSG.m_Info.m_Info.m_Type == (byte)HeaderProto.RS_ROLE_PROERTY_TYPE.RS_ROLE_PROPERTY_ONLINE)
            {
                fri.isOnline = refMSG.m_Info.m_Info.m_Property.m_Online.m_IsOnline == 1 ? true : false;
            }

            sdUICharacter.Instance.RefreshFri();
        }
    }
예제 #10
0
    public void CreateFriend(HeaderProto.SFriendInfo info)
    {
        sdFriend friend = GetFriend(info.m_RoleDBID.ToString());

        if (friend == null)
        {
            friend = new sdFriend();
        }
        friend.id        = info.m_RoleDBID.ToString();
        friend.gender    = info.m_Sex;
        friend.hairStyle = (byte)info.m_Head;
        friend.color     = info.m_SkinColor;
        friend.name      = Encoding.UTF8.GetString(info.m_Name).Trim('\0');
        friend.level     = info.m_Level.ToString();
        friend.job       = info.m_Job.ToString();
        friend.power     = info.m_Attack.ToString();
        friend.isOnline  = info.m_IsOnline == 1 ? true : false;
        friend.point     = (int)info.m_ActionPoint;
        friend.canSend   = info.m_CanDonateActionPoint == 1 ? true : false;
        HeaderProto.SRSRoleEquipData equip = info.m_Equip;
        int itemNum = equip.m_Count;

        for (int i = 0; i < itemNum; ++i)
        {
            friend.equipList.Add((uint)equip.m_EquipInfo[i].m_TID);
        }

        HeaderProto.SRSRolePetData pet = info.m_Pet;
        int petNum = pet.m_Count;

        for (int i = 0; i < petNum; ++i)
        {
            SClientPetInfo petInfo = new SClientPetInfo();
            petInfo.m_uiTemplateID = (uint)(pet.m_PetInfo[i].m_TemplateID);
            friend.petList.Add(petInfo);
        }
        if (friendList.ContainsKey(friend.id))
        {
            friendList[friend.id] = friend;
        }
        else
        {
            friendList.Add(friend.id, friend);
        }
    }
예제 #11
0
    public void LoadPetModel()
    {
        // 载入宠物形象..
        if (m_uuDBID != UInt64.MaxValue)
        {
            SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
            if (Info == null)
            {
                return;
            }

            m_nPetTemplateID = Info.m_uiTemplateID;
            DestroyPetModel();

            // 载入模型..
            ResLoadParams param = new ResLoadParams();
            param.pos = new Vector3(0.0f, -163.0f, -200.0f);
            param.rot.Set(0, 180.0f, 0, 0);
            param.scale = new Vector3(180.0f, 180.0f, 180.0f);
            string strPath = Info.m_strRes.Replace(".prefab", "_UI.prefab");
            sdResourceMgr.Instance.LoadResource(strPath, PetLoadInstantiate, param);
        }
        else
        {
            if (m_iPetTemplateID > 0)
            {
                Hashtable tempInfo = sdConfDataMgr.Instance().GetPetTemplate(m_iPetTemplateID.ToString());
                if (tempInfo != null)
                {
                    string strRes = tempInfo["Res"].ToString();

                    m_nPetTemplateID = (uint)m_iPetTemplateID;
                    DestroyPetModel();

                    // 载入模型..
                    ResLoadParams param = new ResLoadParams();
                    param.pos = new Vector3(0.0f, -163.0f, -200.0f);
                    param.rot.Set(0, 180.0f, 0, 0);
                    param.scale = new Vector3(180.0f, 180.0f, 180.0f);
                    string strPath = strRes.Replace(".prefab", "_UI.prefab");
                    sdResourceMgr.Instance.LoadResource(strPath, PetLoadInstantiate, param);
                }
            }
        }
    }
예제 #12
0
 private static void msg_SC_ROLE_RANK_ACK(int iMsg, ref CMessage msg)
 {
     CliProto.SC_ROLE_RANK_ACK refMsg      = (CliProto.SC_ROLE_RANK_ACK)msg;
     HeaderProto.SRankRoleAck  rankRoleAck = refMsg.m_Ack;
     sdRankListMgr.Instance.m_Count      = rankRoleAck.m_RankCount;
     sdRankListMgr.Instance.m_TotalCount = rankRoleAck.m_TotalCount;
     sdRankListMgr.Instance.m_SelfRank   = rankRoleAck.m_SelfRank;
     sdRankListMgr.Instance.m_Avatar.Clear();
     for (int index = 0; index < rankRoleAck.m_RankCount; ++index)
     {
         HeaderProto.SRoleBaseInfo baseInfo = rankRoleAck.m_Rank[index].m_RoleInfo.m_BaseInfo;
         sdFriend info = new sdFriend();
         info.id        = baseInfo.m_RoleDBID.ToString();
         info.gender    = baseInfo.m_Sex;
         info.hairStyle = (byte)baseInfo.m_HairStyle;
         info.color     = baseInfo.m_SkinColor;
         info.name      = Encoding.UTF8.GetString(baseInfo.m_Name).Trim('\0');
         info.level     = baseInfo.m_Level.ToString();
         info.job       = baseInfo.m_Job.ToString();
         info.power     = baseInfo.m_Attack.ToString();
         info.pvpwin    = baseInfo.m_PVPWins;
         info.pvprepute = baseInfo.m_PVPRepute;
         info.isOnline  = baseInfo.m_IsOnline == 1 ? true : false;
         HeaderProto.SRSRoleEquipData equip = rankRoleAck.m_Rank[index].m_RoleInfo.m_Equip;
         for (int i = 0; i < equip.m_Count; ++i)
         {
             info.equipList.Add((uint)equip.m_EquipInfo[i].m_TID);
         }
         HeaderProto.SRSBattlePets pet = rankRoleAck.m_Rank[index].m_RoleInfo.m_BattlePets;
         for (int j = 0; j < pet.m_Count; ++j)
         {
             SClientPetInfo petInfo = new SClientPetInfo();
             petInfo.m_uiTemplateID = (uint)(pet.m_Pets[j].m_TID);
             petInfo.m_iUp          = pet.m_Pets[j].m_UP;
             petInfo.m_iLevel       = pet.m_Pets[j].m_LV;
             info.petList.Add(petInfo);
         }
         sdRankListMgr.Instance.m_Avatar.Add(info);
     }
     sdRankListMgr.Instance.Refresh();
 }
예제 #13
0
    void OnClick()
    {
        if (gameObject)
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetLevelPnl petPnl = wnd.GetComponentInChildren <sdUIPetLevelPnl>();
                if (petPnl)
                {
                    SClientPetInfo Info = null;
                    if (petPnl.m_uuDBID == UInt64.MaxValue)
                    {
                        return;
                    }
                    Info = sdNewPetMgr.Instance.GetPetInfo(petPnl.m_uuDBID);
                    if (Info == null)
                    {
                        return;
                    }

                    int iLevel   = Info.m_iLevel;
                    int iMyLevel = int.Parse(sdGameLevel.instance.mainChar.Property["Level"].ToString());
                    iMyLevel = iMyLevel + 20;
                    if (iLevel >= sdNewPetMgr.MAX_PET_LEVEL)
                    {
                        sdUICharacter.Instance.ShowOkMsg("该战魂已经满级", null);
                        return;
                    }
                    else if (iLevel < sdNewPetMgr.MAX_PET_LEVEL && iLevel >= iMyLevel)
                    {
                        sdUICharacter.Instance.ShowOkMsg("战魂等级不可高于主角等级20级以上", null);
                        return;
                    }

                    sdUIPetControl.Instance.ActivePetLevelSelectPnl(null, petPnl.m_uuDBID);
                    petPnl.SetPetModelVisible(false);
                }
            }
        }
    }
예제 #14
0
    public void OnClickPetAutoSale(int iAbility, bool bAllSelect)
    {
        foreach (DictionaryEntry info in petIconList)
        {
            sdUIPetSaleSelectCard icon = info.Value as sdUIPetSaleSelectCard;
            if (icon.m_uuDBID != UInt64.MaxValue && icon.m_uuDBID != 0)
            {
                SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(icon.m_uuDBID);
                if (Info == null)
                {
                    continue;
                }

                if (Info.m_iAbility == iAbility)
                {
                    icon.SetPetSelect(bAllSelect);
                }
            }
        }

        ReflashPetSaleMoneyUI();
    }
예제 #15
0
    public void LoadPetModel()
    {
        // 载入宠物形象..
        if (m_uuDBID != UInt64.MaxValue)
        {
            SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
            if (Info == null)
            {
                return;
            }

            m_nPetTemplateID = Info.m_uiTemplateID;
            DestroyPetModel();

            // 载入模型..
            ResLoadParams param = new ResLoadParams();
            param.pos = new Vector3(0.0f, -140.0f, -200.0f);
            param.rot.Set(0, 180.0f, 0, 0);
            param.scale = new Vector3(180.0f, 180.0f, 180.0f);
            string strPath = Info.m_strRes.Replace(".prefab", "_UI.prefab");
            sdResourceMgr.Instance.LoadResource(strPath, PetLoadInstantiate, param);
        }
    }
예제 #16
0
    /* 获取PVP角色信息请求  */
    private static void msg_SC_GET_PVP_ROLE_INFO_ACK(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_GET_PVP_ROLE_INFO_ACK refMsg = (CliProto.SC_GET_PVP_ROLE_INFO_ACK)msg;
        if (refMsg.m_Result != 0)
        {
            return;
        }
        List <stPVPRival> rivalList = sdPVPManager.Instance.GetRanklist();

        if (ms_Index >= 0 && ms_Index < rivalList.Count)
        {
            stPVPRival rival    = rivalList[ms_Index];
            sdFriend   roleInfo = new sdFriend();
            roleInfo.id        = rival.roleID.ToString();
            roleInfo.gender    = (byte)rival.nSex;
            roleInfo.hairStyle = (byte)rival.hairstyle;
            roleInfo.color     = (byte)rival.haircolor;
            roleInfo.name      = rival.strName;
            roleInfo.level     = rival.nLevel.ToString();
            roleInfo.job       = rival.nProfession.ToString();
            roleInfo.power     = refMsg.m_Attack.ToString();

            for (int index = 0; index < refMsg.m_Equip.m_Items.m_ItemCount; ++index)
            {
                roleInfo.equipList.Add((uint)refMsg.m_Equip.m_Items.m_Items[index].m_TID);
            }
            for (int i = 0; i < refMsg.m_Pet.m_PetCount; ++i)
            {
                SClientPetInfo petInfo = new SClientPetInfo();
                petInfo.m_uiTemplateID = refMsg.m_Pet.m_PetsInfo[i].m_TemplateID;
                petInfo.m_iLevel       = refMsg.m_Pet.m_PetsInfo[i].m_Level;
                petInfo.m_iUp          = refMsg.m_Pet.m_PetsInfo[i].m_Up;
                roleInfo.petList.Add(petInfo);
            }
            sdUICharacter.Instance.ShowRoleTipWnd(roleInfo, true, 1);
        }
    }
예제 #17
0
    public void SetDBIDAndReflashUI(UInt64 uuDBID)
    {
        m_uuDBID = uuDBID;

        if (m_add)
        {
            m_add.SetActive(true);
        }

        if (m_bg)
        {
            m_bg.SetActive(true);
            m_bg.GetComponent <UISprite>().spriteName = "IconL2w";
        }

        if (m_uuDBID == UInt64.MaxValue)
        {
            if (m_icon)
            {
                m_icon.SetActive(false);
            }

            if (m_star0)
            {
                m_star0.SetActive(false);
            }

            if (m_star1)
            {
                m_star1.SetActive(false);
            }

            if (m_star2)
            {
                m_star2.SetActive(false);
            }

            if (m_star3)
            {
                m_star3.SetActive(false);
            }

            if (m_star4)
            {
                m_star4.SetActive(false);
            }
        }
        else
        {
            SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
            if (Info == null)
            {
                return;
            }

            if (m_add)
            {
                m_add.SetActive(false);
            }

            if (m_icon)
            {
                m_icon.GetComponent <UISprite>().spriteName = Info.m_strIcon;
                m_icon.SetActive(true);
            }

            SetPetStar(Info.m_iAbility);
        }
    }
예제 #18
0
    public void UpdatePetSelectList()
    {
        if (m_spet == null)
        {
            return;
        }

        Hashtable list = null;

        list = sdNewPetMgr.Instance.GetPetList();

        //将宠物数据填充到List中,用来排序..
        List <SClientPetInfo> listBattle     = new List <SClientPetInfo>();
        List <SClientPetInfo> listBattleHelp = new List <SClientPetInfo>();
        List <SClientPetInfo> listOther      = new List <SClientPetInfo>();

        foreach (DictionaryEntry info in list)
        {
            string         key1  = info.Key.ToString();
            SClientPetInfo info1 = info.Value as SClientPetInfo;
            if (sdNewPetMgr.Instance.GetIsInBattleTeam(UInt64.Parse(key1)) == 1)
            {
                listBattle.Add(info1);
            }
            else if (sdNewPetMgr.Instance.GetIsInBattleTeam(UInt64.Parse(key1)) == 2)
            {
                listBattleHelp.Add(info1);
            }
            else if (sdNewPetMgr.Instance.GetIsInBattleTeam(UInt64.Parse(key1)) == 0)
            {
                listOther.Add(info1);
            }
        }
        if (m_iSortType == (int)PetSortType.Pet_SortBy_Level)
        {
            listBattle.Sort(SClientPetInfo.PetSortByLevel);
            listBattleHelp.Sort(SClientPetInfo.PetSortByLevel);
            listOther.Sort(SClientPetInfo.PetSortByLevel);
        }
        else if (m_iSortType == (int)PetSortType.Pet_SortBy_Color)
        {
            listBattle.Sort(SClientPetInfo.PetSortByAbility);
            listBattleHelp.Sort(SClientPetInfo.PetSortByAbility);
            listOther.Sort(SClientPetInfo.PetSortByAbility);
        }

        int num   = list.Count;
        int iZero = 0;

        if (num < 8)
        {
            iZero = 8 - num;
        }
        else
        {
            int iLast = num % 4;
            if (iLast > 0)
            {
                iZero = 4 - iLast;
            }
        }

        num = num + iZero;
        int count = petIconList.Count;

        if (num > count)
        {
            num = num - count;
            for (int i = 0; i < num; ++i)
            {
                GameObject tempItem = GameObject.Instantiate(m_spet) as GameObject;
                tempItem.GetComponent <sdUIPetWarSelectCard>().index = count;
                tempItem.transform.parent        = m_spet.transform.parent;
                tempItem.transform.localPosition = m_spet.transform.localPosition;
                tempItem.transform.localScale    = m_spet.transform.localScale;
                Vector3 pos = tempItem.transform.localPosition;
                pos.y = pos.y - (276 * (count / 4));
                int iX = (count % 4) * 221;
                pos.x += iX;
                tempItem.transform.localPosition = pos;
                petIconList.Add(petIconList.Count, tempItem.GetComponent <sdUIPetWarSelectCard>());
                ++count;
            }
        }

        IDictionaryEnumerator iter = petIconList.GetEnumerator();

        foreach (SClientPetInfo infoEntry in listBattle)
        {
            if (iter.MoveNext())
            {
                sdUIPetWarSelectCard icon = iter.Value as sdUIPetWarSelectCard;
                icon.ReflashPetIconUI(infoEntry.m_uuDBID);
                if (infoEntry.m_uuDBID == m_uuSelectDBID)
                {
                    icon.SetPetSelect(true);
                }
            }
        }

        foreach (SClientPetInfo infoEntry in listBattleHelp)
        {
            if (iter.MoveNext())
            {
                sdUIPetWarSelectCard icon = iter.Value as sdUIPetWarSelectCard;
                icon.ReflashPetIconUI(infoEntry.m_uuDBID);
                if (infoEntry.m_uuDBID == m_uuSelectDBID)
                {
                    icon.SetPetSelect(true);
                }
            }
        }

        foreach (SClientPetInfo infoEntry in listOther)
        {
            if (iter.MoveNext())
            {
                sdUIPetWarSelectCard icon = iter.Value as sdUIPetWarSelectCard;
                icon.ReflashPetIconUI(infoEntry.m_uuDBID);
                if (infoEntry.m_uuDBID == m_uuSelectDBID)
                {
                    icon.SetPetSelect(true);
                }
            }
        }

        //只显示底板的卡片..
        for (int i = 0; i < iZero; i++)
        {
            if (iter.MoveNext())
            {
                sdUIPetWarSelectCard icon = iter.Value as sdUIPetWarSelectCard;
                icon.ReflashPetIconUI(0);
            }
        }

        while (iter.MoveNext())
        {
            sdUIPetWarSelectCard icon = iter.Value as sdUIPetWarSelectCard;
            icon.ReflashPetIconUI(UInt64.MaxValue);
        }

        if (m_spet != null)
        {
            m_spet.transform.parent.GetComponent <UIDraggablePanel>().ResetPosition();
        }
    }
예제 #19
0
    public void ReflashPetBattleIconUI()
    {
        if (m_uuDBID == UInt64.MaxValue)
        {
            if (m_spIcon)
            {
                m_spIcon.SetActive(false);
            }

            if (m_spStar0)
            {
                m_spStar0.SetActive(false);
            }
            if (m_spStar1)
            {
                m_spStar1.SetActive(false);
            }
            if (m_spStar2)
            {
                m_spStar2.SetActive(false);
            }
            if (m_spStar3)
            {
                m_spStar3.SetActive(false);
            }
            if (m_spStar4)
            {
                m_spStar4.SetActive(false);
            }

            if (m_spType)
            {
                m_spType.SetActive(false);
            }

            if (m_txtAdd)
            {
                m_txtAdd.SetActive(false);
            }

            if (m_txtLevel)
            {
                m_txtLevel.SetActive(false);
            }

            if (m_txtName)
            {
                m_txtName.SetActive(false);
            }
        }
        else
        {
            SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
            if (Info == null)
            {
                return;
            }

            if (m_spIcon)
            {
                m_spIcon.gameObject.GetComponent <UISprite>().spriteName = Info.m_strIcon;
                m_spIcon.SetActive(true);
            }

            SetPetStar(Info.m_iAbility);

            if (m_spType)
            {
                if (Info.m_iBaseJob == 1)
                {
                    m_spType.GetComponent <UISprite>().spriteName = "zs";
                    m_spType.SetActive(true);
                }
                else if (Info.m_iBaseJob == 2)
                {
                    m_spType.GetComponent <UISprite>().spriteName = "fs";
                    m_spType.SetActive(true);
                }
                else if (Info.m_iBaseJob == 3)
                {
                    m_spType.GetComponent <UISprite>().spriteName = "yx";
                    m_spType.SetActive(true);
                }
                else if (Info.m_iBaseJob == 4)
                {
                    m_spType.GetComponent <UISprite>().spriteName = "ms";
                    m_spType.SetActive(true);
                }
                else
                {
                    m_spType.SetActive(false);
                }
            }

            if (m_txtAdd)
            {
                if (Info.m_iUp > 0)
                {
                    m_txtAdd.GetComponent <UILabel>().text = "+" + Info.m_iUp.ToString();
                    m_txtAdd.SetActive(true);
                }
                else
                {
                    m_txtAdd.SetActive(false);
                }
            }

            if (m_txtLevel)
            {
                m_txtLevel.GetComponent <UILabel>().text = "Lv." + Info.m_iLevel.ToString();
                m_txtLevel.SetActive(true);
            }

            if (m_txtName)
            {
                sdNewPetMgr.SetLabelColorByAbility(Info.m_iAbility, m_txtName);
                m_txtName.GetComponent <UILabel>().text = Info.m_strName;
                m_txtName.SetActive(true);
            }
        }
    }
예제 #20
0
    public void ReflashPetIconUI(UInt64 uuID)
    {
        if (uuID == UInt64.MaxValue)
        {
            m_uuDBID = UInt64.MaxValue;
            gameObject.SetActive(false);
            m_iBz     = 0;
            m_bSelect = false;
            return;
        }

        gameObject.SetActive(true);
        m_uuDBID = uuID;
        ReflashSelectUI();

        SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);

        if (Info == null)
        {
            return;
        }

        if (m_spBz)
        {
            m_iBz = sdNewPetMgr.Instance.GetIsInBattleTeam(m_uuDBID);
            if (m_iBz == 1)
            {
                m_spBz.GetComponent <UISprite>().spriteName = "cz";
                m_spBz.SetActive(true);
            }
            else if (m_iBz == 2)
            {
                m_spBz.GetComponent <UISprite>().spriteName = "zz";
                m_spBz.SetActive(true);
            }
            else if (m_iBz == 3)
            {
                m_spBz.GetComponent <UISprite>().spriteName = "new";
                m_spBz.SetActive(true);
            }
            else
            {
                m_spBz.SetActive(false);
            }
        }

        if (m_spIcon)
        {
            m_spIcon.GetComponent <UISprite>().spriteName = Info.m_strIcon;
        }

        if (m_spLock)
        {
            if (Info.m_Lock == 1)
            {
                m_spLock.SetActive(true);
            }
            else
            {
                m_spLock.SetActive(false);
            }
        }

        SetPetStar(Info.m_iAbility);

        if (m_spType)
        {
            if (Info.m_iBaseJob == 1)
            {
                m_spType.GetComponent <UISprite>().spriteName = "zs";
                m_spType.SetActive(true);
            }
            else if (Info.m_iBaseJob == 2)
            {
                m_spType.GetComponent <UISprite>().spriteName = "fs";
                m_spType.SetActive(true);
            }
            else if (Info.m_iBaseJob == 3)
            {
                m_spType.GetComponent <UISprite>().spriteName = "yx";
                m_spType.SetActive(true);
            }
            else if (Info.m_iBaseJob == 4)
            {
                m_spType.GetComponent <UISprite>().spriteName = "ms";
                m_spType.SetActive(true);
            }
            else
            {
                m_spType.SetActive(false);
            }
        }

        if (m_txtAdd)
        {
            if (Info.m_iUp > 0)
            {
                m_txtAdd.GetComponent <UILabel>().text = "+" + Info.m_iUp.ToString();
                m_txtAdd.SetActive(true);
            }
            else
            {
                m_txtAdd.SetActive(false);
            }
        }

        if (m_txtLevel)
        {
            m_txtLevel.GetComponent <UILabel>().text = "Lv." + Info.m_iLevel.ToString();
            m_txtLevel.SetActive(true);
        }

        if (m_txtName)
        {
            sdNewPetMgr.SetLabelColorByAbility(Info.m_iAbility, m_txtName);
            m_txtName.GetComponent <UILabel>().text = Info.m_strName;
            m_txtName.SetActive(true);
        }
    }
예제 #21
0
    public void Refresh(sdFriend roleInfo, int nType)
    {
        for (int i = 0; i < btnPanel.Length; ++i)
        {
            btnPanel[i].SetActive(i == nType);
        }
        lb_name.text = roleInfo.name;
        //euqip
        if (UI_avatar != null)
        {
            UI_avatar.transform.localRotation = Quaternion.Euler(0.0f, 180.0f, 0.0f);
            for (int i = 0; i < UI_avatar.transform.childCount; ++i)
            {
                if (UI_avatar.transform.GetChild(i).gameObject != null)
                {
                    GameObject.Destroy(UI_avatar.transform.GetChild(i).gameObject);
                }
            }
            m_kInfo            = new sdGameActorCreateInfo();
            m_kInfo.mDBID      = ulong.Parse(roleInfo.id);
            m_kInfo.mGender    = roleInfo.gender;
            m_kInfo.mHairStyle = roleInfo.hairStyle;
            m_kInfo.mSkinColor = roleInfo.color;
            m_kInfo.mBaseJob   = byte.Parse(roleInfo.job);
            m_kInfo.mJob       = byte.Parse(roleInfo.job);
            m_kInfo.mLevel     = int.Parse(roleInfo.level);

            m_equiplist = roleInfo.equipList.ToArray();

            m_strName = roleInfo.name;
            //lb_power.gameObject.SetActive(int.Parse(roleInfo.power) != 0);
            lb_power.text = "战斗力 " + roleInfo.power;

            string name = "";
            int    job  = int.Parse(roleInfo.job);
            switch (job)
            {
            case (int)HeaderProto.ERoleJob.ROLE_JOB_Warrior:
            {
                name = "warrior";
                break;
            }

            case (int)HeaderProto.ERoleJob.ROLE_JOB_Magic:
            {
                name = "magic";
                break;
            }

            case (int)HeaderProto.ERoleJob.ROLE_JOB_Rogue:
            {
                name = "rogue";
                break;
            }

            case (int)HeaderProto.ERoleJob.ROLE_JOB_Minister:
            {
                name = "minister";
                break;
            }
            }
            ResLoadParams para = new ResLoadParams();
            para.info      = "back";
            para.userdata0 = job;
            para.userdata1 = false;
            string namePreb = string.Format("UI/Icon/$icon_{0}_back/icon_{0}_back.prefab", name);
            sdUICharacter.Instance.LoadAtlas(namePreb, sprite_profession, sdConfDataMgr.Instance().GetJobBack(roleInfo.job));
            UpdateEquip(roleInfo);
        }
        //fashion

        //pet
        int nChildCount = petPanel.transform.childCount;

        for (int index = 0; index < nChildCount; ++index)
        {
            GameObject uiItem = null;
            Transform  trans  = petPanel.transform.FindChild("item" + index.ToString());
            if (trans != null)
            {
                uiItem = trans.gameObject;
            }
            else
            {
                uiItem                         = GameObject.Instantiate(petTemplate) as GameObject;
                uiItem.name                    = "item" + index.ToString();
                uiItem.transform.parent        = petPanel.transform;
                uiItem.transform.localScale    = Vector3.one;
                uiItem.transform.localPosition = new Vector3(petTemplate.transform.localPosition.x, petTemplate.transform.localPosition.y - index * 120, petTemplate.transform.localPosition.z);
                uiItem.transform.localRotation = Quaternion.identity;
            }
            uiItem.SetActive(true);
            Transform  tran_head    = uiItem.transform.FindChild("border").FindChild("head");
            GameObject obj_petName  = uiItem.transform.FindChild("name").gameObject;
            UISprite   sprite_level = uiItem.transform.FindChild("border").GetComponent <UISprite>();

            UILabel lb_power     = uiItem.transform.FindChild("pow").GetComponent <UILabel>();
            UILabel lb_level     = uiItem.transform.FindChild("level").GetComponent <UILabel>();
            UILabel lb_intensify = uiItem.transform.FindChild("intensify").GetComponent <UILabel>();
            if (index < roleInfo.petList.Count)
            {
                SClientPetInfo petInfo = roleInfo.petList[index];
                Hashtable      Info    = sdConfDataMgr.Instance().GetPetTemplate(petInfo.m_uiTemplateID.ToString());
                if (Info == null)
                {
                    continue;
                }
                tran_head.gameObject.SetActive(true);
                sprite_level.gameObject.SetActive(true);
                obj_petName.SetActive(true);
                lb_power.gameObject.SetActive(true);
                lb_level.gameObject.SetActive(true);
                lb_intensify.gameObject.SetActive(true);

                UISprite sprite_head = tran_head.GetComponent <UISprite>();
                sprite_head.spriteName = Info["Icon"].ToString();
                int iAbility = int.Parse(Info["Ability"].ToString());
                sprite_level.spriteName = spritename_level[iAbility - 1];
                sdNewPetMgr.SetLabelColorByAbility(iAbility, obj_petName);
                obj_petName.GetComponent <UILabel>().text = Info["Name"].ToString();

                //星级aaa
                //int parentWidth = sprite_head.width;
                for (int i = 1; i <= 5; ++i)
                {
                    GameObject obj_start = tran_head.FindChild("start" + i.ToString()).gameObject;
                    obj_start.SetActive(true);
                    int nWidth = obj_start.GetComponent <UISprite>().width *iAbility;
                    obj_start.SetActive(i <= iAbility);

                    Vector3 pos = obj_start.transform.localPosition;
                    obj_start.transform.localPosition = new Vector3(-nWidth / 2 + i * 15, pos.y, pos.z);
                }

                lb_power.text     = "战斗力 " + sdConfDataMgr.Instance().GetPetScoreByTemplateID((int)petInfo.m_uiTemplateID, petInfo.m_iUp, petInfo.m_iLevel).ToString();
                lb_level.text     = "等级:" + petInfo.m_iLevel.ToString();
                lb_intensify.text = "强化:+" + petInfo.m_iUp.ToString();
            }
            else
            {
                tran_head.gameObject.SetActive(false);
                sprite_level.gameObject.SetActive(false);
                obj_petName.SetActive(false);
                lb_power.gameObject.SetActive(false);
                lb_level.gameObject.SetActive(false);
                lb_intensify.gameObject.SetActive(false);
                for (int i = 1; i <= 5; ++i)
                {
                    GameObject obj_start = tran_head.FindChild("start" + i.ToString()).gameObject;
                    obj_start.SetActive(false);
                }
            }
        }
        ShowEquip();
        tab_equip.GetComponent <sdRadioButton>().Active(true);
        tab_fashion.GetComponent <sdRadioButton>().Active(false);
        tab_pet.GetComponent <sdRadioButton>().Active(false);
    }
예제 #22
0
    public void ReflashPetEquipUI()
    {
        if (equip0)
        {
            equip0.SetActive(false);
        }

        if (equip1)
        {
            equip1.SetActive(false);
        }

        if (equip2)
        {
            equip2.SetActive(false);
        }

        if (equipK0)
        {
            equipK0.GetComponent <sdUIPetEquipButtonClick>().m_iEquipID = 0;
        }

        if (equipK1)
        {
            equipK1.GetComponent <sdUIPetEquipButtonClick>().m_iEquipID = 0;
        }

        if (equipK2)
        {
            equipK2.GetComponent <sdUIPetEquipButtonClick>().m_iEquipID = 0;
        }

        if (m_uuSelectDBID == UInt64.MaxValue)
        {
            return;
        }
        SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(m_uuSelectDBID);

        if (Info == null)
        {
            return;
        }

        foreach (DictionaryEntry equipInfo in Info.m_EquipedDB)
        {
            sdGamePetItem petItem = (sdGamePetItem)equipInfo.Value;
            Hashtable     info    = sdConfDataMgr.Instance().GetItemById(petItem.templateID.ToString());
            if (info != null)
            {
                int    isubClass = int.Parse(info["SubClass"].ToString());
                int    iconId    = int.Parse(info["IconID"].ToString());
                string strIcon   = info["IconPath"].ToString();
                if (iconId >= 0)
                {
                    UIAtlas atlas = sdConfDataMgr.Instance().GetItemAtlas(iconId.ToString());
                    if (atlas != null)
                    {
                        if (isubClass == (int)PetEquipType.Pet_EquipType_fj)
                        {
                            if (equip0)
                            {
                                equip0.GetComponent <UISprite>().atlas      = atlas;
                                equip0.GetComponent <UISprite>().spriteName = strIcon;
                                equip0.SetActive(true);

                                if (equipK0)
                                {
                                    equipK0.GetComponent <sdUIPetEquipButtonClick>().m_iEquipID = petItem.templateID;
                                }
                            }
                        }
                        else if (isubClass == (int)PetEquipType.Pet_EquipType_wq)
                        {
                            if (equip1)
                            {
                                equip1.GetComponent <UISprite>().atlas      = atlas;
                                equip1.GetComponent <UISprite>().spriteName = strIcon;
                                equip1.SetActive(true);

                                if (equipK1)
                                {
                                    equipK1.GetComponent <sdUIPetEquipButtonClick>().m_iEquipID = petItem.templateID;
                                }
                            }
                        }
                        else if (isubClass == (int)PetEquipType.Pet_EquipType_sp)
                        {
                            if (equip2)
                            {
                                equip2.GetComponent <UISprite>().atlas      = atlas;
                                equip2.GetComponent <UISprite>().spriteName = strIcon;
                                equip2.SetActive(true);

                                if (equipK2)
                                {
                                    equipK2.GetComponent <sdUIPetEquipButtonClick>().m_iEquipID = petItem.templateID;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
예제 #23
0
    public void RefreshPetZuhePage()
    {
        int            iTmpID = 0;
        SClientPetInfo Info   = null;

        if (m_uuDBID != UInt64.MaxValue)
        {
            Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
        }
        else
        {
            if (m_iPetTemplateID > 0)
            {
                Info = sdNewPetMgr.Instance.GetPetInfoByTemplateID(m_iPetTemplateID, m_iPetUp, m_iPetLevel);
            }
        }

        if (Info != null)
        {
            iTmpID = (int)Info.m_uiTemplateID;
        }

        List <sdPetZuheData> listData = new List <sdPetZuheData>();

        Hashtable kTable = sdConfDataMgr.Instance().GetPetGroupsTable();

        if (kTable != null)
        {
            foreach (DictionaryEntry de in kTable)
            {
                string    key1     = (string)de.Key;
                Hashtable valTable = (Hashtable)de.Value;
                int       iPetID1  = int.Parse(valTable["Data1.PetID"].ToString());
                int       iPetID2  = int.Parse(valTable["Data2.PetID"].ToString());
                int       iPetID3  = int.Parse(valTable["Data3.PetID"].ToString());
                int       iPetID4  = int.Parse(valTable["Data4.PetID"].ToString());

                bool bNeedShow = false;
                if (iPetID1 > 0 && iPetID1 == iTmpID)
                {
                    bNeedShow = true;
                }
                if (iPetID2 > 0 && iPetID2 == iTmpID)
                {
                    bNeedShow = true;
                }
                if (iPetID3 > 0 && iPetID3 == iTmpID)
                {
                    bNeedShow = true;
                }
                if (iPetID4 > 0 && iPetID4 == iTmpID)
                {
                    bNeedShow = true;
                }

                if (bNeedShow)
                {
                    sdPetZuheData data = new sdPetZuheData();
                    data.iZuheID = int.Parse(key1);

                    data.iPetID1 = iPetID1;
                    if (iPetID1 > 0)
                    {
                        data.iPetEnableType1 = 2;
                    }
                    else
                    {
                        data.iPetEnableType1 = 0;
                    }

                    data.iPetID2 = iPetID2;
                    if (iPetID2 > 0)
                    {
                        data.iPetEnableType2 = 2;
                    }
                    else
                    {
                        data.iPetEnableType2 = 0;
                    }

                    data.iPetID3 = iPetID3;
                    if (iPetID3 > 0)
                    {
                        data.iPetEnableType3 = 2;
                    }
                    else
                    {
                        data.iPetEnableType3 = 0;
                    }

                    data.iPetID4 = iPetID4;
                    if (iPetID4 > 0)
                    {
                        data.iPetEnableType4 = 2;
                    }
                    else
                    {
                        data.iPetEnableType4 = 0;
                    }

                    listData.Add(data);
                }
            }
        }

        int num   = listData.Count;
        int iZero = 0;

        if (num < 2)
        {
            iZero = 2 - num;
        }

        num = num + iZero;
        int count = petzuheInfoList.Count;

        if (num > count)
        {
            num = num - count;
            for (int i = 0; i < num; ++i)
            {
                GameObject tempItem = GameObject.Instantiate(copyListItem) as GameObject;
                tempItem.GetComponent <sdUIPetZuheIcon>().index = count;
                tempItem.transform.parent        = copyListItem.transform.parent;
                tempItem.transform.localPosition = copyListItem.transform.localPosition;
                tempItem.transform.localScale    = copyListItem.transform.localScale;
                Vector3 pos = tempItem.transform.localPosition;
                pos.y = pos.y - (295 * count);
                tempItem.transform.localPosition = pos;
                petzuheInfoList.Add(petzuheInfoList.Count, tempItem.GetComponent <sdUIPetZuheIcon>());
                ++count;
            }
        }

        IDictionaryEnumerator iter = petzuheInfoList.GetEnumerator();

        foreach (sdPetZuheData infoEntry in listData)
        {
            if (iter.MoveNext())
            {
                sdUIPetZuheIcon icon = iter.Value as sdUIPetZuheIcon;
                if (infoEntry.iPetEnableType1 == 1)
                {
                    icon.bpetGray0 = true;
                }
                else
                {
                    icon.bpetGray0 = false;
                }

                if (infoEntry.iPetEnableType2 == 1)
                {
                    icon.bpetGray1 = true;
                }
                else
                {
                    icon.bpetGray1 = false;
                }

                if (infoEntry.iPetEnableType3 == 1)
                {
                    icon.bpetGray2 = true;
                }
                else
                {
                    icon.bpetGray2 = false;
                }

                if (infoEntry.iPetEnableType4 == 1)
                {
                    icon.bpetGray3 = true;
                }
                else
                {
                    icon.bpetGray3 = false;
                }

                icon.SetIdAndReflashUI(infoEntry.iZuheID);
                icon.SetGray(false);
            }
        }

        //只显示底板的卡片..
        for (int i = 0; i < iZero; i++)
        {
            if (iter.MoveNext())
            {
                sdUIPetZuheIcon icon = iter.Value as sdUIPetZuheIcon;
                icon.SetIdAndReflashUI(0);
            }
        }

        while (iter.MoveNext())
        {
            sdUIPetZuheIcon icon = iter.Value as sdUIPetZuheIcon;
            icon.SetIdAndReflashUI(-1);
        }

        if (copyListItem != null)
        {
            copyListItem.transform.parent.GetComponent <UIDraggablePanel>().ResetPosition();
        }
    }
예제 #24
0
    public void ReflashPetPropUI()
    {
        SClientPetInfo Info = null;

        if (m_uuDBID != UInt64.MaxValue)
        {
            Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
            if (Info == null)
            {
                return;
            }
        }
        else
        {
            if (m_iPetTemplateID > 0)
            {
                Info = sdNewPetMgr.Instance.GetPetInfoByTemplateID(m_iPetTemplateID, m_iPetUp, m_iPetLevel);
                if (Info == null)
                {
                    return;
                }
            }
            else
            {
                return;
            }
        }

        //左侧UI显示..
        if (m_picType)
        {
            if (Info.m_iBaseJob == 1)
            {
                m_picType.GetComponent <UISprite>().spriteName = "IPzs";
                m_picType.SetActive(true);
            }
            else if (Info.m_iBaseJob == 2)
            {
                m_picType.GetComponent <UISprite>().spriteName = "IPfs";
                m_picType.SetActive(true);
            }
            else if (Info.m_iBaseJob == 3)
            {
                m_picType.GetComponent <UISprite>().spriteName = "IPyx";
                m_picType.SetActive(true);
            }
            else if (Info.m_iBaseJob == 4)
            {
                m_picType.GetComponent <UISprite>().spriteName = "IPms";
                m_picType.SetActive(true);
            }
            else
            {
                m_picType.SetActive(false);
            }
        }

        if (m_lbName)
        {
            sdNewPetMgr.SetLabelColorByAbility(Info.m_iAbility, m_lbName);
            m_lbName.GetComponent <UILabel>().text = Info.m_strName;
        }

        if (m_lbStrong)
        {
            if (Info.m_iUp > 0)
            {
                m_lbStrong.GetComponent <UILabel>().text = "+" + Info.m_iUp.ToString();
                m_lbStrong.SetActive(true);
            }
            else
            {
                m_lbStrong.SetActive(false);
            }
        }

        if (m_lbValue)
        {
            if (m_uuDBID != UInt64.MaxValue)
            {
                int iTemp = sdConfDataMgr.Instance().GetPetScore(m_uuDBID);
                m_lbValue.GetComponent <UILabel>().text = iTemp.ToString();
            }
            else
            {
                if (m_iPetTemplateID > 0)
                {
                    int iTemp = sdConfDataMgr.Instance().GetPetScoreByTemplateID(m_iPetTemplateID, m_iPetUp, m_iPetLevel);
                    m_lbValue.GetComponent <UILabel>().text = iTemp.ToString();
                }
            }
        }

        if (m_picCz)
        {
            int m_iBz = sdNewPetMgr.Instance.GetIsInBattleTeam(Info.m_uuDBID);
            if (m_iBz == 1)
            {
                m_picCz.GetComponent <UISprite>().spriteName = "cz";
                m_picCz.SetActive(true);
            }
            else if (m_iBz == 2)
            {
                m_picCz.GetComponent <UISprite>().spriteName = "zz";
                m_picCz.SetActive(true);
            }
            else
            {
                m_picCz.SetActive(false);
            }
        }

        if (Info.m_Lock == 1)
        {
            if (m_picLock)
            {
                m_picLock.SetActive(true);
            }

            if (m_btnLock)
            {
                m_btnLock.transform.FindChild("bg").GetComponent <UISprite>().spriteName = "js";
            }
        }
        else
        {
            if (m_picLock)
            {
                m_picLock.SetActive(false);
            }

            if (m_btnLock)
            {
                m_btnLock.transform.FindChild("bg").GetComponent <UISprite>().spriteName = "jjs";
            }
        }

        if (m_iPetTemplateID > 0 && m_uuDBID == UInt64.MaxValue)
        {
            if (m_btnLock)
            {
                m_btnLock.SetActive(false);
            }

            if (m_btnPetShow)
            {
                m_btnPetShow.SetActive(false);
            }
        }
        else if (m_iPetTemplateID == 0 && m_uuDBID != UInt64.MaxValue)
        {
            if (m_btnLock)
            {
                m_btnLock.SetActive(true);
            }

            if (m_btnPetShow)
            {
                m_btnPetShow.SetActive(true);
            }
        }

        //左侧经验条..
        ReflashExpLineUI();

        //基础属性..
        if (m_lbv1)
        {
            if (Info.m_iBaseJob == 1)
            {
                m_lbv1.GetComponent <UILabel>().text = "战士";
            }
            else if (Info.m_iBaseJob == 2)
            {
                m_lbv1.GetComponent <UILabel>().text = "法师";
            }
            else if (Info.m_iBaseJob == 3)
            {
                m_lbv1.GetComponent <UILabel>().text = "游侠";
            }
            else if (Info.m_iBaseJob == 4)
            {
                m_lbv1.GetComponent <UILabel>().text = "牧师";
            }
            else
            {
                m_lbv1.GetComponent <UILabel>().text = "其他";
            }
        }

        if (m_lbv21)
        {
            m_lbv21.GetComponent <UILabel>().text = Info.m_strSPD1;
        }

        if (m_lbv22)
        {
            m_lbv22.GetComponent <UILabel>().text = Info.m_strSPD2;
        }

        Hashtable infoTmp = sdConfDataMgr.Instance().GetPetTemplate(Info.m_uiTemplateID.ToString());

        if (infoTmp != null)
        {
            if (m_lbv3)
            {
                m_lbv3.GetComponent <UILabel>().text = Info.m_CurProperty.m_iAtkDmgMax.ToString();

                float fTemp = sdNewPetMgr.Instance.GetPetAttCoe(Info.m_uiTemplateID, sdNewPetMgr.MAX_PET_STRONG_LEVEL, sdNewPetMgr.MAX_PET_LEVEL);
                int   iTemp = (int)fTemp + int.Parse(infoTmp["Property.AtkDmgMax"].ToString());
                m_lbv3.transform.FindChild("lbv3_0").gameObject.GetComponent <UILabel>().text = "(Max:" + iTemp.ToString() + ")";
            }

            if (m_lbv4)
            {
                m_lbv4.GetComponent <UILabel>().text = Info.m_CurProperty.m_iDef.ToString();

                float fTemp = sdNewPetMgr.Instance.GetPetDefCoe(Info.m_uiTemplateID, sdNewPetMgr.MAX_PET_STRONG_LEVEL, sdNewPetMgr.MAX_PET_LEVEL);
                int   iTemp = (int)fTemp + int.Parse(infoTmp["Property.Def"].ToString());
                m_lbv4.transform.FindChild("lbv4_0").gameObject.GetComponent <UILabel>().text = "(Max:" + iTemp.ToString() + ")";
            }

            if (m_lbv5)
            {
                m_lbv5.GetComponent <UILabel>().text = Info.m_CurProperty.m_iMaxHP.ToString();

                float fTemp = sdNewPetMgr.Instance.GetPetHPCoe(Info.m_uiTemplateID, sdNewPetMgr.MAX_PET_STRONG_LEVEL, sdNewPetMgr.MAX_PET_LEVEL);
                int   iTemp = (int)fTemp + int.Parse(infoTmp["Property.MaxHP"].ToString());
                m_lbv5.transform.FindChild("lbv5_0").gameObject.GetComponent <UILabel>().text = "(Max:" + iTemp.ToString() + ")";
            }
        }

        if (m_lbdesc)
        {
            m_lbdesc.GetComponent <UILabel>().text = Info.m_strDesc;
        }

        SetPetStar(Info.m_iAbility);

        ReflashPetSkillUI();
    }
예제 #25
0
    void OnClick()
    {
        if (gameObject.name == "BT_petClose")
        {
            if (sdUIPetControl.m_UIPetChangeEquipPnl != null)
            {
                sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetChangeEquipPnl);
            }

            if (m_preWnd)
            {
                m_preWnd.SetActive(true);
            }

            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    petPnl.SetPetModelVisible(true);
                }
            }
        }
        else if (gameObject.name == "btnEquip")
        {
            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetChangeEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>();
                if (petPnl)
                {
                    foreach (DictionaryEntry info in petPnl.petItemList)
                    {
                        sdUIPetEquipIcon icon = info.Value as sdUIPetEquipIcon;
                        if (icon != null)
                        {
                            UInt64 uuID = icon.GetId();
                            if (uuID != UInt64.MaxValue && icon.bSelect == true)
                            {
                                sdPetMsg.Send_CS_PET_EQUIP_REQ(uuID, petPnl.m_uuSelectDBID, 1);
                            }
                        }
                    }
                }
            }
        }
        else if (gameObject.name == "btnUnEquip")
        {
            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetChangeEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>();
                if (petPnl)
                {
                    SClientPetInfo Info = null;
                    if (petPnl.m_uuSelectDBID != UInt64.MaxValue)
                    {
                        Info = sdNewPetMgr.Instance.GetPetInfo(petPnl.m_uuSelectDBID);
                        if (Info == null)
                        {
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }

                    foreach (DictionaryEntry equipInfo in Info.m_EquipedDB)
                    {
                        sdGamePetItem petItem = (sdGamePetItem)equipInfo.Value;
                        UInt64        uuID    = petItem.instanceID;
                        if (uuID != UInt64.MaxValue)
                        {
                            sdPetMsg.Send_CS_PET_EQUIP_REQ(uuID, petPnl.m_uuSelectDBID, 0);
                        }
                    }
                }
            }
        }
    }
예제 #26
0
    public void ReflashPetStrongIcon()
    {
        m_iStrongMoney = 0;

        if (petOld)
        {
            sdUIPetStrongCard card = petOld.GetComponent <sdUIPetStrongCard>();
            if (card)
            {
                card.m_iIconType = 0;
                card.ReflashPetIconUI(m_uuDBID);
            }
        }

        if (petSelect)
        {
            sdUIPetStrongCard card = petSelect.GetComponent <sdUIPetStrongCard>();
            if (card)
            {
                card.m_iIconType = 0;
                card.ReflashPetIconUI(sdNewPetMgr.Instance.m_uuPetStrongSelectID);
            }
        }

        if (petNew)
        {
            sdUIPetStrongCard card = petNew.GetComponent <sdUIPetStrongCard>();
            if (card)
            {
                card.m_iIconType = 1;
                card.ReflashPetIconUI(m_uuDBID);
            }
        }

        //属性变化的UI显示..
        SClientPetInfo Info = null;

        if (m_uuDBID == UInt64.MaxValue)
        {
            return;
        }

        Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
        if (Info == null)
        {
            return;
        }

        if (Info.m_iUp == 3)
        {
            if (m_stArrow0)
            {
                m_stArrow0.SetActive(false);
            }

            if (m_stArrow1)
            {
                m_stArrow1.SetActive(false);
            }

            if (m_stArrow2)
            {
                m_stArrow2.SetActive(false);
            }

            //老属性..
            if (m_stGJOldTxt0)
            {
                float fGj   = sdNewPetMgr.Instance.GetPetAttCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fGj + Info.m_TemplateProperty.m_iAtkDmgMax;
                m_stGJOldTxt0.GetComponent <UILabel>().text = iTemp.ToString();
            }

            if (m_stFYOldTxt0)
            {
                float fFy   = sdNewPetMgr.Instance.GetPetDefCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fFy + Info.m_TemplateProperty.m_iDef;
                m_stFYOldTxt0.GetComponent <UILabel>().text = iTemp.ToString();
            }

            if (m_stSMOldTxt0)
            {
                float fSm   = sdNewPetMgr.Instance.GetPetHPCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fSm + Info.m_TemplateProperty.m_iMaxHP;
                m_stSMOldTxt0.GetComponent <UILabel>().text = iTemp.ToString();
            }

            //新老属性对比..
            if (m_stGJOldTxt)
            {
                float fGj   = sdNewPetMgr.Instance.GetPetAttCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fGj + Info.m_TemplateProperty.m_iAtkDmgMax;
                m_stGJOldTxt.GetComponent <UILabel>().text = iTemp.ToString();
            }

            if (m_stFYOldTxt)
            {
                float fFy   = sdNewPetMgr.Instance.GetPetDefCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fFy + Info.m_TemplateProperty.m_iDef;
                m_stFYOldTxt.GetComponent <UILabel>().text = iTemp.ToString();
            }

            if (m_stSMOldTxt)
            {
                float fSm   = sdNewPetMgr.Instance.GetPetHPCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fSm + Info.m_TemplateProperty.m_iMaxHP;
                m_stSMOldTxt.GetComponent <UILabel>().text = iTemp.ToString();
            }

            //新老属性对比..
            if (m_stGJNewTxt)
            {
                m_stGJNewTxt.SetActive(false);
            }

            if (m_stFYNewTxt)
            {
                m_stFYNewTxt.SetActive(false);
            }

            if (m_stSMNewTxt)
            {
                m_stSMNewTxt.SetActive(false);
            }

            //消耗金钱..
            if (hint)
            {
                hint.GetComponent <UILabel>().text = "强化等级已满";
            }

            if (moneyNum)
            {
                moneyNum.GetComponent <UILabel>().text = "0";
            }
        }
        else
        {
            if (m_stArrow0)
            {
                m_stArrow0.SetActive(true);
            }

            if (m_stArrow1)
            {
                m_stArrow1.SetActive(true);
            }

            if (m_stArrow2)
            {
                m_stArrow2.SetActive(true);
            }

            //老属性..
            if (m_stGJOldTxt0)
            {
                float fGj   = sdNewPetMgr.Instance.GetPetAttCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fGj + Info.m_TemplateProperty.m_iAtkDmgMax;
                m_stGJOldTxt0.GetComponent <UILabel>().text = iTemp.ToString();
            }

            if (m_stFYOldTxt0)
            {
                float fFy   = sdNewPetMgr.Instance.GetPetDefCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fFy + Info.m_TemplateProperty.m_iDef;
                m_stFYOldTxt0.GetComponent <UILabel>().text = iTemp.ToString();
            }

            if (m_stSMOldTxt0)
            {
                float fSm   = sdNewPetMgr.Instance.GetPetHPCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fSm + Info.m_TemplateProperty.m_iMaxHP;
                m_stSMOldTxt0.GetComponent <UILabel>().text = iTemp.ToString();
            }

            //新老属性对比..
            if (m_stGJOldTxt)
            {
                float fGj   = sdNewPetMgr.Instance.GetPetAttCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fGj + Info.m_TemplateProperty.m_iAtkDmgMax;
                m_stGJOldTxt.GetComponent <UILabel>().text = iTemp.ToString();
            }

            if (m_stFYOldTxt)
            {
                float fFy   = sdNewPetMgr.Instance.GetPetDefCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fFy + Info.m_TemplateProperty.m_iDef;
                m_stFYOldTxt.GetComponent <UILabel>().text = iTemp.ToString();
            }

            if (m_stSMOldTxt)
            {
                float fSm   = sdNewPetMgr.Instance.GetPetHPCoe(Info.m_uiTemplateID, Info.m_iUp, Info.m_iLevel);
                int   iTemp = (int)fSm + Info.m_TemplateProperty.m_iMaxHP;
                m_stSMOldTxt.GetComponent <UILabel>().text = iTemp.ToString();
            }

            //新老属性对比..
            if (m_stGJNewTxt)
            {
                float fTemp = sdNewPetMgr.Instance.GetPetAttCoe(Info.m_uiTemplateID, Info.m_iUp + 1, Info.m_iLevel);
                int   iTemp = (int)fTemp + Info.m_TemplateProperty.m_iAtkDmgMax;
                m_stGJNewTxt.GetComponent <UILabel>().text = iTemp.ToString();
                m_stGJNewTxt.SetActive(true);
            }

            if (m_stFYNewTxt)
            {
                float fTemp = sdNewPetMgr.Instance.GetPetDefCoe(Info.m_uiTemplateID, Info.m_iUp + 1, Info.m_iLevel);
                int   iTemp = (int)fTemp + Info.m_TemplateProperty.m_iDef;
                m_stFYNewTxt.GetComponent <UILabel>().text = iTemp.ToString();
                m_stFYNewTxt.SetActive(true);
            }

            if (m_stSMNewTxt)
            {
                float fTemp = sdNewPetMgr.Instance.GetPetHPCoe(Info.m_uiTemplateID, Info.m_iUp + 1, Info.m_iLevel);
                int   iTemp = (int)fTemp + Info.m_TemplateProperty.m_iMaxHP;
                m_stSMNewTxt.GetComponent <UILabel>().text = iTemp.ToString();
                m_stSMNewTxt.SetActive(true);
            }

            //消耗金钱..
            if (hint)
            {
                int    iUp      = Info.m_iUp;
                int    iAbility = Info.m_iAbility;
                string strTemp  = "";
                if (iAbility == 1)
                {
                    strTemp = "放入任意一星";
                }
                else if (iAbility == 2)
                {
                    strTemp = "放入任意二星";
                }
                else if (iAbility == 3)
                {
                    strTemp = "放入任意三星";
                }
                else if (iAbility == 4)
                {
                    strTemp = "放入任意四星";
                }
                else if (iAbility == 5)
                {
                    strTemp = "放入任意五星";
                }
                else
                {
                    strTemp = "放入任意一星";
                }

                string strTemp2 = "";
                if (iUp == 0)
                {
                    strTemp2 = "未强化战魂";
                }
                else
                {
                    strTemp2 = string.Format("+{0}战魂", iUp);
                }
                hint.GetComponent <UILabel>().text = strTemp + strTemp2;
            }

            if (moneyNum)
            {
                int       iMoney = 0;
                Hashtable Info2  = sdConfDataMgr.Instance().GetPetTemplate(Info.m_uiTemplateID.ToString());
                if (Info2 != null)
                {
                    iMoney = int.Parse(Info2["UpMoneyCoe"].ToString());
                    iMoney = iMoney * (Info.m_iUp + 1);
                }

                m_iStrongMoney = iMoney;
                moneyNum.GetComponent <UILabel>().text = iMoney.ToString();
            }
        }
    }
예제 #27
0
    public void UpdatePet()
    {
        // 好友宠物.
        if (m_PetIdx == 100)
        {
            m_PetIcon.spriteName  = "";
            m_PetFrame.spriteName = "";
            m_PetStar1.SetActive(false);
            m_PetAdd.SetActive(true);
            m_LockMask.SetActive(false);

            // 判断好友宠物是否解锁.
            if (sdLevelInfo.GetLevelValid(m_FriPetUnlockLevel) == false)
            {
                m_PetAdd.SetActive(false);
                m_LockMask.SetActive(true);
            }
            return;
        }

        // 判断宠物是否解锁.
        if (sdLevelInfo.GetLevelValid(m_PetUnlockLevel) == false)
        {
            m_PetIcon.spriteName  = "";
            m_PetFrame.spriteName = "";
            m_PetAdd.SetActive(false);
            m_PetStar1.SetActive(false);
            m_LockMask.SetActive(true);
            return;
        }

        //UInt64 uPetID = sdNewPetMgr.Instance.GetPetFromTeamByIndex(m_PetIdx);
        UInt64 uPetID = sdNewPetMgr.Instance.mPetAllTeam[m_PetIdx];

        if (uPetID != UInt64.MaxValue)
        {
            SClientPetInfo sPet = sdNewPetMgr.Instance.GetPetInfo(uPetID);

            m_PetIcon.spriteName  = sPet.m_strIcon;
            m_PetFrame.spriteName = sdConfDataMgr.Instance().GetPetQuilityBorder(sPet.m_iAbility);
            m_PetAdd.SetActive(false);
            if (sPet.m_iAbility >= 1)
            {
                m_PetStar1.SetActive(true);
            }
            else
            {
                m_PetStar1.SetActive(false);
            }
            if (sPet.m_iAbility >= 2)
            {
                m_PetStar2.SetActive(true);
            }
            else
            {
                m_PetStar2.SetActive(false);
            }
            if (sPet.m_iAbility >= 3)
            {
                m_PetStar3.SetActive(true);
            }
            else
            {
                m_PetStar3.SetActive(false);
            }
            if (sPet.m_iAbility >= 4)
            {
                m_PetStar4.SetActive(true);
            }
            else
            {
                m_PetStar4.SetActive(false);
            }
            if (sPet.m_iAbility >= 5)
            {
                m_PetStar5.SetActive(true);
            }
            else
            {
                m_PetStar5.SetActive(false);
            }
            if (sPet.m_iAbility == 2 || sPet.m_iAbility == 4)
            {
                m_PetStar1.transform.localPosition = new Vector3(15.0f, m_PetStar1.transform.localPosition.y, 0);
            }
            else
            {
                m_PetStar1.transform.localPosition = new Vector3(0, m_PetStar1.transform.localPosition.y, 0);
            }
        }
        else
        {
            m_PetIcon.spriteName  = "";
            m_PetFrame.spriteName = "";
            m_PetAdd.SetActive(true);
            m_PetStar1.SetActive(false);
            m_LockMask.SetActive(false);
        }
    }
예제 #28
0
    public void ReflashExpLineUI()
    {
        SClientPetInfo Info = null;

        if (m_uuDBID != UInt64.MaxValue)
        {
            Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
            if (Info == null)
            {
                return;
            }
        }
        else
        {
            if (m_iPetTemplateID > 0)
            {
                Info = sdNewPetMgr.Instance.GetPetInfoByTemplateID(m_iPetTemplateID, m_iPetUp, m_iPetLevel);
                if (Info == null)
                {
                    return;
                }
            }
            else
            {
                return;
            }
        }

        if (m_lbLevel)
        {
            m_lbLevel.GetComponent <UILabel>().text = "Lv." + Info.m_iLevel.ToString();
        }

        UInt64 myExp        = Info.m_uuExperience;
        int    iAbility     = Info.m_iAbility;
        int    iLevel       = Info.m_iLevel;
        UInt64 uuLevelUPExp = sdNewPetMgr.Instance.GetPetCurLevelNeedExp(Info.m_uiTemplateID, iAbility, iLevel);

        float fValue = 1.0f;

        if (uuLevelUPExp > 0)
        {
            fValue = (float)myExp / (float)uuLevelUPExp;
        }
        if (fValue > 1.0f)
        {
            fValue = 1.0f;
        }

        if (m_expBar != null)
        {
            m_expBar.GetComponent <UISlider>().value = fValue;
        }

        if (m_lbExp)
        {
            fValue = fValue * 100.0f;
            int iValue = (int)fValue;
            m_lbExp.GetComponent <UILabel>().text = iValue.ToString() + "%";
        }
    }
예제 #29
0
    public void ReflashPetIconUI(UInt64 uuID)
    {
        if (uuID == UInt64.MaxValue)
        {
            m_uuDBID = UInt64.MaxValue;
            gameObject.SetActive(false);
            m_iBz     = 0;
            m_bSelect = false;
            return;
        }
        else if (uuID == 0)
        {
            m_uuDBID = 0;
            gameObject.SetActive(true);
            m_iBz     = 0;
            m_bSelect = false;

            if (bg)
            {
                bg.SetActive(true);
            }

            if (bgColor)
            {
                bgColor.SetActive(false);
            }

            return;
        }

        m_uuDBID = uuID;
        gameObject.SetActive(true);

        if (bg)
        {
            bg.SetActive(false);
        }

        if (bgColor)
        {
            bgColor.SetActive(true);
        }

        SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);

        if (Info == null)
        {
            return;
        }

        if (icon)
        {
            icon.GetComponent <UISprite>().spriteName = Info.m_strIcon;
        }

        if (txtLevel)
        {
            txtLevel.GetComponent <UILabel>().text = Info.m_iLevel.ToString();
        }

        if (type)
        {
            if (Info.m_iBaseJob == 1)
            {
                type.GetComponent <UISprite>().spriteName = "IPzs";
                type.SetActive(true);
            }
            else if (Info.m_iBaseJob == 2)
            {
                type.GetComponent <UISprite>().spriteName = "IPfs";
                type.SetActive(true);
            }
            else if (Info.m_iBaseJob == 3)
            {
                type.GetComponent <UISprite>().spriteName = "IPyx";
                type.SetActive(true);
            }
            else if (Info.m_iBaseJob == 4)
            {
                type.GetComponent <UISprite>().spriteName = "IPms";
                type.SetActive(true);
            }
            else
            {
                type.SetActive(false);
            }
        }

        if (bz)
        {
            m_iBz = sdNewPetMgr.Instance.GetIsInBattleTeam(m_uuDBID);
            if (m_iBz == 1)
            {
                bz.GetComponent <UISprite>().spriteName = "cz";
                bz.SetActive(true);
            }
            else if (m_iBz == 2)
            {
                bz.GetComponent <UISprite>().spriteName = "zz";
                bz.SetActive(true);
            }
            else
            {
                bz.SetActive(false);
            }
        }

        if (plock)
        {
            if (Info.m_Lock == 1)
            {
                plock.SetActive(true);
            }
            else
            {
                plock.SetActive(false);
            }
        }

        m_bSelect = false;
        ReflashSelectUI();
        SetPetStar(Info.m_iAbility);

        if (txtName)
        {
            sdNewPetMgr.SetLabelColorByAbility(Info.m_iAbility, txtName);
            txtName.GetComponent <UILabel>().text = Info.m_strName;
        }

        if (up)
        {
            if (Info.m_iUp == 1)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a1";
                up.SetActive(true);
            }
            else if (Info.m_iUp == 2)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a2";
                up.SetActive(true);
            }
            else if (Info.m_iUp == 3)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a3";
                up.SetActive(true);
            }
            else if (Info.m_iUp == 4)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a4";
                up.SetActive(true);
            }
            else if (Info.m_iUp == 5)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a5";
                up.SetActive(true);
            }
            else
            {
                up.SetActive(false);
            }
        }
    }
예제 #30
0
    public void ReflashPetIconUI(UInt64 uuID)
    {
        if (uuID == UInt64.MaxValue)
        {
            m_uuDBID = 0;
            gameObject.SetActive(true);

            if (iOpenLevel > 0)
            {
                int iLevel = int.Parse(sdGameLevel.instance.mainChar.Property["Level"].ToString());
                if (iLevel >= iOpenLevel)
                {
                    if (bg)
                    {
                        bg.SetActive(true);
                    }

                    if (openLevel)
                    {
                        openLevel.SetActive(false);
                    }

                    if (add)
                    {
                        add.SetActive(true);
                    }

                    if (bgColor)
                    {
                        bgColor.SetActive(false);
                    }
                }
                else
                {
                    if (bg)
                    {
                        bg.SetActive(true);
                    }

                    if (openLevel)
                    {
                        openLevel.SetActive(true);
                    }

                    if (add)
                    {
                        add.SetActive(false);
                    }

                    if (bgColor)
                    {
                        bgColor.SetActive(false);
                    }
                }
            }
            else
            {
                if (bg)
                {
                    bg.SetActive(true);
                }

                if (openLevel)
                {
                    openLevel.SetActive(false);
                }

                if (add)
                {
                    add.SetActive(true);
                }

                if (bgColor)
                {
                    bgColor.SetActive(false);
                }
            }

            return;
        }

        m_uuDBID = uuID;
        gameObject.SetActive(true);

        if (bg)
        {
            bg.SetActive(false);
        }

        if (openLevel)
        {
            openLevel.SetActive(false);
        }

        if (add)
        {
            add.SetActive(false);
        }

        if (bgColor)
        {
            bgColor.SetActive(true);
        }

        SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);

        if (Info == null)
        {
            return;
        }

        if (icon)
        {
            icon.GetComponent <UISprite>().spriteName = Info.m_strIcon;
        }

        if (txtLevel)
        {
            txtLevel.GetComponent <UILabel>().text = Info.m_iLevel.ToString();
        }

        if (type)
        {
            if (Info.m_iBaseJob == 1)
            {
                type.GetComponent <UISprite>().spriteName = "IPzs";
                type.SetActive(true);
            }
            else if (Info.m_iBaseJob == 2)
            {
                type.GetComponent <UISprite>().spriteName = "IPfs";
                type.SetActive(true);
            }
            else if (Info.m_iBaseJob == 3)
            {
                type.GetComponent <UISprite>().spriteName = "IPyx";
                type.SetActive(true);
            }
            else if (Info.m_iBaseJob == 4)
            {
                type.GetComponent <UISprite>().spriteName = "IPms";
                type.SetActive(true);
            }
            else
            {
                type.SetActive(false);
            }
        }

        SetPetStar(Info.m_iAbility);

        if (txtName)
        {
            sdNewPetMgr.SetLabelColorByAbility(Info.m_iAbility, txtName);
            txtName.GetComponent <UILabel>().text = Info.m_strName;
        }

        if (up)
        {
            if (Info.m_iUp == 1)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a1";
                up.SetActive(true);
            }
            else if (Info.m_iUp == 2)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a2";
                up.SetActive(true);
            }
            else if (Info.m_iUp == 3)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a3";
                up.SetActive(true);
            }
            else if (Info.m_iUp == 4)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a4";
                up.SetActive(true);
            }
            else if (Info.m_iUp == 5)
            {
                up.GetComponent <UISprite>().spriteName = "pet_a5";
                up.SetActive(true);
            }
            else
            {
                up.SetActive(false);
            }
        }
    }