void Start() { timer = this.GetComponent <TimerScript>(); pauseMen = this.GetComponent <PauseMenu>(); BHS = GameObject.Find("BoardHandler").GetComponent <BoardHandlerScript>(); PISS = GameObject.Find("PieceInstantiator").GetComponent <PieceInstantiatorScript>(); endGameUI.SetActive(false); }
void Start() { BHS = GameObject.Find("BoardHandler").GetComponent <BoardHandlerScript>(); audioPlayer = GameObject.Find("AudioManager").GetComponent <AudioManager>(); networkManager = GameObject.Find("NetworkManager").GetComponent <NetworkManager>(); piece = gameObject.GetComponent <Piece>(); if (gameObject.transform.childCount > 0) { gameObject.transform.Find("PrimaryColour").gameObject.GetComponent <Renderer>().material = BHS.piecePrimaryColours[GetComponent <Piece>().colour]; gameObject.transform.Find("SecondaryColour").gameObject.GetComponent <Renderer>().material = BHS.pieceSecondaryColours[GetComponent <Piece>().colour]; gameObject.transform.Find("TertiaryColour").gameObject.GetComponent <Renderer>().material = BHS.pieceTertiaryColours[GetComponent <Piece>().colour]; } }
IEnumerator LoadBoardScene(bool s = false) { AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(1); while (!asyncLoad.isDone) { yield return(null); } BHS = GameObject.Find("BoardHandler").GetComponent <BoardHandlerScript>(); CP = GameObject.Find("Cursor").GetComponent <CursorPickup>(); GameObject.Find("PieceInstantiator").GetComponent <PieceInstantiatorScript>().InstantiatePieces(); solo = s; playing = true; }
void Start() { BHS = GameObject.Find("BoardHandler").GetComponent <BoardHandlerScript>(); playerCount = BHS.players; Milliseconds = new int[playerCount]; Seconds = new int[playerCount]; Minutes = new int[playerCount]; FillInt(Milliseconds, 60); FillInt(Seconds, 59); FillInt(Minutes, 9); for (int i = 0; i < playerCount; i++) { ClockText[i].text = Minutes[i].ToString() + ":" + Seconds[i].ToString(); } }
public void InstantiatePieces() { BHS = GameObject.Find("BoardHandler").GetComponent <BoardHandlerScript>(); BHS.Setup(); for (int i = 0; i < layout.LayoutsPieces1.Length; i++) { GameObject piece = Instantiate(layout.LayoutsPieces1[i].Piece, new Vector3(layout.LayoutsPieces1[i].Location.x, 1, layout.LayoutsPieces1[i].Location.y), layout.LayoutsPieces1[i].Piece.transform.rotation); piece.transform.SetParent(BHS.transform); piece.transform.tag = "Piece"; piece.GetComponent <Piece>().colour = layout.colour1; if (piece.GetComponent <Pawn>()) { piece.GetComponent <Pawn>().direction = layout.direction1; } if (piece.GetComponent <King>()) { piece.GetComponent <King>().direction = layout.direction1; } piece.GetComponent <Piece>().Setup(); } for (int z = 0; z < layout.LayoutsPieces2.Length; z++) { GameObject piece = Instantiate(layout.LayoutsPieces2[z].Piece, new Vector3(layout.LayoutsPieces2[z].Location.x, 1, layout.LayoutsPieces2[z].Location.y), layout.LayoutsPieces2[z].Piece.transform.rotation); piece.transform.SetParent(BHS.transform); piece.transform.tag = "Piece"; piece.GetComponent <Piece>().colour = layout.colour2; if (piece.GetComponent <Pawn>()) { piece.GetComponent <Pawn>().direction = layout.direction2; } if (piece.GetComponent <King>()) { piece.GetComponent <King>().direction = layout.direction2; } piece.GetComponent <Piece>().Setup(); } BHS.UpdateAvailableSpaces(); }
private void Start() { BHS = GameObject.Find("BoardHandler").GetComponent <BoardHandlerScript>(); }