Version: 2019.4
LanguageEnglish
  • C#

CodeEditor.OSOpenFile

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static bool OSOpenFile(string appPath, string arguments);

Parameters

appPath The absolute path of the application to open.
arguments The arguments to be passed to the application. You must make sure any paths are quoted correctly for the current platform.

Description

Open an application with a quoted string of arguments.

This method is useful if you want to write a custom tool in the Unity Editor which launches a local application with arguments. The Unity Editor passes this request to the operating system's native support for opening applications. Note: Because the path and parameters you supply are passed directly on to the OS, you must ensure they are correctly quoted for the current platform. You can use Application.platform to detect the current platform.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961