Ejemplo n.º 1
0
    public void ChangeColor(Vector3 ColorV)
    {
        _MyV3Color = ColorV;
        Color MyColor = _Help.V3ToColor(_MyV3Color);

        Renderer[] RendList = GetComponentsInChildren <Renderer>();
        foreach (Renderer Rend in RendList)
        {
            if (Rend.tag == "Colourable")
            {
                Rend.material.color = MyColor;
            }
        }
    }
Ejemplo n.º 2
0
    // Called by Local Player's PlayerController ... once tank has spawned.
    public void Configure(int NumberPlayers, int OwnPlayer)
    {
        _PlayerCount     = NumberPlayers;
        _OwnPlayerNumber = OwnPlayer;

        // populate Panels's Array (and deactivate redundant Panels)
        _myPanels    = new PanelScript[_PlayerCount];
        _myPanels[0] = P0;
        _myPanels[1] = P1;
        if (_PlayerCount == 4)
        {
            _myPanels[2] = P2;
            _myPanels[3] = P3;
        }
        else
        {
            P2.DeActivate();
            P3.DeActivate();
        }

        // Populate IGV's References
        _myPlayers    = new InGameVariables[_PlayerCount];
        _myPlayers[0] = PlayerController.PlayerControllers[0];
        _myPlayers[1] = PlayerController.PlayerControllers[1];
        if (_PlayerCount == 4)
        {
            _myPlayers[2] = PlayerController.PlayerControllers[2];
            _myPlayers[3] = PlayerController.PlayerControllers[3];
        }

        // Color Screen Border BackGround
        Color BGCol = _Help.V3ToColor(_myPlayers[OwnPlayer].Color);

        BG0.GetComponent <Image>().color = BGCol;
        BG1.GetComponent <Image>().color = BGCol;
        BG2.GetComponent <Image>().color = BGCol;
        BG3.GetComponent <Image>().color = BGCol;

        // Initial Panel Set-up
        for (int i = 0; i < _PlayerCount; i++)
        {
            _myPanels[i].SetScore(0);
            _myPanels[i].SetName(_myPlayers[i].PlayerName);
            _myPanels[i].SetColor(_Help.V3ToColor(_myPlayers[i].Color));
            _myPanels[i].SetHealth(1f);
            _myPanels[i].SetFlashTime(FlashTime);
            _myPanels[i].Connect(true);
        }
    }