| | |
| | | // battleField.battleTweenMgr.OnPlayTween(tweener); |
| | | } |
| | | |
| | | protected void MoveToTarget(RectTransform target, Vector2 offset, float duration, Action onComplete = null) |
| | | protected void MoveToTarget(RectTransform target, Vector2 offset, Action onComplete = null) |
| | | { |
| | | // 原地释放 |
| | | if (skillConfig.CastDistance >= 9999) |
| | |
| | | } |
| | | |
| | | caster.motionBase.PlayAnimation(MotionName.run, true); |
| | | var tweener = BattleUtility.MoveToTarget(caster.heroRectTrans, target, offset, duration, () => |
| | | var tweener = BattleUtility.MoveToTarget(caster.heroRectTrans, target, offset, () => |
| | | { |
| | | caster.motionBase.PlayAnimation(MotionName.idle, true); |
| | | onComplete?.Invoke(); |
| | |
| | | |
| | | RectTransform target = battleField.GetTeamNode(caster.GetEnemyCamp(), skillConfig); |
| | | |
| | | MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), moveTime, () => |
| | | MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), () => |
| | | { |
| | | // 到位置转身(不一定非要转身 但是流程要写) |
| | | TurnBack(() => |
| | |
| | | () => |
| | | { |
| | | // 回到原来的位置 |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, moveTime, |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, |
| | | OnAttackFinish); |
| | | } |
| | | , -1f); |
| | |
| | | |
| | | RectTransform targetTrans = battleField.GetTeamNode(battleCamp, mainTargetPosNum); |
| | | |
| | | MoveToTarget(targetTrans, new Vector2(skillConfig.CastDistance, 0), moveTime, () => |
| | | MoveToTarget(targetTrans, new Vector2(skillConfig.CastDistance, 0), () => |
| | | { |
| | | // 到位置转身(不一定非要转身 但是流程要写) |
| | | TurnBack(() => |
| | |
| | | () => |
| | | { |
| | | // 回到原来的位置 |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, moveTime, |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, |
| | | OnAttackFinish); |
| | | } |
| | | , -1f); |
| | |
| | | { |
| | | RectTransform target = battleField.GetTeamNode(caster.Camp, skillConfig); |
| | | |
| | | MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), moveTime, () => |
| | | MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), () => |
| | | { |
| | | // 到位置转身(不一定非要转身 但是流程要写) |
| | | TurnBack(() => |
| | |
| | | { |
| | | // 回到原来的位置 |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), |
| | | Vector2.zero, moveTime, OnAttackFinish); |
| | | Vector2.zero, OnAttackFinish); |
| | | } |
| | | , -1f); |
| | | }); |