private void HandleThrustInput() { if (input.Thrust) { ApplyThrust(); audioSource.PlayOneShot(thrustClip); } else { StopApplyingThrust(); } }
// 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(); } }