public void Initialize(ControlInput input) { _input = input; engineSource = rolling.Play(SoundType.SFX, audioContainer); engineSource.loop = true; othersSource = SoundExtensions.CreateAudioSource("OtherSource", audioContainer, SoundType.SFX); }
private void PlayShootArrowSound() { foreach (Sound sound in sounds) { if (sound.audioClip.name == "shootArrow") { SoundExtensions.PasteAudioInformation(audioSource, sound); audioSource.Play(); break; } } }
/// <summary> /// Determines whether [is allowed extension] [the specified extension]. /// </summary> /// <param name="extension">The extension.</param> /// <param name="fileType">Type of the file.</param> /// <returns></returns> /// <createdOn>1/27/2016 8:00 AM</createdOn> /// <exception cref="System.ArgumentOutOfRangeException">null</exception> public static bool IsAllowedExtension(string extension, FileType fileType = FileType.Image) { var isAllowed = false; switch (fileType) { case FileType.Image: isAllowed = ImageExtensions.Contains(extension); break; case FileType.Document: isAllowed = DocumentExtensions.Contains(extension); break; case FileType.Presentation: isAllowed = PresentationExtensions.Contains(extension); break; case FileType.Spreadsheet: isAllowed = SpreadsheetExtensions.Contains(extension); break; case FileType.CompressedFile: isAllowed = CompressedFileExtensions.Contains(extension); break; case FileType.Website: isAllowed = WebsiteExtensions.Contains(extension); break; case FileType.Sound: isAllowed = SoundExtensions.Contains(extension); break; case FileType.Video: isAllowed = VideoExtensions.Contains(extension); break; default: throw new ArgumentOutOfRangeException(nameof(fileType), fileType, null); } return(isAllowed); }
private void Update() { if (gameManager.currentState == GameManager.GameState.PullArrowPhase) { if (bowMain.BowPullStrength > 0.5 && bowPullStretchSoundIsPlaying == false) { foreach (Sound sound in sounds) { if (sound.audioClip.name == "bowPullStretch") { SoundExtensions.PasteAudioInformation(audioSource, sound); audioSource.Play(); bowPullStretchSoundIsPlaying = true; break; } } } else if (bowMain.BowPullStrength < 0.5) { bowPullStretchSoundIsPlaying = false; audioSource.Stop(); } } }
private void OnCollisionEnter(Collision collision) { SoundExtensions.PasteAudioInformation(audioSource, hitTargetSound); audioSource.Play(); }