Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

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

AssetDatabase.IsOpenForEdit

static function IsOpenForEdit(assetObject: Object): bool;
static bool IsOpenForEdit(Object assetObject);
static def IsOpenForEdit(assetObject as Object) as bool
static function IsOpenForEdit(assetPath: string): bool;
static bool IsOpenForEdit(string assetPath);
static def IsOpenForEdit(assetPath as string) as bool
static function IsOpenForEdit(assetObject: Object, message: string): bool;
static bool IsOpenForEdit(Object assetObject, string message);
static def IsOpenForEdit(assetObject as Object, message as string) as bool
static function IsOpenForEdit(assetPath: string, message: string): bool;
static bool IsOpenForEdit(string assetPath, string message);
static def IsOpenForEdit(assetPath as string, message as string) as bool

Parameters

assetPathIs the path to the asset on disk relative to project folder.
messageUsed to give reason for not open.

Returns

bool True is the asset can be edited.

Description

Use IsOpenForEdit to determine if the asset is open for edit by the version control.

Used to disable editor controls.