Esempio n. 1
0
        /// <summary>
        /// 刷新角色
        /// </summary>
        public void RefreshSelectedRolesView()
        {
            int totalHP = 0;

            for (int i = 0; i < selectedIcons.Count; i++)
            {
                if (selectedRolesData.Count > i)
                {
                    selectedIcons[i].gameObject.SetActive(true);
                    selectedIcons[i].sprite = Statics.GetIconSprite(selectedRolesData[i].IconId);
                    totalHP += selectedRolesData[i].MaxHP;
                }
                else
                {
                    selectedIcons[i].gameObject.SetActive(false);
                }
            }
            totalText.text = string.Format("总气血:{0}  干粮:{1}/{2}  可出战侠客数:{3}", totalHP, foodData.Num, foodData.MaxNum, userData.MaxRoleNum);
            for (int i = 1; i < rolesData.Count; i++)
            {
                roleContainers[i - 1].EnableSelectBtn(selectedRolesData.Count < userData.MaxRoleNum);
            }
            for (int i = 0, len = seatCovers.Count; i < len; i++)
            {
                seatCovers[i].gameObject.SetActive(i >= userData.MaxRoleNum);
            }
        }
Esempio n. 2
0
 public void RefreshView()
 {
     Icon.sprite    = Statics.GetIconSprite(itemData.IconId);
     NameText.text  = string.Format("<color=\"#1ABDE6\">{0}</color>", itemData.Name);
     PriceText.text = itemData.BuyPrice.ToString();
     TypeText.text  = string.Format("类型:{0}", Statics.GetItemTypeName(itemData.Type));
 }
Esempio n. 3
0
 public override void RefreshView()
 {
     foodIcon.sprite = Statics.GetIconSprite(foodIcondId);
     refreshFoodProcess(false);
     areaNameText.text = areaName;
     RefreshDifficultyView();
 }
Esempio n. 4
0
        public void RefreshView()
        {
            Icon.sprite = Statics.GetIconSprite(bookData.IconId);
            Name.text   = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(bookData.Quality), bookData.Name);
            Image iconImage;

            for (int i = 0; i < SkillIcons.Length; i++)
            {
                iconImage = SkillIcons[i];
                if (bookData.Skills.Count > i)
                {
                    iconImage.gameObject.SetActive(true);
                    iconImage.sprite = Statics.GetIconSprite(bookData.Skills[i].IconId);
                }
                else
                {
                    iconImage.gameObject.SetActive(false);
                }
            }
            DescText.gameObject.SetActive(bookData.Skills.Count == 0);
            if (bookData.BeUsingByRoleId != "")
            {
                UseBtn.gameObject.SetActive(false);
                UnuseBtn.gameObject.SetActive(true);
                bg.sprite = Statics.GetSprite("Border12");
            }
            else
            {
                UseBtn.gameObject.SetActive(true);
                UnuseBtn.gameObject.SetActive(false);
                bg.sprite = Statics.GetSprite("Border11");
            }
        }
Esempio n. 5
0
 public void RefreshView()
 {
     Name.text   = npcData.Name;
     icon.sprite = Statics.GetIconSprite(npcData.IconId);
     FightFlagImage.gameObject.SetActive(npcData.Type == NpcType.Fight);
     if (npcData.Id == "05002001")
     {
         State.DOKill();
         if (DbManager.Instance.HostData.Occupation == OccupationType.None)
         {
             State.gameObject.SetActive(true);
             if (!DbManager.Instance.HasAnyTask((new List <string>()
             {
                 "task_occupation0",
                 "task_occupation1",
                 "task_occupation2",
                 "task_occupation3",
                 "task_occupation4",
                 "task_occupation5"
             }).ToArray()))
             {
                 State.sprite = Statics.GetSprite("TaskState1");
                 State.DOFade(0.5f, 0.5f).SetLoops(-1, LoopType.Yoyo);
             }
             else
             {
                 State.sprite = Statics.GetSprite("TaskState2");
             }
         }
         else
         {
             State.gameObject.SetActive(false);
         }
     }
 }
Esempio n. 6
0
 public void RefreshView()
 {
     Icon.sprite   = Statics.GetIconSprite(itemData.IconId);
     NameText.text = string.Format("<color=\"#1ABDE6\">{0}</color>", itemData.Name);
     TypeText.text = string.Format("类型:{0}", Statics.GetItemTypeName(itemData.Type));
     NumText.text  = string.Format("数量:{0}/{1}", itemData.Num, itemData.MaxNum);
 }
