public override void OnPlay() { uniqueID = SubItem.clipref.name + "__" + (++globalCounter).ToString(); string path = SubItem.clipref.StreamingAssetPath; #if !UNITY_EDITOR && UNITY_ANDROID path = SubItem.clipref.StreamingAssetPathRelative.Replace(".caf", ".ogg"); path = path.Replace("iOS", "Android");//temp #endif LLSoundManager.PlaySound(uniqueID, path, TotalVolume, Pitch, Loop, transform.position, MinDistance, MaxDistance, SpatialBlend); Register(this, uniqueID); }
void UpdateListenerPosition() { AudioListener listener = GetCurrentAudioListener(); if (listener != null) { Vector3 pos = listener.transform.position; if (pos != listenerLastPosition) { LLSoundManager.SetListenerPosition(pos); } listenerLastPosition = pos; } }
protected override void LateUpdate() { Vector3 pos = transform.position; if (lastPosition != pos) { IsDirty = true; lastPosition = pos; } if (IsDirty) { LLSoundManager.UpdateSound(uniqueID, TotalVolume, Pitch, Loop, transform.position, MinDistance, MaxDistance, SpatialBlend); } base.LateUpdate(); }
internal override void StopSound() { base.StopSound(); LLSoundManager.StopSound(uniqueID); Unregister(this, uniqueID); }
protected override void ApplyPause() { LLSoundManager.PauseSound(uniqueID, IsPaused); }