Exemplo n.º 1
0
 private void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.tag == "Player")
     {
         MoneyCounter.reducePercentage(10);
     }
 }
Exemplo n.º 2
0
 private void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.tag == "Player")
     {
         MoneyCounter.reducePercentage(10);
         var m = cube.gameObject.GetComponent <MoveToPoint2>();
         if (m)
         {
             m.pause();
         }
     }
 }
Exemplo n.º 3
0
 private void Update()
 {
     if (!hidden)
     {
         barDisplay = (float)currHealth / totalHealth;
         if (currHealth < 1 && !lost)
         {
             lost = true;
             MoneyCounter.reducePercentage(20);
             DayCounter.reduceDays();
             GameObject.Find("ScreenFader").GetComponent <ScreenFader>().fade("FailQuest");
         }
         else if (currHealth < 1 && !Application.loadedLevelName.Equals("FailQuest"))
         {
             GameObject.Find("ScreenFader").GetComponent <ScreenFader>().fade("FailQuest");
         }
     }
 }
Exemplo n.º 4
0
 private void Update()
 {
     if (isTriggered)
     {
         if (Input.GetKeyDown(KeyCode.Y))
         {
             var percentLoss = 5;
             Time.timeScale = 1;
             MoneyCounter.reducePercentage(percentLoss);
             DayCounter.reduceDays();
             GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("ExitQuest");
         }
         else if (Input.GetKeyDown(KeyCode.N))
         {
             Time.timeScale   = 1;
             textbox.position = new Vector3(textbox.position.x, 20, textbox.position.z);
             isTriggered      = false;
         }
     }
 }