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.Contains

static function Contains(obj: Object): bool;
static bool Contains(Object obj);
static def Contains(obj as Object) as bool
static function Contains(instanceID: int): bool;
static bool Contains(int instanceID);
static def Contains(instanceID as int) as bool

Description

Is object an asset?

Returns true when an object is an asset (corresponds to a file in the Assets folder), and false if it is not (for example object in the scene, or an object created at runtime).