public void Init(int wingId) { WingGlobal.ResetRawImage(); if (this.m_WingPreviewCellCurrent != null && this.m_WingPreviewCellCurrent.get_gameObject() != null) { Object.Destroy(this.m_WingPreviewCellCurrent.get_gameObject()); } if (this.m_WingPreviewCellNext != null && this.m_WingPreviewCellNext.get_gameObject() != null) { Object.Destroy(this.m_WingPreviewCellNext.get_gameObject()); } this.m_current_wingId = wingId; this.m_current_winglevel = WingManager.GetWingLv(wingId); this.m_wingLvInfoL = WingManager.GetWingLvInfo(this.m_current_wingId, this.m_current_winglevel); this.m_wingLvInfoR = WingManager.GetWingLvInfoNextDifferent(this.m_current_wingId, this.m_current_winglevel); if (this.m_wingLvInfoL.model == this.m_wingLvInfoR.model) { this.m_wingLvInfoL = WingManager.GetWingLvInfoPreDifferent(this.m_current_wingId, this.m_current_winglevel); } this.m_WingPreviewCellCurrent = WingGlobal.GetOneWingPreview(base.get_transform()); this.m_WingPreviewCellCurrent.get_transform().set_localPosition(new Vector3(-245f, 0f)); this.m_WingPreviewCellNext = WingGlobal.GetOneWingPreview(base.get_transform()); this.m_WingPreviewCellNext.get_transform().set_localPosition(new Vector3(245f, 0f)); base.get_transform().Find("imgArrow").SetAsLastSibling(); this.SetWingPreviewCellAll(); }
private void SetAttrCurr(int wingId, bool isActivation) { int wingLv = WingManager.GetWingLv(wingId); wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv); Text component = base.get_transform().Find("txtName").GetComponent <Text>(); component.set_text(TextColorMgr.GetColorByQuality(wingLvInfo.name, wingLvInfo.color)); Image component2 = this.m_btnIcon.GetComponent <Image>(); ResourceManager.SetSprite(component2, GameDataUtils.GetIcon(wingLvInfo.icon)); ImageColorMgr.SetImageColor(component2, !isActivation); if (wingLv == 0) { this.m_attrCurr.Find("txtLv").GetComponent <Text>().set_text("激活后"); } else { this.m_attrCurr.Find("txtLv").GetComponent <Text>().set_text("Lv." + wingLv); } Attrs attrs = DataReader <Attrs> .Get(wingLvInfo.templateId); for (int i = 0; i < 6; i++) { if (i < attrs.attrs.get_Count()) { Debug.Log(attrs.attrs.get_Item(i) + "=" + (AttrType)attrs.attrs.get_Item(i)); this.m_attrCurr.Find("txtAttrName" + (i + 1)).get_gameObject().SetActive(true); this.m_attrCurr.Find("txtAttrName" + (i + 1)).GetComponent <Text>().set_text(AttrUtility.GetStandardAddDesc(attrs.attrs.get_Item(i), attrs.values.get_Item(i), "ff7d4b")); } else { this.m_attrCurr.Find("txtAttrName" + (i + 1)).get_gameObject().SetActive(false); } } }
public void OnClickOneWing(int wingId) { if (WingManager.GetWingLv(wingId) == 0) { if (WingManager.IsCanActiveWing(wingId)) { WingManager.Instance.SendWingComposeReq(wingId); } else { WingPreviewOneUI wingPreviewOneUI = UIManagerControl.Instance.OpenUI("WingPreviewOneUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as WingPreviewOneUI; wingPreviewOneUI.InitWithNotActive(wingId); wingPreviewOneUI.get_transform().SetAsLastSibling(); } } else { WingPreviewOneUI wingPreviewOneUI2 = UIManagerControl.Instance.OpenUI("WingPreviewOneUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as WingPreviewOneUI; wingPreviewOneUI2.get_transform().SetAsLastSibling(); if (wingId == EntityWorld.Instance.EntSelf.Decorations.wingId) { wingPreviewOneUI2.InitWithUndress(wingId); wingPreviewOneUI2.get_transform().SetAsLastSibling(); } else { wingPreviewOneUI2.InitWithWear(wingId); wingPreviewOneUI2.get_transform().SetAsLastSibling(); } } }
public void PlayIconSpine() { FXSpineManager.Instance.DeleteSpine(this.m_fxIconSpine, true); if (WingManager.firstGetWingDetail && WingManager.GetWingLv(1) > 0) { this.m_fxIconSpine = FXSpineManager.Instance.PlaySpine(2203, this.m_btnIcon, "WingUpgradeUI", 2000, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None); } }
public void InitWithMaxLv(int wingId) { this.Init(wingId); this.mWingPreviewCell.SetCondition(true, "已获得最高级"); wings wingInfo = WingManager.GetWingInfo(wingId); int wingLv = WingManager.GetWingLv(wingId); wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv); this.mWingPreviewCell.SetName(TextColorMgr.GetColorByQuality(wingLvInfo.name, wingLvInfo.color)); }
private void OnClickBtnIcon(GameObject sender) { int num = 1; int wingLv = WingManager.GetWingLv(num); WingPreviewTwoUI wingPreviewTwoUI = UIManagerControl.Instance.OpenUI("WingPreviewTwoUI", UINodesManager.MiddleUIRoot, false, UIType.NonPush) as WingPreviewTwoUI; wingPreviewTwoUI.Init(num); wingPreviewTwoUI.get_transform().SetAsLastSibling(); if (WingManager.firstGetWingDetail && WingManager.GetWingLv(1) > 0) { WingManager.Instance.SendGetWingDetailReq(); } }
private void Init(int wingId) { WingGlobal.ResetRawImage(); if (this.mWingPreviewCell != null && this.mWingPreviewCell.get_gameObject() != null) { Object.Destroy(this.mWingPreviewCell.get_gameObject()); } wings wingInfo = WingManager.GetWingInfo(wingId); int wingLv = WingManager.GetWingLv(wingId); int wingModel = WingManager.GetWingModel(wingId, wingLv); this.mWingPreviewCell = WingGlobal.GetOneWingPreview(base.get_transform()); this.mWingPreviewCell.SetRawImage(wingModel); this.mWingPreviewCell.SetName(TextColorMgr.GetColorByQuality(wingInfo.name, wingInfo.color)); }
public static bool IsCanActiveWing(int id) { int wingLv = WingManager.GetWingLv(id); if (wingLv != 0) { return(false); } wings wingInfo = WingManager.GetWingInfo(id); int key = wingInfo.activation.get_Item(0).key; int value = wingInfo.activation.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(key); return(num >= (long)value); }
public void RefreshWing(wings dataWings) { this.wingId = dataWings.id; base.get_transform().set_name(dataWings.id.ToString()); this.ResetAll(); this.PlayCanActiveSpine(); wings wingInfo = WingManager.GetWingInfo(this.wingId); this.m_lblWingName.set_text(TextColorMgr.GetColorByQuality(wingInfo.name, wingInfo.color)); ResourceManager.SetSprite(this.m_spWingIcon, GameDataUtils.GetIcon(wingInfo.icon)); if (WingManager.GetWingLv(this.wingId) == 0) { ImageColorMgr.SetImageColor(this.m_spWingIcon, true); int key = wingInfo.activation.get_Item(0).key; int value = wingInfo.activation.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(key); int icon = DataReader <Items> .Get(key).icon; ResourceManager.SetSprite(this.m_spimgIcon, GameDataUtils.GetItemIcon(key)); this.m_spimgIcon.SetNativeSize(); this.m_activeRequire.get_gameObject().SetActive(true); this.m_lblProgress.set_text(num + "/" + value); float num2 = Mathf.Clamp01((float)num / (float)value); this.m_imgProgress.set_sizeDelta(new Vector2(180f * num2, 18.9f)); if (WingSelectUI.IsTimeLimitWing(this.wingId)) { this.m_imgTimeLimit.get_gameObject().SetActive(true); } } else { ImageColorMgr.SetImageColor(this.m_spBackground, false); ImageColorMgr.SetImageColor(this.m_spWingIcon, false); if (this.wingId == EntityWorld.Instance.EntSelf.Decorations.wingId) { this.m_imgHighlight.get_gameObject().SetActive(true); } if (WingSelectUI.IsTimeLimitWing(this.wingId)) { this.m_imgTimeLimit.get_gameObject().SetActive(true); this.m_txtTimeLimit.get_gameObject().SetActive(true); this.m_txtTimeLimit.set_text(WingSelectUI.GetWingRemainTime(this.wingId)); } } }
public static bool IsCanUpgradeWing(int wingId) { int wingLv = WingManager.GetWingLv(wingId); if (wingLv == 0) { return(false); } if (WingManager.IsMaxWingLv(wingId, wingLv)) { return(false); } wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv + 1); int key = wingLvInfo.update.get_Item(0).key; int value = wingLvInfo.update.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(key); return(num >= (long)value); }
private void SortWingList() { this.m_listDataWings = WingManager.GetSelectWingInfos(); this.m_listDataWings.Sort(delegate(wings a, wings b) { int wingLv = WingManager.GetWingLv(a.id); int wingLv2 = WingManager.GetWingLv(b.id); if (wingLv != wingLv2) { return(-wingLv.CompareTo(wingLv2)); } bool flag = WingSelectUI.IsTimeLimitWing(a.id); bool flag2 = WingSelectUI.IsTimeLimitWing(b.id); if (flag != flag2) { return(-flag.CompareTo(flag2)); } return(a.id.CompareTo(b.id)); }); }
private void SetAttrNext(int wingId) { wings wingInfo = WingManager.GetWingInfo(wingId); int num = WingManager.GetWingLv(wingId) + 1; wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, num); this.m_attrNext.Find("txtLv").GetComponent <Text>().set_text("Lv." + num); Attrs attrs = DataReader <Attrs> .Get(wingLvInfo.templateId); for (int i = 0; i < 6; i++) { if (i < attrs.attrs.get_Count()) { this.m_attrNext.Find("txtAttrVal" + (i + 1)).get_gameObject().SetActive(true); this.m_attrNext.Find("txtAttrVal" + (i + 1)).GetComponent <Text>().set_text(this.GetFormatAttrValue(attrs.attrs.get_Item(i), (float)attrs.values.get_Item(i))); } else { this.m_attrNext.Find("txtAttrVal" + (i + 1)).get_gameObject().SetActive(false); } } }
public void Refresh() { this.ResetAll(); int wingLv = WingManager.GetWingLv(1); this.SetAttrCurr(1, wingLv > 0); if (wingLv == 0) { this.m_activeRequire.get_gameObject().SetActive(true); this.m_btnActive.get_gameObject().SetActive(true); this.SetActiveRequire(1); Image component = this.m_btnActive.GetComponent <Image>(); if (WingManager.IsCanActiveWing(1)) { this.m_btnActive.GetComponent <Button>().set_enabled(true); ImageColorMgr.SetImageColor(component, false); } else { this.m_btnActive.GetComponent <Button>().set_enabled(false); ImageColorMgr.SetImageColor(component, true); } } else if (WingManager.IsMaxWingLv(1, wingLv)) { this.SetButtonWearAndButtonUndress(); this.m_maxLevelTip.get_gameObject().SetActive(true); } else { this.m_upgradeRequire.get_gameObject().SetActive(true); this.SetButtonWearAndButtonUndress(); this.m_btnUpgrade.get_gameObject().SetActive(true); this.m_attrNext.get_gameObject().SetActive(true); this.SetUpgradeRequire(1); this.SetAttrNext(1); } }
private void SetUpgradeRequire(int wingId) { int wingLv = WingManager.GetWingLv(wingId); wingLv wingLvInfo = WingManager.GetWingLvInfo(wingId, wingLv); int requireItemId = wingLvInfo.update.get_Item(0).key; int value = wingLvInfo.update.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(requireItemId); int icon = DataReader <Items> .Get(requireItemId).icon; string text = num + "/" + value; this.m_upgradeRequire.Find("txtProgress").GetComponent <Text>().set_text(text); float num2 = Mathf.Min(1f, (float)num / (float)value); this.m_upgradeRequire.Find("imgProgress").GetComponent <RectTransform>().set_sizeDelta(new Vector2(205f * num2, 18.9f)); Button component = this.m_upgradeRequire.GetComponent <Button>(); component.get_onClick().RemoveAllListeners(); component.get_onClick().AddListener(delegate { this.OnClickUpgradeRequire(requireItemId); }); }
private bool IsPlayCanActiveSpine() { return(WingManager.GetWingLv(this.wingId) == 0 && WingManager.IsCanActiveWing(this.wingId)); }
private bool IsPlayCanActiveSpine() { return(WingManager.GetWingLv(1) == 0 && WingManager.IsCanActiveWing(1)); }
public bool IsWingSysOnAndActivation() { return(SystemOpenManager.IsSystemOn(35) && WingManager.GetWingLv(1) > 0); }