Exemple #1
0
    public void UpdateUIVisuals()
    {
        if (isGameOver == false)
        {
            angerImg.SetActive(false);
            bombImg.GetComponent <Image>().color     = new Color(1, 1, 1, 1);
            bombFuseImg.GetComponent <Image>().color = new Color(1, 1, 1, 1);
            cashRain.SetActive(false);
            currentBalanceText.text = "KHR$" + (currentBalance * rielsToUSDExchangeRate).ToString("F0");
            requiredUSDText.text    = ProblemManager.newProblem.GetUSDSum().ToString();
            requiredKHRText.text    = ProblemManager.newProblem.GetRielSum().ToString("F0");
            scoreText.text          = "Score: " + score;
            scoreText.color         = scoreColor;
            TickBomb();
            if (currentBalance <= probGen.requiredAmount)
            {
                if (cashierImgArray[0] != null)
                {
                    cashierImg.sprite = cashierImgArray[0];
                }
                if (cashierMachineArray[0] != null)
                {
                    cashierMachineImg.sprite = cashierMachineArray[0];
                }

                if (audioPlayer.auntieIsPlaying == true)
                {
                    if (audioPlayer.angryAuntie.isPlaying == false)
                    {
                        audioPlayer.auntieIsPlaying = false;
                    }
                }
            }
            else if (currentBalance > probGen.requiredAmount)
            {
                //play error sound
                //highlight previous note?
                //make auntie angry
                angerImg.SetActive(true);
                if (cashierImgArray[2] != null)
                {
                    cashierImg.sprite = cashierImgArray[2];
                }
                audioPlayer.AngryAuntie();
            }
        }
        else if (isGameOver == true)
        {
            audioPlayer.StopBombTick();
            audioPlayer.BombExplosion();
            bombImg.GetComponent <Image>().color     = new Color(1, 1, 1, 0);
            bombFuseImg.GetComponent <Image>().color = new Color(1, 1, 1, 0);
            bombExplosionAnimation.SetActive(true);

            if (cashierImgArray[1] != null)
            {
                cashierImg.sprite = cashierImgArray[1];
            }
            if (cashierMachineArray[1] != null)
            {
                cashierMachineImg.sprite = cashierMachineArray[1];
            }

            cashRain.SetActive(true);
            //bomb graphic needs to change to exploded shell

            //display bomb auntie, shell of bomb and strewn notes (falling from the sky? cashier broken?)
        }
    }