Exemplo n.º 1
0
 private void HandleThrustInput()
 {
     if (input.Thrust)
     {
         ApplyThrust();
         audioSource.PlayOneShot(thrustClip);
     }
     else
     {
         StopApplyingThrust();
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        var fire1Down = CrossPlatformInputManager.GetButtonDown("Fire1");

        if (fire1Down)
        {
            lazerParticles.ForEach(lp => lp.Play());
            audioSource.PlayOneShot(lazerSound);
        }

        var fire1up = CrossPlatformInputManager.GetButtonUp("Fire1");

        if (fire1up && audioSource.IsPlaying)
        {
            audioSource.FadeOut();
        }
    }