Пример #1
0
 // Update is called once per frame
 void Update()
 {
     if (active)
     {
         transform.position -= Vector3.up * speed;
         if (speed < speedLimit)
         {
             speed += acc;
         }
         if (transform.position.y <= limit)
         {
             active             = false;
             transform.position = new Vector3(transform.position.x, limit, transform.position.z);
             audioS.PlayOneShot(thump);
             audioS.Play();
         }
     }
     if (!done)
     {
         if (!last)
         {
             if (!audioS.isPlaying)
             {
                 done = true;
                 next.Activate();
             }
             else
             {
                 if (Input.GetKeyDown(KeyCode.Space))
                 {
                     audioS.Stop();
                 }
             }
         }
     }
 }