Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (dropDown.value == 1)
        {
            //fillButton.SetActive(false);
            //colourSelectorButton.SetActive(false);
        }
        else
        {
            fillButton.SetActive(true);
            colourSelectorButton.SetActive(true);
            gridScript.colourPopup.SetActive(false);
            gridScript.DisableAllPopups();
        }

        if (gridScript.selectedMaterial == CubeMaterial.GLASS)
        {
            colourIndicator.sprite = glassIndicator;
            colourIndicator.color  = new Color(1, 1, 1, 1);
        }
        else if (gridScript.selectedMaterial == CubeMaterial.WOOD)
        {
            colourIndicator.sprite = woodIndicator;
            colourIndicator.color  = gridScript.selectedColour;
        }
        else if (gridScript.selectedMaterial == CubeMaterial.BRICK)
        {
            colourIndicator.sprite = brickIndicator;
            colourIndicator.color  = gridScript.selectedColour;
        }
        else
        {
            colourIndicator.sprite = tileIndicator;
        }
    }