/// #pkgName FGUI包名 /// #panelName UIPanel名字 /// #UIName = $"{#pkgName}{#panelName}" UIKey名字 /// 该脚本由模板创建 /// created by cb 2024 using FairyGUI; using XGame.Database; using XGame.Framework.UI; namespace FL.FGUI { public struct SkillInfoParam { public bool bShowRightBubble; // 是否显示右侧气泡类型 public SkillTable skillInfo; } /// /// UI逻辑处理类 /// /// public partial class PlayerSkillInfoNestedCtrl : UIController { protected override void OnEnable(object intent) { AddUIListenres(); if (intent is SkillInfoParam) { ShowSkillInfo((SkillInfoParam)intent); } } protected override void OnDisable() { RemoveUIListenres(); } #region UI事件 private void AddUIListenres() { } private void OnTouchEnd(EventContext context) { } private void RemoveUIListenres() { } #endregion /// /// 显示技能弹窗信息UI /// /// /// public void ShowSkillInfo(SkillInfoParam data) { SkillTable skillInfo = data.skillInfo; if (skillInfo != null) { VM.SkillIcon.icon = skillInfo.Icon; VM.SkillNameLabel.text = skillInfo.Name; VM.SkillDescLabel.text = skillInfo.Desc; int bubbleType = 0; if (skillInfo.ModalityType == 1) // 主动技能 { VM.SkillCdLabel.text = (skillInfo.RestTime * 0.001f).ToString("F1"); } else { bubbleType = 1; } VM.BubbleCtrl.selectedIndex = data.bShowRightBubble ? 2 : bubbleType; } } } }