public override void Execute(Point target) { this.IsActive(false); this.FaceTargetDirection(target); PlacementEffects placement = new PlacementEffects(); this.StartCoroutine(placement.LerpMovementPath(this, this.Unit, new List <Point>(SetPathOrder(validPaths[target])))); this.validPaths = null; }
public override void Execute(Point target) { if (this.ValidPositions == null || this.ValidPositions.Count == 0) { return; } int randomIndex = this.random.Next(this.ValidPositions.Count); Point position = this.ValidPositions[randomIndex]; PlacementEffects placement = new PlacementEffects(); this.StartCoroutine(placement.LerpMovementPath(this, this.Unit, new List <Point>(SetPathOrder(validPaths[position])))); }
private void MoveToAlignWithPlayer() { Point possibleMovement = AIUtils.AlignToPlayerUnit(this.Unit.UnitsMap, this.Unit, this.validPaths); if (possibleMovement == default) { return; } List <Point> path = this.validPaths[possibleMovement]; PlacementEffects placement = new PlacementEffects(); this.StartCoroutine(placement.LerpMovementPath(this, this.Unit, SetPathOrder(path))); //// PlacementHelper.Move(this.Unit, possibleMovement, new MoveUnitValidator(this.Unit, possibleMovement)); }
public override void Execute(Point target) { GetBestStretching(); if (moveTo == default) { return; } Logcat.I(this, $"UdeukedefrukeMovementAction moveTo {moveTo} stretchTo {stretchTo}"); PlacementEffects placement = new PlacementEffects(); this.StartCoroutine(placement.LerpMovementPath(this, this.Unit, SetPathOrder(validPaths[stretchTo]))); //// PlacementHelper.Move(this.Unit, moveTo, new MovementActionValidator()); this.GetComponentInParent <UdeukedefrukeBehaviour>().HeadPoint = moveTo; }
private void ScapeFromTarget(Point enemyToAvoid) { Point scapePosition = AIUtils.GetPositionToScape(enemyToAvoid, this.Unit.GetPosition(), this.Range, this.validPaths); if (scapePosition == default) { //// Logcat.I("Invalid position to scape"); return; } //// Logcat.I(this, $"Scaping to {scapePosition}"); List <Point> path = this.validPaths[scapePosition]; PlacementEffects placement = new PlacementEffects(); this.StartCoroutine(placement.LerpMovementPath(this, this.Unit, SetPathOrder(path))); //// PlacementHelper.Move(this.Unit, scapePosition, new MoveUnitValidator(this.Unit, scapePosition)); }