public void GiveCoinsForExtraTime()
        {
            int CoinsForExtraTime = GameObject.Find("HealthCanvas").GetComponent <TimerController>().CoinsForExtraTime;



            //add extra time
            PlayerPrefs.SetInt("TotalCoins", PlayerPrefs.GetInt("TotalCoins") - CoinsForExtraTime);
            TimerController timerControllerScript             = GameObject.Find("HealthCanvas").GetComponent <TimerController>();
            float           TotalTimeOptimized3StarsInSeconds = GameObject.Find("HealthCanvas").GetComponent <TimerController>().TotalTimeOptimized3StarsInSeconds;

            timerControllerScript.TotalTimeInSeconds = (int)(TotalTimeOptimized3StarsInSeconds * 0.3);
            timerControllerScript.watchVideoPanel.SetActive(false);
            timerControllerScript.gameOver = false;

            txtTotalCoins.text = PlayerPrefs.GetInt("TotalCoins").ToString();

            Time.timeScale = 1f;
        }
Ejemplo n.º 2
0
        // Use this for initialization
        void Start()
        {
            finishedPanel = GameObject.FindGameObjectWithTag("FinishedPanel");

            star1 = GameObject.FindGameObjectWithTag("Star1");
            star2 = GameObject.FindGameObjectWithTag("Star2");
            star3 = GameObject.FindGameObjectWithTag("Star3");

            finishedPanel.SetActive(false);

            star1.SetActive(false);
            star2.SetActive(false);
            star3.SetActive(false);

            colliderDoor = GetComponent <BoxCollider2D>();

            TimerObject = GameObject.Find("HealthCanvas").GetComponent <TimerController>();

            TotalTimeOptimized3StarsInSeconds = TimerObject.TotalTimeOptimized3StarsInSeconds;
            Percentage2Stars = TimerObject.Percentage2Stars;
            Percentage1Stars = TimerObject.Percentage1Stars;
        }