Esempio n. 7
0
        public override void RefreshView()
        {
            RoleData roleData;
            Image    icon;

            for (int i = 0; i < icons.Count; i++)
            {
                icon = icons[i];
                if (roleDataList.Count > i)
                {
                    icon.gameObject.SetActive(true);
                    roleData    = roleDataList[i];
                    icon.sprite = Statics.GetIconSprite(roleData.IconId);
                    icon.color  = roleData.IsDie ? Color.red : Color.white;
                    if (roleData.Injury != InjuryType.None)
                    {
                        injuryImages[i].gameObject.SetActive(true);
                        injuryImages[i].color = Statics.GetInjuryColor(roleData.Injury);
                    }
                    else
                    {
                        injuryImages[i].gameObject.SetActive(false);
                    }
                }
                else
                {
                    icon.gameObject.SetActive(false);
                    injuryImages[i].gameObject.SetActive(false);
                }
            }
            RefreshRedPoint();
        }
Esempio n. 8
0
        public void RefreshView() {
            IconImage.sprite = Statics.GetIconSprite(secretData.IconId);
            FlashImage.gameObject.SetActive(((int)secretData.Quality) >= ((int)QualityType.FlashGold));
            NameText.text = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(secretData.Quality), secretData.Name);

            DescText.text = secretData.GetDesc();
            StudyBtn.gameObject.SetActive(string.IsNullOrEmpty(secretData.BelongToBookId));
            ForgetBtn.gameObject.SetActive(!string.IsNullOrEmpty(secretData.BelongToBookId));
        }
 public void RefreshView()
 {
     Icon.sprite = Statics.GetIconSprite(bookData.IconId);
     Name.text   = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(bookData.Quality), bookData.Name);
     Flag.gameObject.SetActive(bookData.State == BookStateType.Read);
     MakeButtonEnable(MakeBtn, bookData.State == BookStateType.Unread);
     //判断是否为新增秘籍,控制新增标记显示隐藏
     NewFlag.gameObject.SetActive(string.IsNullOrEmpty(PlayerPrefs.GetString(PlayerPrefs.GetString("CurrentRoleId") + "_" + "BookIdOfCurrentForbiddenAreaNewFlagIsHide_" + bookData.Id)));
 }
Esempio n. 10
0
 public void RefreshView()
 {
     Icon.sprite = Statics.GetIconSprite(roleData.IconId);
     if (roleData.State == RoleStateType.InTeam)
     {
         bg.sprite = Statics.GetSprite("Border12");
     }
     else
     {
         bg.sprite = Statics.GetSprite("Border11");
     }
     Desc.text = string.Format("称谓:{0}\n门派:{1}\n地位:{2}\n状态:{3}", roleData.Name, Statics.GetOccupationName(roleData.Occupation), roleData.IsHost ? "当家" : "门客", Statics.GetInjuryName(roleData.Injury));
     if (roleData.Weapon != null)
     {
         WeaponNameText.text = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(roleData.Weapon.Quality), roleData.Weapon.Name);
         WeaponWidth.rectTransform.sizeDelta = new Vector2(100f * (roleData.Weapon.Width / 100f) * 0.5f, WeaponWidth.rectTransform.sizeDelta.y);
         WeaponIcon.gameObject.SetActive(true);
         WeaponIcon.sprite = Statics.GetIconSprite(roleData.Weapon.IconId);
         WeaponFlashImage.gameObject.SetActive(((int)roleData.Weapon.Quality) >= ((int)QualityType.FlashGold));
     }
     else
     {
         WeaponNameText.text = "赤手空拳";
         WeaponIcon.gameObject.SetActive(false);
         WeaponFlashImage.gameObject.SetActive(false);
     }
     for (int i = 0; i < 3; i++)
     {
         if (roleData.Books.Count > i)
         {
             BookIcons[i].gameObject.SetActive(true);
             BookIcons[i].sprite = Statics.GetIconSprite(roleData.Books[i].IconId);
             BookFlashImages[i].gameObject.SetActive(((int)roleData.Books[i].Quality) >= ((int)QualityType.FlashGold));
         }
         else
         {
             BookIcons[i].gameObject.SetActive(false);
             BookFlashImages[i].gameObject.SetActive(false);
         }
     }
     if (roleData.IsHost)
     {
         SelectBtn.gameObject.SetActive(false);
         CancelBtn.gameObject.SetActive(false);
     }
     else
     {
         SelectBtn.gameObject.SetActive(roleData.State == RoleStateType.OutTeam);
         CancelBtn.gameObject.SetActive(roleData.State == RoleStateType.InTeam);
         if (roleData.Injury == InjuryType.Moribund)
         {
             MakeButtonEnable(SelectBtn, false);
             MakeButtonEnable(CancelBtn, false);
         }
     }
 }
