public void endTurnTrigger(BotMovement bot) { BoardProcessor board = FindObjectOfType <BoardProcessor>(); TurnManager turnManager = FindObjectOfType <TurnManager>(); Vector3 botPosition = bot.transform.position; Waypoint moveToWaypoint = board.GetNearestWaypoint(new Vector2Int( Mathf.RoundToInt(botPosition.x + transform.forward.x * moveSpaces), Mathf.RoundToInt(botPosition.z + transform.forward.z * moveSpaces) )); if (moveToWaypoint != null) { bot.AddCommandToQueue(new Command("MOVE", moveToWaypoint)); } turnManager.AddPlayerToQueue(bot); }
public override void Use(BotMovement bot) { bot.AddCommandToQueue(new Command("ROTATE", null, (config as RotateConfig).NumRotations)); Destroy(bot.GetComponent <RotateBehavior>()); }
private void MoveBot(BotMovement bot, Waypoint nextWaypoint) { bot.AddCommandToQueue(new Command("MOVE", nextWaypoint)); }