123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /// #pkgName FGUI包名
- /// #panelName UIPanel名字
- /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
- /// 该脚本由模板创建
- /// created by cb 2024
- using FairyGUI;
- using System;
- using XGame;
- 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;
- }
- }
- }
- }
|