Esempio n. 11
0
        public void RefreshView()
        {
            Icon.sprite = Statics.GetIconSprite(roleData.IconId);
            Name.text   = roleData.Name;
            Flag.gameObject.SetActive(roleData.State != RoleStateType.NotRecruited);
//			MakeBtn.gameObject.SetActive(roleData.State == RoleStateType.NotRecruited);
            MakeButtonEnable(MakeBtn, roleData.State == RoleStateType.NotRecruited);
            //判断是否为新增侠客,控制新增标记显示隐藏
            NewFlag.gameObject.SetActive(string.IsNullOrEmpty(PlayerPrefs.GetString(PlayerPrefs.GetString("CurrentRoleId") + "_" + "RoleOfWinShopNewFlagIsHide_" + roleData.Id)));
        }
Esempio n. 12
0
 /// <summary>
 /// 设置Icon图标
 /// </summary>
 /// <param name="ids">Identifiers.</param>
 public void SetIconIds(List <string> ids)
 {
     skillIconIds = ids;
     for (int i = 0; i < SkillIconImages.Length; i++)
     {
         if (skillIconIds.Count > i && skillIconIds[i] != null)
         {
             SkillIconImages[i].sprite = Statics.GetIconSprite(skillIconIds[i]);
         }
     }
 }
Esempio n. 13
0
 public void RefreshView()
 {
     Icon.sprite = Statics.GetIconSprite(roleData.IconId);
     Name.text   = roleData.Name;
     InjuryImage.gameObject.SetActive(roleData.Injury != InjuryType.None);
     CureBtn.gameObject.SetActive(roleData.Injury != InjuryType.None);
     if (roleData.Injury != InjuryType.None)
     {
         InjuryImage.color = Statics.GetInjuryColor(roleData.Injury);
     }
 }
Esempio n. 14
0
 public override void RefreshView()
 {
     DrugIconImage.sprite = Statics.GetIconSprite(drugData.IconId);
     if (drugData.Num > 0)
     {
         MakeImageDefault(DrugIconImage);
     }
     else
     {
         MakeImageGrey(DrugIconImage);
     }
     CountText.text = drugData.Num > 1 ? drugData.Num.ToString() : "";
 }
Esempio n. 15
0
 public override void RefreshView()
 {
     if (bookData != null)
     {
         BookNameText.text = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(bookData.Quality), bookData.Name);
         BookIconImage.transform.parent.gameObject.SetActive(true);
         BookIconImage.sprite = Statics.GetIconSprite(bookData.IconId);
     }
     else
     {
         BookNameText.text = "无";
         BookIconImage.transform.parent.gameObject.SetActive(false);
     }
 }
Esempio n. 16
0
        void updateRoles(int index)
        {
            if (index < 0 || index >= roleDataList.Count)
            {
                return;
            }
            //处理头像
            RoleData currentRole = roleDataList[index];

            roleDataList[index] = roleDataList[0];
            roleDataList[0]     = currentRole;

            //处理书
            RoleData fightingRole = roleDataList[0];
            Image    book;
            Button   bookBtn;
            BookData bookData;

            for (int i = 0; i < books.Count; i++)
            {
                book = books[i];
                if (fightingRole.Books != null && fightingRole.Books.Count > i)
                {
                    bookData = fightingRole.Books[i];
                    book.gameObject.SetActive(true);
                    book.sprite = Statics.GetIconSprite(bookData.IconId);
                    bookBtn     = bookBtns[i];
                    if (currentRole.SelectedBookIndex == i)
                    {
//						ChangeButtonColorToDefault(bookBtn);
                        book.color = new Color(1, 1, 1);
                        book.transform.localScale = Vector3.one;
                    }
                    else
                    {
//						ChangeButtonColor(bookBtn, new Color(0.8f, 0.8f, 0.2f, 1));
                        book.color = new Color(0.3f, 0.3f, 0.3f);
                        book.transform.localScale = new Vector3(0.7f, 0.7f, 0.7f);
                    }

                    mindBookMasks[i].gameObject.SetActive(bookData.IsMindBook);
                }
                else
                {
                    book.gameObject.SetActive(false);
                    mindBookMasks[i].gameObject.SetActive(false);
                }
            }
        }
