void Play() { if (!sound.hasHandle()) { Load(); } ExtensionsManager.PlaySound(sound, channelGroup, out channel, true); if (Position != Positioning._2D) { VECTOR pos = RuntimeUtils.ToFMODVector(transform.position); VECTOR zero = new VECTOR(); channel.set3DAttributes(ref pos, ref zero, ref zero); ExtensionsManager.AttachToGameObject(channel, transform, GetComponent <Rigidbody>()); channel.set3DMinMaxDistance(MinDistance, MaxDistance); } if (!UseReverb) { channel.setReverbProperties(0, 0f); } channel.setVolume(Volume); channel.setPaused(false); }
void Load() { // Path on the computer as that is what FMOD understands string fullFilePath = Application.dataPath + Settings.Instance.AssetLocation + File; // Get the combination of all the modes to pass into the createSound method MODE finalMode = ExtensionsUtils.CreateModeForLowLevelEmitter(LoopMode, Position, LoadType); // Get the channel group channelGroup = ExtensionsManager.GetChannelGroupFromBus(Bus); // Finally, create ExtensionsManager.Instance.LowLevelSystem.createSound(fullFilePath, finalMode, out sound); }
/// <summary> /// Stop playback, recording and remove sound from memory /// </summary> public void Stop() { ExtensionsManager.StopRecording(this); }
/// <summary> /// Begin or resume playback /// </summary> public void Start() { ExtensionsManager.PlayRecording(this); }