Exemplo n.º 1
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);
         }
     }
 }
Exemplo n.º 2
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");
            }
        }
Exemplo n.º 3
0
        public void RefreshTaskView()
        {
            State.DOKill();
            switch (npcData.CurrentTask.State)
            {
            case TaskStateType.Accepted:
                State.gameObject.SetActive(true);
                State.sprite = Statics.GetSprite("TaskState2");
                break;

            case TaskStateType.CanAccept:
                State.gameObject.SetActive(true);
                State.sprite = Statics.GetSprite("TaskState1");
                State.DOFade(0.5f, 0.5f).SetLoops(-1, LoopType.Yoyo);
                break;

            case TaskStateType.CanNotAccept:
                State.gameObject.SetActive(true);
                State.sprite = Statics.GetSprite("TaskState0");
                break;

            case TaskStateType.Ready:
                State.gameObject.SetActive(true);
                State.sprite = Statics.GetSprite("TaskState3");
                break;

            default:
                State.gameObject.SetActive(false);
                break;
            }
        }
Exemplo n.º 4
0
        public void RefreshTaskView()
        {
            switch (npcData.CurrentTask.State)
            {
            case TaskStateType.Accepted:
                State.gameObject.SetActive(true);
                State.sprite = Statics.GetSprite("TaskState2");
                break;

            case TaskStateType.CanAccept:
                State.gameObject.SetActive(true);
                State.sprite = Statics.GetSprite("TaskState1");
                break;

            case TaskStateType.CanNotAccept:
                State.gameObject.SetActive(true);
                State.sprite = Statics.GetSprite("TaskState0");
                break;

            case TaskStateType.Ready:
                State.gameObject.SetActive(true);
                State.sprite = Statics.GetSprite("TaskState3");
                break;

            default:
                State.gameObject.SetActive(false);
                break;
            }
        }
Exemplo n.º 5
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);
         }
     }
 }
Exemplo n.º 6
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;
        }
Exemplo n.º 7
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");
            }
        }
Exemplo n.º 8
0
        public void RefreshView()
        {
            Icon.sprite = Statics.GetIconSprite(weaponData.IconId);
            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);
                }
            }
        }