void OnRideSkillGridUIEvent(UIEventType eventType, object data, object param) { switch (eventType) { case UIEventType.Click: UISkillGrid grid = data as UISkillGrid; if (grid != null) { if (grid.Data != null && grid.Data.skillid != 0) { DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.PlayerSkillTipsPanel, panelShowAction: (pb) => { if (null != pb && pb is PlayerSkillTipsPanel) { PlayerSkillTipsPanel panel = pb as PlayerSkillTipsPanel; if (panel != null) { table.RideSkillDes skilldb = GameTableManager.Instance.GetTableItem <table.RideSkillDes>((uint)grid.Data.skillid); panel.ShowUI(PlayerSkillTipsPanel.SkillTipsType.Ride, skilldb, grid.Data.level); panel.InitParentTransform(grid.transform, new Vector2(0, 80)); } } }); } } break; } }
private void OnRideUI(uint baseId, uint level, UILabel[] labels) { m_label_petGradeValue.text = string.Format("速度加成: {0}%", RideData.GetSpeedById_Level(baseId, (int)level)); m_label_petLift.text = ""; m_label_petCharacter.text = ""; m_label_variableLevel.text = ""; m_label_InheritingNumber.text = ""; for (int i = 0; i < skillLabels.Length; i++) { skillLabels[i].enabled = false; } uint ride_life = 0; for (int i = 0; i < m_itemServer.numbers.Count; i++) { GameCmd.PairNumber pn = m_itemServer.numbers[i]; GameCmd.eItemAttribute bute = (GameCmd.eItemAttribute)pn.id; switch (bute) { case GameCmd.eItemAttribute.Item_Attribute_Ride_Level: break; case GameCmd.eItemAttribute.Item_Attribute_Ride_Life: ride_life = pn.value; break; case GameCmd.eItemAttribute.Item_Attribute_Ride_Skill: table.RideSkillData skilldata = GameTableManager.Instance.GetTableItem <table.RideSkillData>(baseId, (int)level); if (skilldata != null) { for (int n = 0; n < skilldata.skillArray.Count; n++) { labels[n].enabled = true; table.RideSkillDes rideSkillDes = GameTableManager.Instance.GetTableItem <table.RideSkillDes>(skilldata.skillArray[n]); if (rideSkillDes != null) { labels[n].text = rideSkillDes.skillName; } } } break; case GameCmd.eItemAttribute.Item_Attribute_Ride_Base_Id: table.RideDataBase ridedata = GameTableManager.Instance.GetTableItem <table.RideDataBase>(pn.value); if (ridedata != null) { m_label_name.text = ridedata.name; //DataManager.Manager<UIManager>().SetSpriteDynamicIcon(m_sprite_icon, ridedata.icon, true); UIManager.GetTextureAsyn(ridedata.icon, ref m_curIconAsynSeed, () => { if (null != m__icon) { m__icon.mainTexture = null; } }, m__icon); if (null != m_sprite_qulity) { UIManager.GetQualityAtlasAsyn(ridedata.quality, ref m_curBordernAsynSeed, () => { if (null != m_sprite_qulity) { m_sprite_qulity.atlas = null; } }, m_sprite_qulity); } m_label_Label_2.text = string.Format("品质: {0}", DataManager.Manager <RideManager>().GetRideQualityStr(ridedata.quality)); } break; default: break; } } m_label_petYhLv.text = string.Format("寿命: {0}", ride_life); }
private void SetRideSkills() { RideData rideData = DataManager.Manager <RideManager>().GetCurrRideData(); if (rideData == null) { return; } ResetBtn(); bool canuse = false; int skillIndex = 0; int offset = 0; LearnSkillDataManager data = DataManager.Manager <LearnSkillDataManager>(); if (data.CurState == SkillSettingState.StateTwo) { offset = 4; } if (m_skillBtnIndex == 9)//第一个技能 { gameObject.SetActive(true); skillIndex = 0; canuse = rideData.skill_ids.Count > skillIndex; } else if (m_skillBtnIndex == 1 + offset) { skillIndex = 1; canuse = rideData.skill_ids.Count > skillIndex; } else if (m_skillBtnIndex == 2 + offset) { skillIndex = 2; canuse = rideData.skill_ids.Count > skillIndex; } else if (m_skillBtnIndex == 3 + offset) { skillIndex = 3; canuse = rideData.skill_ids.Count > skillIndex; } else if (m_skillBtnIndex == 4 + offset) { skillIndex = 4; canuse = rideData.skill_ids.Count > skillIndex; } else if (m_skillBtnIndex == 10) { skillIndex = 5; canuse = rideData.skill_ids.Count > skillIndex; } else { return; } ShowAdd(!canuse); if (canuse) { m_skillid = (uint)rideData.skill_ids[skillIndex]; SetLongPressEvent(true); table.RideSkillDes rideSkill = GameTableManager.Instance.GetTableItem <table.RideSkillDes>((uint)m_skillid); if (rideSkill != null) { if (skillIcon != null) { bool bAdjust = m_skillBtnIndex == 9 ? false : true; UIManager.GetTextureAsyn(DataManager.Manager <UIManager>().GetResIDByFileName(false, rideSkill.skillIcon, true), ref iuiIconAtlas, () => { if (null != skillIcon) { skillIcon.mainTexture = null; } }, skillIcon, false); } } RunCD(); } else { SetLongPressEvent(false); m_skillid = 0; } SetBtnEnable(canuse); if (skillIcon != null) { skillIcon.alpha = canuse ? 1f : 0f; } }