public static void SetItemChoice(Transform parent, bool bShow) { if (m_choice != null) { m_choice.SetActiveNew(bShow); } m_choice = UIItem.GetBtn(parent, "choice"); m_choice.SetActiveNew(bShow); }
public static void SetItemChoice(Transform parent) { if (m_choice != null) { m_choice.SetActiveNew(false); } m_choice = UIItem.GetBtn(parent, "choice"); m_choice.SetActiveNew(true); }
public static void SetRedPoint(Transform parent, bool isRed) { UIItem.GetBtn(parent, "red").SetActiveNew(isRed); }
/// <summary> /// 设置道具,返回icon对象 /// </summary> public static GameObject SetGoodsItem(Transform item, GoodsItem itemVal) { if (null == item || null == itemVal) { return(null); } UIItem.SetText(item, UIItemTitle.txtName, itemVal.name); //物品描述 if (itemVal.describe != "") { UIItem.SetText(item, UIItemTitle.txtDescribe, itemVal.describe); } // 图标 //GameObject iconObject = UIItem.SetImage(item, UIItemTitle.imgIcon, itemVal.iconId, itemVal.icon, true); GameObject iconObject = UIItem.GetChild(item, UIItemTitle.imgIcon).gameObject; if (String.IsNullOrEmpty(itemVal.icon)) { iconObject.SetActiveNew(false); } else { UnityEngine.Profiling.Profiler.BeginSample("LoadImage"); UIItem.SetImage(item, UIItemTitle.imgIcon, int.Parse(itemVal.icon)); if (!iconObject.ActiveSelfNew()) { iconObject.SetActiveNew(true); } UnityEngine.Profiling.Profiler.EndSample(); //UIButton.Get(iconObject); } // 强化等级 //if (itemVal.level != "" && IsInt(itemVal.level) && int.Parse(itemVal.level) > 0) UIItem.SetText(item, UIItemTitle.txtLevel, itemVal.level); GameObject tmpBgLevel = UIItem.GetBtn(item, "bg_level"); if (tmpBgLevel != null) { if (itemVal.rate == null) { tmpBgLevel.SetActiveNew(false); } else { tmpBgLevel.SetActiveNew(true); } } //else // UIItem.SetText(item, UIItemTitle.txtLevel, ""); // 数量 if (itemVal.count != "" && IsInt(itemVal.count) && int.Parse(itemVal.count) >= 0) { UIItem.SetText(item, UIItemTitle.txtCount, itemVal.count); } else { UIItem.SetText(item, UIItemTitle.txtCount, ""); } if (itemVal.price >= 0) { UIItem.SetText(item, UIItemTitle.txtPrice, itemVal.price.ToString()); } // 品质 if (itemVal.rank != "") { UIItem.SetText(item, UIItemTitle.txtRank, itemVal.rank); } //星级 if (itemVal.starLevel >= 0) { UIItem.SetStarLevel(item, UIItemTitle.txtStarLevel, itemVal.starLevel); } // 宝石孔 UIItem.SetText(item, "gem_count", itemVal.gemHoleNum + "/6"); if (itemVal.currency > 0) { } // 还有一个类型,用于特效预留 return(iconObject); }
public static void SetItemIsOpen(Transform parent, bool open) { UIItem.GetBtn(parent, SSwitchBtn.s_open).SetActiveNew(open); UIItem.GetBtn(parent, SSwitchBtn.s_close).SetActiveNew(!open); }