Example #1
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (history.Count != 0)
     {
         if (iteration < history.Count)
         {
             historyMoment = history[iteration];
             if (!historyMoment.getJump() && !collidersAreSimilar())
             {
                 if (errors > 8)
                 {
                     camera.Death(transform.gameObject);
                 }
                 else
                 {
                     errors++;
                 }
             }
             else
             {
                 errors = 0;
             }
             transform.position = historyMoment.getPosition();
             cosmonaut.rotation = historyMoment.getRotation();
             animator.SetBool("run", historyMoment.getRunning());
             Debug.Log("Rot" + historyMoment.getRotation().eulerAngles);
             if (historyMoment.getF())
             {
                 actionScript.action();
                 Debug.Log("КОРОБКА");
             }
             iteration++;
         }
         else
         {
             if (actionScript.getBox() != null)
             {
                 actionScript.throwBox();
             }
             transform.gameObject.SetActive(false);
         }
     }
 }
Example #2
0
 public void Death()
 {
     Respawning();
     cameraScript.Death();
     deathSound.Play();
 }