Esempio n. 1
0
 void DisablePlayer4()
 {
     P4Data.GetComponentInChildren <Image>(title).enabled = false;
     P4Data.GetComponentInChildren <Text>(kills).text     = "";
     P4Data.GetComponentInChildren <Text>(builds).text    = "";
     P4Data.GetComponentInChildren <Text>(points).text    = "";
     P4Data.GetComponentInChildren <Text>(wins).text      = "";
     P4Data.GetComponent <Image>().color = Color.gray;
     P4 = false;
 }
    void Awake()
    {
        //Assigns appropriate player color to panels
        P1Data.GetComponent <Image>().color = P1_Color.color;
        P2Data.GetComponent <Image>().color = P2_Color.color;
        P3Data.GetComponent <Image>().color = P3_Color.color;
        P4Data.GetComponent <Image>().color = P4_Color.color;
        CheckPlayerNumbers();

        playerPoints = new int[4];
        //Debug.Log(playerPoints.Length);
        playerPoints[0] = PointsStorageTest.T.P1Points[PointsStorageTest.T.total];
        playerPoints[1] = PointsStorageTest.T.P2Points[PointsStorageTest.T.total];
        playerPoints[2] = PointsStorageTest.T.P3Points[PointsStorageTest.T.total];
        playerPoints[3] = PointsStorageTest.T.P4Points[PointsStorageTest.T.total];

        playerImages    = new Image[4];
        playerImages[0] = P1Data.GetComponentInChildren <Image>(title);
        playerImages[1] = P2Data.GetComponentInChildren <Image>(title);
        playerImages[2] = P3Data.GetComponentInChildren <Image>(title);
        playerImages[3] = P4Data.GetComponentInChildren <Image>(title);

        playerFaces    = new Sprite[4][];
        playerFaces[0] = P1Faces;
        playerFaces[1] = P2Faces;
        playerFaces[2] = P3Faces;
        playerFaces[3] = P4Faces;

        playerName    = new string[4];
        playerName[0] = "Player 1";
        playerName[1] = "Player 2";
        playerName[2] = "Player 3";
        playerName[3] = "Player 4";

        continueButton.text = "Start round " + (PointsStorageTest.T.round + 1);
        roundDisplay.text   = "Round " + (PointsStorageTest.T.round) + " Results";

        P1Crown.gameObject.SetActive(false);
        P2Crown.gameObject.SetActive(false);
        P3Crown.gameObject.SetActive(false);
        P4Crown.gameObject.SetActive(false);
    }
Esempio n. 3
0
    void Awake()
    {
        //Assigns appropriate player color to panels
        P1Data.GetComponent <Image>().color = P1_Color.color;
        P2Data.GetComponent <Image>().color = P2_Color.color;
        P3Data.GetComponent <Image>().color = P3_Color.color;
        P4Data.GetComponent <Image>().color = P4_Color.color;
        CheckPlayerNumbers();

        playerPoints    = new int[players];
        playerPoints[0] = PointsStorage.P.P1Points[PointsStorage.P.total];
        playerPoints[1] = PointsStorage.P.P2Points[PointsStorage.P.total];

        playerImages    = new Image[players];
        playerImages[0] = P1Data.GetComponentInChildren <Image>(title);
        playerImages[1] = P2Data.GetComponentInChildren <Image>(title);

        playerFaces    = new Sprite[players][];
        playerFaces[0] = P1Faces;
        playerFaces[1] = P2Faces;

        playerName    = new string[players];
        playerName[0] = "Player 1";
        playerName[1] = "Player 2";

        if (P3)
        {
            playerFaces[2]  = P3Faces;
            playerPoints[2] = PointsStorage.P.P3Points[PointsStorage.P.total];
            playerImages[2] = P3Data.GetComponentInChildren <Image>(title);
            playerName[2]   = "Player 3";
        }

        if (P4)
        {
            playerFaces[3]  = P4Faces;
            playerPoints[3] = PointsStorage.P.P4Points[PointsStorage.P.total];
            playerImages[3] = P4Data.GetComponentInChildren <Image>(title);
            playerName[3]   = "Player 4";
        }
    }