Esempio n. 17
0
        public override void RefreshView()
        {
            icon.sprite   = Statics.GetIconSprite(itemData.IconId);
            nameText.text = string.Format("<color=\"#1ABDE6\">{0}</color>", itemData.Name);
            typeText.text = string.Format("类型:{0}", Statics.GetItemTypeName(itemData.Type));
            lvText.text   = string.Format("等级:{0}级", itemData.Lv);
            numText.text  = string.Format("数量:{0}/{1}", itemData.Num, itemData.MaxNum);
            if (itemData.SellPrice >= 0)
            {
                sellFlagText.text = "回收:";
                silverImage.gameObject.SetActive(true);
                sellPriceText.text = itemData.SellPrice.ToString();
            }
            else
            {
                sellFlagText.text = "<color=\"#FF0000\">不可回收</color>";
                silverImage.gameObject.SetActive(false);
            }
            discardFlagText.text       = itemData.CanDiscard ? "<color=\"#00FF00\">可以丢弃</color>" : "<color=\"#FF0000\">不可丢弃</color>";
            bg.rectTransform.sizeDelta = new Vector2(bg.rectTransform.sizeDelta.x, 600);
            destroyBtn.gameObject.SetActive(false);
            useBtn.gameObject.SetActive(false);
            if (_fromBag && itemData.CanDiscard)
            {
                bg.rectTransform.sizeDelta = new Vector2(bg.rectTransform.sizeDelta.x, 600);
                destroyBtn.gameObject.SetActive(true);
            }
            switch (itemData.Type)
            {
            case ItemType.Food:     //干粮可以直接吃补充区域大地图体力
                bg.rectTransform.sizeDelta = new Vector2(bg.rectTransform.sizeDelta.x, 600);
                useBtn.gameObject.SetActive(_fromBag);
                useBtn.GetComponentInChildren <Text>().text = "吃";
                break;

            case ItemType.Weapon:
            case ItemType.Book:
            case ItemType.RandomSecre:
                bg.rectTransform.sizeDelta = new Vector2(bg.rectTransform.sizeDelta.x, 600);
                useBtn.gameObject.SetActive(true);
                useBtn.GetComponentInChildren <Text>().text = "打开";
                break;

            default:
                break;
            }
            descText.text = string.Format("描述\n{0}", itemData.Desc);
        }
Esempio n. 18
0
 public override void RefreshView()
 {
     iconImage.sprite            = Statics.GetIconSprite(fromRoleData.IconId);
     hpFromText.text             = fromRoleData.MaxHP.ToString();
     hpToText.text               = toRoleData.MaxHP.ToString();
     physicsAttackFromText.text  = fromRoleData.PhysicsAttack.ToString();
     physicsAttackToText.text    = toRoleData.PhysicsAttack.ToString();
     physicsDefenseFromText.text = fromRoleData.PhysicsDefense.ToString();
     physicsDefenseToText.text   = toRoleData.PhysicsDefense.ToString();
     magicAttackFromText.text    = fromRoleData.MagicAttack.ToString();
     magicAttackToText.text      = toRoleData.MagicAttack.ToString();
     magicDefenseFromText.text   = fromRoleData.MagicDefense.ToString();
     magicDefenseToText.text     = toRoleData.MagicDefense.ToString();
     dodgeFromText.text          = fromRoleData.Dodge.ToString();
     dodgeToText.text            = toRoleData.Dodge.ToString();
 }
Esempio n. 19
0
 public override void RefreshView()
 {
     icon.sprite   = Statics.GetIconSprite(weaponData.IconId);
     nameText.text = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(weaponData.Quality), weaponData.Name);
     weaponWidthScript.UpdateData(weaponData);
     weaponWidthScript.RefreshView();
     infoText.text = info;
     if (weaponData.BelongToRoleId == "")
     {
         occupationText.text = string.Format("门派限制:{0}", weaponData.Occupation != OccupationType.None ? Statics.GetOccupationName(weaponData.Occupation) : "无限制");
     }
     else
     {
         occupationText.text = string.Format("仅限 {0} 使用", JsonManager.GetInstance().GetMapping <RoleData>("RoleDatas", weaponData.BelongToRoleId).Name);
     }
 }
