| | |
| | | using System; |
| | | using UnityEngine; |
| | | using Spine.Unity; |
| | | using System.Collections.Generic; |
| | | |
| | | /// <summary> |
| | | /// 命格战斗对象 - 没有血量、没有实体,不会被攻击和选中,唯一作用是释放技能 |
| | |
| | | public class MinggeBattleObject : BattleObject |
| | | { |
| | | public TeamMingge teamMingge { get; private set; } |
| | | |
| | | // Buff 管理器(命格现在也需要 buff 系统) |
| | | public BattleObjectBuffMgr buffMgr; |
| | | |
| | | // 预留的命格 Buff 显示接口,供外部自定义显示逻辑 |
| | | public Action<List<HB428_tagSCBuffRefresh>> OnMinggeBuffRefresh; |
| | | |
| | | public MinggeBattleObject(BattleField _battleField) : base(_battleField) |
| | | { |
| | |
| | | Camp = _camp; |
| | | ObjID = teamMingge.ObjID; |
| | | |
| | | // 命格不需要 buff 管理器(命格释放技能但自身不会有 buff) |
| | | // 初始化 buff 管理器 |
| | | buffMgr = new BattleObjectBuffMgr(); |
| | | buffMgr.Init(this); |
| | | |
| | | layerMgr = new BattleObjectLayerMgr(); |
| | | layerMgr.Init(this); |
| | |
| | | |
| | | public override void Run() |
| | | { |
| | | // 命格运行逻辑(如果需要) |
| | | // 更新 buff 管理器 |
| | | buffMgr?.Run(); |
| | | } |
| | | |
| | | public override void Pause() |
| | |
| | | |
| | | public override void Destroy() |
| | | { |
| | | // 命格没有需要清理的资源 |
| | | // 清理显示回调 |
| | | OnMinggeBuffRefresh = null; |
| | | |
| | | // 清理 buff 管理器 |
| | | if (buffMgr != null) |
| | | { |
| | | buffMgr.Release(); |
| | | buffMgr = null; |
| | | } |
| | | } |
| | | |
| | | // ============ 实现抽象访问方法 ============ |
| | | |
| | | public override BattleObjectBuffMgr GetBuffMgr() => null; // 命格不有 buff 系统 |
| | | public override BattleObjectBuffMgr GetBuffMgr() => buffMgr; |
| | | |
| | | public override int GetPositionNum() => teamMingge.positionNum; |
| | | public override float GetModelScale() => teamMingge.modelScale; |
| | |
| | | // 命格没有幻影 |
| | | } |
| | | |
| | | public override Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillBase skillBase, bool isCounter, Action onComplete) |
| | | public override Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillSkinConfig skillSkinConfig, SkillBase skillBase, bool isCounter, Action onComplete) |
| | | { |
| | | // 命格没有技能动画,立即触发所有帧事件 |
| | | int loopCount = skillConfig.LoopCount + 1; //默认会有一次 |
| | | int frameCount = skillConfig.ActiveFrames.Length; |
| | | int loopCount = skillSkinConfig.LoopCount + 1; //默认会有一次 |
| | | int frameCount = skillSkinConfig.ActiveFrames.Length; |
| | | |
| | | // 1. 技能开始 |
| | | skillBase.OnSkillStart(); |
| | |
| | | return false; |
| | | } |
| | | |
| | | public override bool CanCastSkillAnimation(SkillConfig skillConfig) |
| | | public override bool CanCastSkillAnimation(SkillSkinConfig skillSkinConfig) |
| | | { |
| | | // 命格总是可以释放技能(从动画角度) |
| | | return true; |
| | |
| | | return null; |
| | | } |
| | | |
| | | public override void OnDodgeBegin() |
| | | public override void OnDodgeBegin(DamageType damageType) |
| | | { |
| | | // 命格不需要闪避 |
| | | } |
| | |
| | | |
| | | public override void HaveRest() |
| | | { |
| | | // 命格不需要休息状态 |
| | | // 清理 buff |
| | | buffMgr?.RemoveAllBuff(); |
| | | } |
| | | |
| | | |
| | | public override void SetSpeedRatio(float ratio) |
| | | { |
| | | // 命格不需要速度控制 |