/* #endregion */ /* ======================================================================================== */ /* #region ==== R O T A T I O N a c t i o n ============================================== */ /* #region ---- 1. CHECK FOR TOTATION ----------------------------------------------------- */ public void CheckForRotation(PitchTile targetTile) { bool isValidTarget = false; if (MatchManager.MatchPlayerManager.CurrentActivePlayer.PlayerMode == PlayerMode.Rotate) { /* #region ---- Check for valid target tile ---- */ foreach (var tile in Player.CurrentTile.NeighbourTiles) { if (tile == targetTile) { isValidTarget = true; break; } } /* #endregion */ /* #region ---- If validTarget ---- */ if (isValidTarget) { int apCost = getApCost(targetTile); if (Player.CurrentActionPoints >= apCost) { if (RotationCounter == MatchManager.MatchPlayerManager.ActionsApCostSettings.MaxRotationsPerTurn) { MatchManager.Hud.UpdateGameMessage(MatchManager.Hud.Messages.NoMoreRotations); MatchManager.Hud.UpdateApCostToString(""); } else { RotationCounter++; Player.FaceTarget(targetTile.transform); Player.UpdateRotationAngle((int)Player.transform.eulerAngles.y); updateStatHud(apCost); clearTryRedrawRotateGrid(); //CurrentAction = PlayerAction.Rotate; USE THIS FOR ANIMATION. } } else { updateHud(); } } /* #endregion */ } }