using System; using GAS.Runtime; using Sog; namespace CoreGame.Logic { [Serializable] public class TaskAddRandomCastPos : InstantAbilityTask { public float randomRange; public override void OnExecute(in TaskSpec self) { var ctx = self.abilitySpec.ctx; // var targetPos = GetTargetPos(ctx); var newPos = Fixed64Vector2.right; // ctx.castPos.Clear(); // ctx.castTarget.Clear(); // ctx.castPos.Add(newPos); } // private Vector2 GetTargetPos(GameAbilityContext ctx) // { // if (ctx.castTarget.Count > 0) // { // var ent = Contexts.Combat.GetEntity(ctx.castTarget[0]); // if (ent.IsValid() && ent.hasTransformProxy) // { // return ent.transformProxy.position; // } // } // return ctx.castPos.Count > 0 // ? ctx.castPos[0] // : ctx.ownerEnt.transformProxy.position + ctx.ownerEnt.transformProxy.direction * 2; // } } }