12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- /// #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;
- }
- /// <summary>
- /// UI逻辑处理类
- /// </summary>
- /// <typeparam name=""></typeparam>
- public partial class PlayerSkillInfoNestedCtrl : UIController<PlayerSkillInfoNestedVM>
- {
- protected override void OnEnable(object intent)
- {
- AddUIListenres();
-
- if (intent != null)
- {
- ShowSkillInfo((SkillInfoParam)intent);
- }
- }
- protected override void OnDisable()
- {
- RemoveUIListenres();
- }
- #region UI事件
- private void AddUIListenres()
- {
- //VM.Panel.onTouchEnd.Add(OnTouchEnd);
- }
- private void OnTouchEnd(EventContext context)
- {
-
- }
- private void RemoveUIListenres()
- {
- }
- #endregion
- /// <summary>
- /// 显示技能弹窗信息UI
- /// </summary>
- /// <param name="Show"></param>
- /// <param name="bPassive"></param>
- 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;
- }
- }
- }
- }
|