Esempio n. 20
0
        void refreshEnemy()
        {
            RoleData enemy = BattleLogic.Instance.CurrentEnemyRole;

            enemyBody.sprite = Statics.GetHalfBodySprite(enemy.HalfBodyId);
            enemyBody.SetNativeSize();
            refreshEnemyBlood();
            enemyNameText.text = enemy.Name;
            if (enemy.GetCurrentBook() != null)
            {
                enemyBookIconImage.transform.parent.gameObject.SetActive(true);
                enemyBookIconImage.sprite = Statics.GetIconSprite(enemy.GetCurrentBook().IconId);
                enemyBookIconImage.SetNativeSize();
            }
            else
            {
                enemyBookIconImage.transform.parent.gameObject.SetActive(false);
            }
        }
Esempio n. 21
0
 public override void RefreshView()
 {
     if (roleData.Weapon != null)
     {
         weaponIconImage.gameObject.SetActive(true);
         weaponIconImage.sprite = Statics.GetIconSprite(roleData.Weapon.IconId);
     }
     else
     {
         weaponIconImage.gameObject.SetActive(false);
     }
     if (roleData.Books.Count > 0)
     {
         bookIconImage0.gameObject.SetActive(true);
         bookIconImage0.sprite = Statics.GetIconSprite(roleData.Books[0].IconId);
     }
     else
     {
         bookIconImage0.gameObject.SetActive(false);
     }
     if (roleData.Books.Count > 1)
     {
         bookIconImage1.gameObject.SetActive(true);
         bookIconImage1.sprite = Statics.GetIconSprite(roleData.Books[1].IconId);
     }
     else
     {
         bookIconImage1.gameObject.SetActive(false);
     }
     if (roleData.Books.Count > 2)
     {
         bookIconImage2.gameObject.SetActive(true);
         bookIconImage2.sprite = Statics.GetIconSprite(roleData.Books[2].IconId);
     }
     else
     {
         bookIconImage2.gameObject.SetActive(false);
     }
     roleIconImage.sprite = Statics.GetIconSprite(roleData.IconId);
     descText.text        = desc;
     infoText.text        = info;
 }
Esempio n. 22
0
        public override void RefreshView()
        {
            icon.sprite = Statics.GetIconSprite(weaponData.IconId);
            flashImage.gameObject.SetActive(((int)weaponData.Quality) >= ((int)QualityType.FlashGold));
            nameText.text = string.Format("<color=\"{0}\">{1}</color> {2}", Statics.GetQualityColorString(weaponData.Quality), weaponData.Name, weaponLVData.LV > 0 ? ("+" + weaponLVData.LV) : "");
//			weaponWidthScript.UpdateData(weaponData);
//			weaponWidthScript.RefreshView();
            infoText.text = info;
            if (weaponData.BelongToRoleId == "")
            {
                occupationText.text = string.Format("门派限制:{0}", weaponData.Occupation != OccupationType.None ? Statics.GetOccupationName(weaponData.Occupation) : "无限制");
            }
            else
            {
                occupationText.text = string.Format("仅限 {0} 使用", JsonManager.GetInstance().GetMapping <RoleData>("RoleDatas", weaponData.BelongToRoleId).Name);
            }
            lvFullNoticeText.gameObject.SetActive(weaponData.Quality >= QualityType.FlashGold && weaponLVData.LV >= weaponLVData.MaxLV);
            lvUpgradeBtn.gameObject.SetActive(weaponData.Quality >= QualityType.FlashGold && weaponLVData.LV < weaponLVData.MaxLV);
            StartCoroutine(refreshHeight());
        }
        public void RefreshView()
        {
            if (weaponData == null)
            {
                return;
            }
            Icon.sprite = Statics.GetIconSprite(weaponData.IconId);
            Name.text   = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(weaponData.Quality), weaponData.Name);
            string       costStr = "";
            ResourceData need;

            for (int i = 0; i < weaponData.Needs.Count; i++)
            {
                need     = weaponData.Needs[i];
                costStr += string.Format("{0}-{1}\n", Statics.GetResourceName(need.Type), need.Num);
            }
            Cost.text = costStr;
            //判断是否为新增兵器,控制新增标记显示隐藏
            NewFlag.gameObject.SetActive(string.IsNullOrEmpty(PlayerPrefs.GetString(PlayerPrefs.GetString("CurrentRoleId") + "_" + "WeaponIdOfWorkShopNewFlagIsHide_" + weaponData.Id)));
        }
