物体在inactive的情况下不能调用协程。
解决方法:判断物体是否可见,不可见则停止所有协程调用。
if(this.gameObject.activeSelf)
{
StartCoroutine(mCompletedLevelButtonStarAnimation());
StartCoroutine(LevelButtonUnlockAnimation());
}
else
{
StopAllCoroutines();
}
物体在inactive的情况下不能调用协程。
解决方法:判断物体是否可见,不可见则停止所有协程调用。
if(this.gameObject.activeSelf)
{
StartCoroutine(mCompletedLevelButtonStarAnimation());
StartCoroutine(LevelButtonUnlockAnimation());
}
else
{
StopAllCoroutines();
}