// this function get called on deslect trapped stones public void OnDeselectTrappedStone() { OnSelected.OnChosingMove -= gameManager.ChangeColorToCurrentPlayer; ChangeBackToNormal(); GameManger.LastSelected = null; // hide the triangles , so after deselect, we won't see the triangles movements. gameManager.HideAllTriangles(); }
/* after the movement according to first/second dice, * update the next location the paritcipent can jump to, according to the other dice. */ public void ShowMovementAfterDice(bool moveByOtherDice, int dice) { gameManager.indexCountMove++; gameManager.HideAllTriangles(); if (!moveByOtherDice) { if (OnSelected.SelectedPlayer.PlayerType == "Black") { OppisteType = "White"; gameManager.IndexPutAccordingToDice[dice] = TriangleIndex + gameManager.dices[dice].diceCount; } else { OppisteType = "Black"; gameManager.IndexPutAccordingToDice[dice] = TriangleIndex - gameManager.dices[dice].diceCount; } // according the current TypePlayer, show according to your current location after movent, if you can relocate the same player according the second dice. int canJumpToOtherDice = gameManager.CheckCanPutThere(gameManager.IndexPutAccordingToDice[dice], OppisteType); if (canJumpToOtherDice != -1) { // show the specific triangles that the participent can jump to gameManager.triangles[canJumpToOtherDice - 1].gameObject.SetActive(true); } } }
public void UpdateVisualAndOnBoard(List <Player> currentTakeOutList, Vector3[] currentTakeOutloc) { // add stone to TakeOut array and show it visual currentTakeOutList.Add(OnSelected.SelectedPlayer); gameManager.BoardGame[OnSelected.SelectedPlayer.indexTriangle - 1].Pop(); // remove from current stack OnSelected.SelectedPlayer.transform.localPosition = currentTakeOutloc[currentTakeOutList.Count - 1]; OnSelected.SelectedPlayer.transform.rotation = Quaternion.Euler(new Vector3(270, 0, 0)); gameObject.SetActive(false); // hide rectangle gameManager.ToggleHideShowRectangle(false); // hide triangle selected after moving a stone for there gameManager.HideAllTriangles(); gameManager.indexCountMove++; }