Приемлемое воспроизведение музыки
This commit is contained in:
1 parent
3020140360
commit
5c81bde5db
13 files changed
+355
-193
No files matched your search
@@ -19,7 +19,7 @@ namespace Code.Audio
|
||||
_pool = new ObjectPool<AudioSource>(
|
||||
createFunc: CreateItem,
|
||||
// actionOnGet: OnGet,
|
||||
// actionOnRelease: OnRelease,
|
||||
actionOnRelease: OnRelease,
|
||||
actionOnDestroy: OnDestroyItem,
|
||||
collectionCheck: true, // helps catch double-release mistakes
|
||||
defaultCapacity: 10,
|
||||
@@ -45,6 +45,7 @@ namespace Code.Audio
|
||||
// Called when an item is returned to the pool.
|
||||
private void OnRelease(AudioSource source)
|
||||
{
|
||||
source.Stop();
|
||||
//source.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user