Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (_myDiceName != "Common")
        {
            if (PlayerDiceHolder.GetDiceList().Contains(_myDiceName))
            {
                Color newColour = Color.grey;
                newColour.a = 0.5f;

                this.GetComponent <Button>().enabled = false;
                this.GetComponent <Image>().color    = newColour;
                this.transform.GetChild(0).GetComponent <Text>().color  = newColour;
                this.transform.GetChild(1).GetComponent <Image>().color = newColour;
                this.transform.GetChild(2).GetComponent <Image>().color = newColour;
            }
            else
            {
                Color newColour = Color.white;
                newColour.a = 1;

                this.GetComponent <Button>().enabled = true;
                this.GetComponent <Image>().color    = newColour;

                this.transform.GetChild(0).GetComponent <Text>().color  = newColour;
                this.transform.GetChild(1).GetComponent <Image>().color = newColour;
                this.transform.GetChild(2).GetComponent <Image>().color = newColour;
            }
        }
    }
Exemplo n.º 2
0
 private void OnLevelWasLoaded(int level)
 {
     if (SceneManager.GetActiveScene().name.Contains("GetDiceScene"))
     {
         for (int i = 1; i <= 3; i++)
         {
             PlayerDiceHolder.ChangeDice(i, "Common");
         }
     }
 }
    public void SwitchDice()
    {
        GameObject currDice = DiceIndicatorDiceSelection.GetSelectedDice();

        currDice.GetComponent <Image>().sprite = FindDiceSkin(_myDiceName).GetDiceImage();

        int diceNum = int.Parse(currDice.gameObject.name.Substring(currDice.gameObject.name.Length - 1));

        PlayerDiceHolder.ChangeDice(diceNum, _myDiceName);
    }