Beispiel #1
0
    public void activateStone(starStones stone)
    {
        if (activeStone == starStones.None)
        {
            GameObject.FindGameObjectWithTag("spawnerManager").GetComponent <playStateControl>().startGame();
            starStoneHUD.alpha = 1;
        }

        activeStone    = stone;
        currentTexture = UIMaterials[(int)activeStone];
    }
Beispiel #2
0
    public void FixedUpdate()
    {
        for (int i = 0; i < activeCharge.Count; i++)
        {
            if (i == (int)activeStone)
            {
                if (activeCharge[(int)activeStone] > 0)
                {
                    activeCharge[(int)activeStone] -= Time.deltaTime;
                }
                else
                {
                    int nextStone = (int)activeStone + 1;
                    if (nextStone == 4)
                    {
                        nextStone = 0;
                    }

                    activeStone = (starStones)nextStone;
                }

                UIHighlights[i].SetActive(true);
            }
            else
            {
                UIHighlights[i].SetActive(false);
                if (activeCharge[i] < maxCharge)
                {
                    activeCharge[i] += Time.deltaTime;
                }
            }

            UIHighlights[i].GetComponent <Image>().color = new Color(UIHighlights[i].GetComponent <Image>().color.r, UIHighlights[i].GetComponent <Image>().color.g, UIHighlights[i].GetComponent <Image>().color.b, activeCharge[i] / maxCharge);

            UIElements[i].color = new Color(UIElements[i].color.r, UIElements[i].color.g, UIElements[i].color.b, activeCharge[i] / maxCharge);
        }
    }