public static void Unload ();

描述

卸载 Unity 运行时。

卸载 Unity 运行时。与退出类似,但应用程序进程不会退出。当使用 Unity 作为其他应用程序中的组件时,这非常有用。例如,如果您使用 Unity 显示某些特殊内容,但不希望 Unity 引擎在不需要时驻留在内存中。

注意:只有 iOS、Android 和 Windows 应用商店支持此方法。

注意:此函数不会返回值。

using UnityEngine;
using System.Collections;

// Unload Unity when the user hits escape. Exit is not applied to the application.

public class ExampleClass : MonoBehaviour { void Update() { if (Input.GetKey("escape")) { Application.Unload(); } } }