Versions with this page:
Versions without this page:
当脚本化对象将销毁时调用此函数。
using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { void OnDestroy() { print("Script was destroyed"); } }
OnDestroy 不能作为协程。