// Update is called once per frame
 void Update()
 {
     if (Sc_TimerBar.fillAmount <= 0)
     {
         Sc_chooseButton.ChangeScreen();
     }
 }
Example #2
0
    void Update()
    {
        timeBarFillAmount = Sc_TimerBar.fillAmount;

        transform.position = Vector2.MoveTowards(new Vector2(transform.position.x, transform.position.y), new Vector2(originObject.transform.position.x, originObject.transform.position.y), 0.02f);

        if (timeBarFillAmount <= 0 && !win)
        {
            Sc_TimerBar.fillAmount = 10;
            Sc_chooseButton.ChangeScreen();
        }
    }
Example #3
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "Finish")
     {
         ambulanceReached = true;
         Sc_chooseButton.Win();
     }
     else
     {
         move = false;
     }
 }
Example #4
0
    // Update is called once per frame
    void Update()
    {
        timeBarFillAmount = Sc_TimerBar.fillAmount;

        if (move)
        {
            transform.Translate(0, Mathf.Lerp(0, moveSpeed, 0.05f * Time.deltaTime * 66), 0);
        }
        else
        {
            transform.Translate(0, 0, 0);
        }

        if (timeBarFillAmount <= 0 && ambulanceReached == false)
        {
            Sc_chooseButton.ChangeScreen();
        }

        if (timeBarFillAmount <= 0 && ambulanceReached == true)
        {
            Sc_chooseButton.Win();
        }
    }
Example #5
0
 void Win()
 {
     Sc_TimerBar.fillAmount = 10;
     Sc_chooseButton.Win();
 }
Example #6
0
 void Lose()
 {
     Sc_chooseButton.ChangeScreen();
 }
Example #7
0
 void Win()
 {
     Sc_chooseButton.Win();
 }