Legacy Documentation: Version 5.4
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AssetDatabase.OpenAsset

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

Sumbission failed

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

Close

Cancel

public static function OpenAsset(instanceID: int, lineNumber: int = -1): bool;
public static bool OpenAsset(int instanceID, int lineNumber = -1);
public static function OpenAsset(target: Object, lineNumber: int = -1): bool;
public static bool OpenAsset(Object target, int lineNumber = -1);

Parameters

Description

Opens the asset with associated application.

Opens asset in an external editor, texture application or modelling tool depending on what type of asset it is. If it is a text file, lineNumber instructs the text editor to go to that line. Returns true if asset opened successfully.


public static function OpenAsset(objects: Object[]): bool;
public static bool OpenAsset(Object[] objects);

Parameters

Description

Opens the asset(s) with associated application(s).

Opens asset in an external editor, texture application or modelling tool depending on what type of asset it is. Returns true if all assets opened successfully.

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