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.

Selection.Contains

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

Description

Returns whether an object is contained in the current selection.

	if (Selection.Contains (gameObject))
		Debug.Log ("I'm selected!");