/// <summary> /// 停止并销毁声音 /// </summary> /// <param name="clipName"></param> public void Stop(string clipName) { SoundData data = GetAudioSource(clipName); if (null != data) { data.Dispose(); } }
//--------------------// #region Dispose protected override void Dispose(bool disposing) { try { if (disposing) { // This block will only be executed on manual disposal, not by Garbage Collection Log.Info("Disposing " + this); SoundData?.Dispose(); } } finally { base.Dispose(disposing); } }
public void Dispose() { Data?.Dispose(); }