| | |
| | | |
| | | public BattleObjectBuffMgr buffMgr; |
| | | |
| | | public BattleObjectLayerMgr layerMgr; |
| | | |
| | | public int ObjID { get; set; } |
| | | |
| | | public BattleCamp Camp { get; protected set; } |
| | | |
| | | public TeamHero teamHero { get; protected set; } |
| | | |
| | | // public BuffMgr buffMgr; |
| | | |
| | | public MotionBase motionBase; |
| | | |
| | |
| | | Camp = _camp; |
| | | motionBase = new MotionBase(); |
| | | motionBase.Init(heroGo.GetComponentInChildren<SkeletonGraphic>(true)); |
| | | motionBase.onAnimationComplete += OnAnimationComplete; |
| | | buffMgr = new BattleObjectBuffMgr(); |
| | | buffMgr.Init(this); |
| | | |
| | | layerMgr = new BattleObjectLayerMgr(); |
| | | layerMgr.Init(this); |
| | | |
| | | renderers = heroGo.GetComponentsInChildren<Renderer>(true); |
| | | |
| | |
| | | var heroInfoBarScale = heroInfoBar.transform.localScale; |
| | | heroInfoBarScale.x *= Camp == BattleCamp.Red ? 1 : -1; |
| | | heroInfoBar.transform.localScale = heroInfoBarScale; |
| | | |
| | | |
| | | heroInfoBar.SetActive(true); |
| | | SetFront(); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | motionBase.Run(); |
| | | heroInfoBar.Run(); |
| | | buffMgr.Run(); |
| | | } |
| | | |
| | | public virtual void Pause() |
| | |
| | | |
| | | public virtual void Destroy() |
| | | { |
| | | motionBase.onAnimationComplete -= OnAnimationComplete; |
| | | |
| | | motionBase.Release(); |
| | | motionBase = null; |
| | |
| | | |
| | | public virtual void Hurt(List<long> damageValues, long _totalDamage, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig) |
| | | { |
| | | PopDamage(damageValues, _totalDamage, hurt, skillConfig); |
| | | BattleDmgInfo dmgInfo = PopDamage(damageValues, _totalDamage, hurt, skillConfig); |
| | | |
| | | motionBase.PlayAnimation(MotionName.hit, false); |
| | | |
| | | } |
| | | if (dmgInfo.IsType(DamageType.Damage) || dmgInfo.IsRealdamage()) |
| | | { |
| | | motionBase.PlayAnimation(MotionName.hit, false); |
| | | } |
| | | } |
| | | |
| | | public void SuckHp(uint suckHP, SkillConfig skillConfig) |
| | | { |
| | |
| | | |
| | | public void HurtByReflect(uint bounceHP, SkillConfig skillConfig) |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | // 闪避开始 |
| | |
| | | }); |
| | | } |
| | | |
| | | // 不一定可靠 有时候会插入其他动作就完了 |
| | | protected virtual void OnAnimationComplete(string motionName) |
| | | { |
| | | |
| | | } |
| | | |
| | | protected virtual void OnDeadAnimationComplete() |
| | | { |
| | | // 或许看看溶解特效? YYL TODO |
| | | heroGo.SetActive(false); |
| | | |
| | | buffMgr.RemoveAllBuff(); |
| | | } |
| | | |
| | | public void OnReborn(HB423_tagMCTurnFightObjReborn vNetData) |
| | |
| | | } |
| | | |
| | | // 伤害还要看 是否闪避 暴击 and so on 需要有一个DamageType 服务器应该会给 |
| | | protected virtual void PopDamage(List<long> damageValues, long _totalDamage, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig) |
| | | protected virtual BattleDmgInfo PopDamage(List<long> damageValues, long _totalDamage, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, SkillConfig skillConfig) |
| | | { |
| | | BattleDmgInfo battleDmgInfo = new BattleDmgInfo(battleField.guid, damageValues, this, hurt, skillConfig); |
| | | |
| | |
| | | |
| | | // YYL TODO 是否需要挂在在自身的follow点上 |
| | | EventBroadcast.Instance.Broadcast(EventName.BATTLE_DAMAGE_TAKEN, battleDmgInfo); |
| | | return battleDmgInfo; |
| | | } |
| | | |
| | | public RectTransform GetAliasTeamNode() |
| | |
| | | heroRectTrans.anchoredPosition = Vector2.zero; |
| | | |
| | | heroInfoBar.SetActive(false); |
| | | SetFront(); |
| | | } |
| | | |
| | | public void PushDropItems(BattleDrops _battleDrops) |
| | |
| | | battleDrops = null; |
| | | } |
| | | |
| | | public void SetBack() |
| | | { |
| | | layerMgr.SetBack(); |
| | | } |
| | | |
| | | public void SetFront() |
| | | { |
| | | layerMgr.SetFront(); |
| | | } |
| | | |
| | | public void SetSpeedRatio(float ratio) |
| | | { |
| | | motionBase.SetSpeedRatio(ratio); |
| | | } |
| | | |
| | | |
| | | #if UNITY_EDITOR_STOP_USING |