【m】停止运行时清空静态对象

This commit is contained in:
Han
2025-04-22 13:50:46 +08:00
parent 8c5d3f412d
commit 2aefbdc31b
3 changed files with 17 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections;
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.Internal;
@@ -23,6 +24,17 @@ namespace Stary.Evo.AudioCore
coroutineRunner.StopCoroutine(myCoroutine);
}
private class CoroutineRunner : MonoBehaviour { }
private class CoroutineRunner : MonoBehaviour
{
private void OnDestroy()
{
if (coroutineRunner != null)
{
coroutineRunner.StopAllCoroutines();
coroutineRunner = null;
}
}
}
}
}