Esempio n. 24
0
 public override void RefreshView()
 {
     if (rolesData.Count > 0)
     {
         hostRoleContainer.UpdateData(rolesData[0]);
         hostRoleContainer.RefreshView();
         if (prefabObj == null)
         {
             prefabObj = Statics.GetPrefab("Prefabs/UI/GridItems/ReadyToTraveRoleContainer");
         }
         GameObject itemPrefab;
         RoleData   role;
         ReadyToTraveRoleContainer container;
         for (int i = 1; i < rolesData.Count; i++)
         {
             role = rolesData[i];
             if (roleContainers.Count <= (i - 1))
             {
                 itemPrefab = Statics.GetPrefabClone(prefabObj);
                 MakeToParent(grid.transform, itemPrefab.transform);
                 container = itemPrefab.GetComponent <ReadyToTraveRoleContainer>();
                 roleContainers.Add(container);
             }
             else
             {
                 container = roleContainers[i - 1];
             }
             container.UpdateData(role);
             container.RefreshView();
         }
         RectTransform trans = grid.GetComponent <RectTransform>();
         float         y     = (grid.cellSize.y + grid.spacing.y) * roleContainers.Count - grid.spacing.y;
         y = y < 0 ? 0 : y;
         trans.sizeDelta = new Vector2(trans.sizeDelta.x, y);
     }
     foodIcon.sprite  = Statics.GetIconSprite("600000");
     foodNumText.text = string.Format("{0}/{1}", foodData.Num, foodData.MaxNum);
     RefreshSelectedRolesView();
 }
Esempio n. 25
0
        public override void RefreshView()
        {
            iconImage.sprite = Statics.GetIconSprite(bookData.IconId);
            nameText.text    = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(bookData.Quality), bookData.Name);
            descText.text    = string.Format("{0}{1}描述:\n{2}", bookData.LimitWeaponType != WeaponType.None ? string.Format("兵器限制:{0}\n", Statics.GetEnmuDesc <WeaponType>(bookData.LimitWeaponType)) : "", info != "" ? string.Format("附加属性:\n<color=\"#00FF00\">{0}</color>", info) : "", bookData.Desc);

            if (prefabObj == null)
            {
                prefabObj = Statics.GetPrefab("Prefabs/UI/GridItems/SkillItemContainer");
            }
            if (bookData.Skills.Count > 0)
            {
                emptyImage.gameObject.SetActive(false);
                SkillData          skill;
                GameObject         itemPrefab;
                SkillItemContainer container;
                for (int i = 0; i < bookData.Skills.Count; i++)
                {
                    skill = bookData.Skills[i];
                    if (containers.Count <= i)
                    {
                        itemPrefab = Statics.GetPrefabClone(prefabObj);
                        MakeToParent(gridTrans.transform, itemPrefab.transform);
                        container = itemPrefab.GetComponent <SkillItemContainer>();
                        containers.Add(container);
                    }
                    else
                    {
                        container = containers[i];
                    }
                    container.UpdateData(skill, i != bookData.Skills.Count - 1);
                    container.RefreshView();
                }
            }
            else
            {
                emptyImage.gameObject.SetActive(true);
            }
        }
Esempio n. 26
0
        public void RefreshView()
        {
            if (weaponData == null)
            {
                return;
            }
            BreakBtn.gameObject.SetActive(weaponData.BeUsingByRoleId == "");
            Icon.sprite = Statics.GetIconSprite(weaponData.IconId);
            Name.text   = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(weaponData.Quality), weaponData.Name);
            string       gotStr = "";
            ResourceData need;

            for (int i = 0; i < weaponData.Needs.Count; i++)
            {
                need = weaponData.Needs[i];
                if (need.Num > 0)
                {
                    gotStr += string.Format("{0}+{1}\n", Statics.GetResourceName(need.Type), need.Num);
                }
            }
            gotStr   = gotStr == "" ? "无" : gotStr;
            Got.text = gotStr;
        }
