| | |
| | | buffMgr = new BattleObjectBuffMgr(); |
| | | buffMgr.Init(this); |
| | | |
| | | buffMgr.onIsControlChanged += OnControledChange; |
| | | |
| | | layerMgr = new BattleObjectLayerMgr(); |
| | | layerMgr.Init(this); |
| | | |
| | |
| | | |
| | | motionBase.Release(); |
| | | motionBase = null; |
| | | buffMgr.onIsControlChanged -= OnControledChange; |
| | | buffMgr.Release(); |
| | | buffMgr = null; |
| | | teamHero = null; |
| | | ObjID = 0; |
| | | |
| | |
| | | { |
| | | GameObject.DestroyImmediate(heroGo); |
| | | heroGo = null; |
| | | } |
| | | } |
| | | |
| | | // 有变化了才会调用这个函数 |
| | | private void OnControledChange(int groupType, bool value) |
| | | { |
| | | // 这里是受到硬控时候 需要表现的动画 |
| | | if (groupType == BattleConst.HardControlGroup) |
| | | { |
| | | // 从没被硬控到被硬控 |
| | | if (value) |
| | | { |
| | | motionBase.SetControledAnimation(); |
| | | } |
| | | else |
| | | { |
| | | motionBase.CancelControledAnimation(); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | // 这里 |
| | | if (dmgInfo.IsType(DamageType.Dodge)) |
| | | if (dmgInfo.IsType(DamageType.Dodge) && !buffMgr.isControled[BattleConst.HardControlGroup]) |
| | | { |
| | | if (isLastHit) |
| | | { |
| | |
| | | OnDodgeBegin(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | bool isFatalAttack = (null != deadPack) && isLastHit; |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | if ((dmgInfo.IsType(DamageType.Damage) || dmgInfo.IsRealdamage())) |
| | | if (dmgInfo.IsType(DamageType.Block)) |
| | | { |
| | | motionBase.PlayAnimation(MotionName.hit, false); |
| | | battleField.battleEffectMgr.PlayEffect(this, 19999, heroRectTrans, Camp); |
| | | } |
| | | else |
| | | { |
| | | if ((dmgInfo.IsType(DamageType.Damage) || dmgInfo.IsRealdamage())) |
| | | { |
| | | if (!buffMgr.isControled[BattleConst.HardControlGroup]) |
| | | { |
| | | motionBase.PlayAnimation(MotionName.hit, false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | public void SetSpeedRatio(float ratio) |
| | | { |
| | | motionBase.SetSpeedRatio(ratio); |
| | | heroInfoBar.SetSpeedRatio(ratio); |
| | | } |
| | | |
| | | |