语言English
  • C#

EditorApplication.applicationPath

public static string applicationPath;

描述

获取 Unity 编辑器应用程序的路径。(只读)

Unity 编辑器的路径可能因您的配置而异。如果您从 Windows 上的 Hub 安装了 2021.3 编辑器,则您的路径可能类似于:C:/Program Files/Unity/Hub/Editor/2021.3.10f1/Editor/Unity.exe。其他资源:applicationContentsPath

// Display file system location where the Unity
// executable is stored.

using UnityEditor; using UnityEngine;

public class ApplicationPathExample { // Create a menu item called "Location of Unity application" in the "Examples" Menu. // In the Editor, click on "Location of Unity Application" in the menu to display the path to the Unity executable in the Console. [MenuItem("Examples/Location of Unity application")] static void AppPath() { Debug.Log(EditorApplication.applicationPath); } }

Did you find this page useful? Please give it a rating: