예제 #1
0
    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);
    }
예제 #2
0
    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];
        }
    }
예제 #3
0
    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;
    }
예제 #4
0
    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();
    }
예제 #6
0
 private void Start()
 {
     BHS = GameObject.Find("BoardHandler").GetComponent <BoardHandlerScript>();
 }