Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetButtonDown("Jump"))
     {
         sceneTraveler.goToNextScene();
     }
 }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     actionsPerSecondHelper += actionsPerSecond * Time.deltaTime;
     if (actionsPerSecondHelper > 1)
     {
         actionsPerSecondHelper = 1;
     }
     tryChangeSeason = Input.GetButtonDown("Jump");
     if (won || starved)
     {
         timeUntilChange += Time.deltaTime;
         if (timeUntilChange >= sceneChangeDelay)
         {
             if (won)
             {
                 sceneTraveler.goToNextScene();
             }
             else
             {
                 sceneTraveler.restartScene();
             }
         }
     }
     else
     {
         if (!slidingOnIce)
         {
             direction = new Vector3(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"), 0);
         }
         if (actionsPerSecondHelper >= 1)
         {
             if (changingSeason)
             {
                 actionsPerSecondHelper--;
                 changingSeason = false;
                 seasonsControl.ChangeSeason();
             }
             else if (direction.magnitude == 1 && !tryChangeSeason && checkTileAndMove(direction))
             {
                 actionsPerSecondHelper--;
             }
         }
         if (tryChangeSeason && hunger > 0)
         {
             seasonsControl.ChangeSeason();
             changingSeason = true;
             actionsPerSecondHelper--;
             hunger--;
             uIController.HungerUpdate();
             if (hunger <= 0)
             {
                 starved = true;
                 lossText.SetActive(true);
             }
         }
     }
 }