public PetSkill(bool can_crit, float cooldown, int focus, PetSkillType type, int min, int max) { this.can_crit = can_crit; this.cooldown = cooldown; this.focus = focus; this.type = type; this.average = (min + max) / 2; }
public PetSkill(bool can_crit, float cooldown, int focus, PetSkillType type) { this.can_crit = can_crit; this.cooldown = cooldown; this.focus = focus; this.type = type; this.average = 0; }
void AddLeftBtnDic(PetSkillType type, Transform btn) { if (!m_leftBtnDic.ContainsKey(type)) { if (btn.GetComponent <UITabGrid>() == null) { btn.gameObject.AddComponent <UITabGrid>(); } m_leftBtnDic.Add(type, btn); } else { m_leftBtnDic[type] = btn; } }
void ShowLeftBtnHigh(PetSkillType st) { foreach (var dic in m_leftBtnDic) { Transform btn = m_leftBtnDic[st]; if (btn != null) { UITabGrid tog = btn.GetComponent <UITabGrid>(); if (tog != null) { if (st == dic.Key) { tog.SetHightLight(true); } else { tog.SetHightLight(false); } } } } }
public string GetSkillTypeStr(PetSkillType type) { string str = ""; if (type == PetSkillType.Auto) { str = CommonData.GetLocalString("自动"); } else if (type == PetSkillType.Initiative) { str = CommonData.GetLocalString("主动"); } else if (type == PetSkillType.Passive) { str = CommonData.GetLocalString("被动"); } else if (type == PetSkillType.Recommend) { str = CommonData.GetLocalString("推荐"); } str = str + CommonData.GetLocalString("技能"); return(str); }
public void InitSkillPanel() { if (m_label_jinengpetname == null) { return; } if (CurPet != null) { m_label_jinengpetname.text = petDataManager.GetCurPetName(); m_label_jinengpetlevel.text = petDataManager.GetCurPetLevel().ToString(); List <PetSkillObj> list = CurPet.GetPetSkillList(); if (petDataManager.SelectSkillDataBase != null) { m_widget_SkillDescription.gameObject.SetActive(true); uint skillid = petDataManager.SelectSkillDataBase.wdID; PetSkillObj obj = null; if (list.Count > 0) { obj = list[0]; } for (int i = 0; i < list.Count; i++) { var skill = list[i]; if (skill.id == skillid) { obj = skill; } } if (obj != null) { SkillDatabase db = GameTableManager.Instance.GetTableItem <SkillDatabase>((uint)obj.id, obj.lv); if (db != null) { petDataManager.SetSkillDatabase(db); } } else { m_widget_SkillDescription.gameObject.SetActive(false); return; } m_label_Skillname.text = petDataManager.SelectSkillDataBase.strName; m_label_SkillLevel.text = petDataManager.SelectSkillDataBase.wdLevel.ToString(); PetSkillType type = (PetSkillType)Enum.Parse(typeof(PetSkillType), petDataManager.SelectSkillDataBase.petType.ToString()); m_label_SkillType.text = type.GetEnumDescription(); m_label_NowLevel.text = petDataManager.SelectSkillDataBase.strDesc; m_label_skill_xiaohaogold.text = petDataManager.SelectSkillDataBase.dwMoney.ToString(); uint nextLevel = petDataManager.SelectSkillDataBase.wdLevel + 1; SkillDatabase nexeDb = GameTableManager.Instance.GetTableItem <SkillDatabase>(petDataManager.SelectSkillDataBase.wdID, (int)nextLevel); if (nexeDb != null) { m_label_NextLevel.text = nexeDb.strDesc; m_widget_next.gameObject.SetActive(true); m_label_skillfulltips.gameObject.SetActive(false); } else { m_label_skillfulltips.gameObject.SetActive(true); m_widget_next.gameObject.SetActive(false); return; } string itemArray = nexeDb.needItemArray; string[] itemIDArray = itemArray.Split(';'); string[] itemNum = itemIDArray[0].Split('_'); uint itemID = uint.Parse(itemNum[0]); uint needNum = uint.Parse(itemNum[1]); m__jineng_icon.transform.DestroyChildren(); m_nSkillNeedItemID = itemID; int itemCount = DataManager.Manager <ItemManager>().GetItemNumByBaseId(itemID); UpLevelNeedNum = needNum; ShowJiNengColdLabel(itemID); UIItem.AttachParent(m__jineng_icon.transform, itemID, (uint)itemCount, ShowJinengGetWayCallBack); int count = CurPet.GetPetSkillList().Count; ItemDataBase itemDb = GameTableManager.Instance.GetTableItem <ItemDataBase>(itemID); if (itemDb != null) { m_label_jineng_name.text = itemDb.itemName; m_label_jineng_number.text = StringUtil.GetNumNeedString(itemCount, needNum); } } else { m_widget_SkillDescription.gameObject.SetActive(false); } } }