StartCoroutine使用字符串方法名时,才能用StopCoroutine停用(StopCoroutine也必须使用字符串方法名)。
Closed this issue · 1 comments
1005399541 commented
#region 协程相关
///
/// 开启一个协程
///
public static Coroutine StartCoroutine(IEnumerator coroutine)
{
if (_behaviour == null)
throw new Exception($"{nameof(MotionEngine)} is not initialize. Use MotionEngine.Initialize");
return _behaviour.StartCoroutine(coroutine);
}
/// <summary>
/// 停止一个协程
/// </summary>
/// <param name="coroutine"></param>
public static void StopCoroutine(Coroutine coroutine)
{
if (_behaviour == null)
throw new Exception($"{nameof(MotionEngine)} is not initialize. Use MotionEngine.Initialize");
_behaviour.StopCoroutine(coroutine);
}
需要把这两个方法改成 : 字符串的协程重载方法
gmhevinci commented
增加了字符串为参数的协程启动和停止方法