Esempio n. 27
0
 public void RefreshView()
 {
     Name.text   = npcData.Name;
     icon.sprite = Statics.GetIconSprite(npcData.IconId);
     FightFlagImage.gameObject.SetActive(npcData.Type == NpcType.Fight);
 }
Esempio n. 28
0
 public void RefreshView()
 {
     IconImage.sprite = Statics.GetIconSprite(dropData.Item.IconId);
     NameText.text    = string.Format("<color=\"#1ABDE6\">{0}</color>", dropData.Item.Name);
     NumText.text     = string.Format("<color=\"#00FF00\">+ {0}</color>", dropData.Item.Num);
 }
Esempio n. 29
0
        public void RefreshView()
        {
            Icon.sprite = Statics.GetIconSprite(bookData.IconId);
            FlashImage.gameObject.SetActive(((int)bookData.Quality) >= ((int)QualityType.FlashGold));
            Name.text = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(bookData.Quality), bookData.Name);
            TitleText.gameObject.SetActive(bookData.IsLostKnowledge);
//			Image iconImage;
//			for (int i = 0; i < SkillIcons.Length; i++) {
//				iconImage = SkillIcons[i];
//				if (bookData.Skills.Count > i) {
//					iconImage.gameObject.SetActive(true);
//					iconImage.sprite = Statics.GetIconSprite(bookData.Skills[i].IconId);
//				}
//				else {
//					iconImage.gameObject.SetActive(false);
//				}
//			}
//			DescText.gameObject.SetActive(bookData.Skills.Count == 0);
            string attrsStr = "";

            if (bookData.MagicAttackPlus > 0)
            {
                attrsStr += string.Format("内功+{0} ", bookData.MagicAttackPlus);
            }
            if (bookData.MagicDefensePlus > 0)
            {
                attrsStr += string.Format("内防+{0} ", bookData.MagicDefensePlus);
            }
            if (bookData.PhysicsDefensePlus > 0)
            {
                attrsStr += string.Format("外防+{0} ", bookData.PhysicsDefensePlus);
            }
            if (bookData.DodgePlus > 0)
            {
                attrsStr += string.Format("轻功+{0} ", bookData.DodgePlus);
            }
            if (bookData.HurtCutRatePlus > 0)
            {
                attrsStr += string.Format("伤害减免{0}% ", (int)(bookData.HurtCutRatePlus * 100 + 0.5f));
            }
            if (bookData.MaxHPPlus > 0)
            {
                attrsStr += string.Format("气血+{0} ", bookData.MaxHPPlus);
            }
            if (bookData.CanNotMoveResistance > 0)
            {
                attrsStr += string.Format("抗定身+{0} ", bookData.CanNotMoveResistance);
            }
            if (bookData.ChaosResistance > 0)
            {
                attrsStr += string.Format("抗混乱+{0} ", bookData.ChaosResistance);
            }
            if (bookData.DisarmResistance > 0)
            {
                attrsStr += string.Format("抗缴械+{0} ", bookData.DisarmResistance);
            }
            if (bookData.DrugResistance > 0)
            {
                attrsStr += string.Format("抗毒+{0} ", bookData.DrugResistance);
            }
            if (bookData.SlowResistance > 0)
            {
                attrsStr += string.Format("抗迟缓+{0} ", bookData.SlowResistance);
            }
            if (bookData.VertigoResistance > 0)
            {
                attrsStr += string.Format("抗眩晕+{0} ", bookData.VertigoResistance);
            }
            DescText.text = string.Format("{0}", bookData.GetCurrentSkill() != null ? bookData.GetCurrentSkill().Desc.Replace(" ", "") : "<color=\"#00FFFF\">内功心法</color>\n(可以与秘籍同时装备)");
            if (bookData.BeUsingByRoleId != "")
            {
                UseBtn.gameObject.SetActive(false);
                UnuseBtn.gameObject.SetActive(true);
                bg.sprite = Statics.GetSprite("Border12");
            }
            else
            {
                UseBtn.gameObject.SetActive(true);
                UnuseBtn.gameObject.SetActive(false);
                bg.sprite = Statics.GetSprite("Border11");
            }
        }
