LanguageEnglish
  • C#
  • JS

Script language

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

This version of Unity is unsupported.

Selection.Contains

public static bool Contains(int instanceID);
public static bool Contains(Object obj);

Description

Returns whether an object is contained in the current selection.

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