Esempio n. 30
0
        public void RefreshView()
        {
            Icon.sprite = Statics.GetIconSprite(weaponData.IconId);
            FlashImage.gameObject.SetActive(((int)weaponData.Quality) >= ((int)QualityType.FlashGold));
            Name.text = string.Format("<color=\"{0}\">{1}</color>", Statics.GetQualityColorString(weaponData.Quality), weaponData.Name);
//			WeaponWidth.rectTransform.sizeDelta = new Vector2(100f * (weaponData.Width / 100f), WeaponWidth.rectTransform.sizeDelta.y);
//			PowerIndexDesc0.text = string.Format("+100%伤害概率: {0}%", (int)(weaponData.Rates[1] * 100));
//			PowerIndexDesc1.text = string.Format("+50%伤害概率: {0}%", (int)(weaponData.Rates[2] * 100));
//			PowerIndexDesc2.text = string.Format("+25%伤害概率: {0}%", (int)(weaponData.Rates[3] * 100));
            if (weaponData.BeUsingByRoleId != "")
            {
                Btn.gameObject.SetActive(false);
                bg.sprite = Statics.GetSprite("Border12");
//				PowerIndexFlag0.gameObject.SetActive(false);
//				PowerIndexFlag1.gameObject.SetActive(false);
//				PowerIndexFlag2.gameObject.SetActive(false);
                State.text = "已装备";
                TakeOffBtn.gameObject.SetActive(true);
            }
            else
            {
                TakeOffBtn.gameObject.SetActive(false);
                if (weaponData.Occupation == OccupationType.None || weaponData.Occupation == hostRoleData.Occupation)
                {
                    Btn.gameObject.SetActive(true);
                    State.text = "已装备";
                }
                else
                {
                    Btn.gameObject.SetActive(false);
                    State.text = string.Format("<color=\"#FF0000\">限{0}</color>", Statics.GetOccupationName(weaponData.Occupation));
                }
//				if (hostWeaponData != null) {
//					if (weaponData.Rates[1] != hostWeaponData.Rates[1]) {
//						PowerIndexFlag0.gameObject.SetActive(true);
//						PowerIndexFlag0.sprite = Statics.GetSprite(weaponData.Rates[1] > hostWeaponData.Rates[1] ? "StateUp" : "StateDown");
//					}
//					else {
//						PowerIndexFlag0.gameObject.SetActive(false);
//					}
//
//					if (weaponData.Rates[2] != hostWeaponData.Rates[2]) {
//						PowerIndexFlag1.gameObject.SetActive(true);
//						PowerIndexFlag1.sprite = Statics.GetSprite(weaponData.Rates[2] > hostWeaponData.Rates[2] ? "StateUp" : "StateDown");
//					}
//					else {
//						PowerIndexFlag1.gameObject.SetActive(false);
//					}
//					if (weaponData.Rates[3] != hostWeaponData.Rates[3]) {
//						PowerIndexFlag2.gameObject.SetActive(true);
//						PowerIndexFlag2.sprite = Statics.GetSprite(weaponData.Rates[3] > hostWeaponData.Rates[3] ? "StateUp" : "StateDown");
//					}
//					else {
//						PowerIndexFlag2.gameObject.SetActive(false);
//					}
//				}
//				else {
//					PowerIndexFlag0.gameObject.SetActive(false);
//					PowerIndexFlag1.gameObject.SetActive(false);
//					PowerIndexFlag2.gameObject.SetActive(false);
//				}
            }

            OccupationText.text = weaponData.Occupation != OccupationType.None ? string.Format("门派:{0}", Statics.GetOccupationName(weaponData.Occupation)) : "";
            string info = "";

            if (weaponData.FixedDamagePlus != 0)
            {
                info += info == "" ? "" : "\n";
                info += string.Format("固定伤害:{0}", (weaponData.FixedDamagePlus > 0 ? "+" : "") + weaponData.FixedDamagePlus.ToString());
            }
            if (weaponData.DamageRatePlus != 0)
            {
                info += info == "" ? "" : "\n";
                info += string.Format("最终伤害:{0}%", (weaponData.DamageRatePlus > 0 ? "+" : "") + (weaponData.DamageRatePlus * 100).ToString());
            }
            if (weaponData.PhysicsAttackPlus != 0)
            {
                info += info == "" ? "" : "\n";
                info += string.Format("外功:{0}", (weaponData.PhysicsAttackPlus > 0 ? "+" : "") + weaponData.PhysicsAttackPlus.ToString());
            }
            DescText.text = info;
        }