GameObjectUtility

class in UnityEditor

Description

GameObject utility functions.

Static Methods

AreStaticEditorFlagsSetReturns true if the passed in StaticEditorFlags are set on the GameObject specified.
DuplicateGameObjectDuplicates a single GameObject and returns the new GameObject.
DuplicateGameObjectsDuplicates an array of GameObjects and returns the array of the new GameObject roots.
EnsureUniqueNameForSiblingYou can use this method after parenting one GameObject to another to ensure the child GameObject has a unique name compared to its siblings in the hierarchy.
GetMonoBehavioursWithMissingScriptCountGets the number of MonoBehaviours with a missing script for the given GameObject.
GetStaticEditorFlagsGets the StaticEditorFlags of the GameObject specified.
GetUniqueNameForSiblingYou can use this method before instantiating a new sibling, or before parenting one GameObject to another, to ensure the new child GameObject has a unique name compared to its siblings in the hierarchy.
ModifyMaskIfGameObjectIsHiddenForPrefabModeInContextUse this method if a custom scene culling mask is needed for renderers that should be shown or hidden in a Scene view when Prefab Mode in Context is active.
RemoveMonoBehavioursWithMissingScriptRemoves the MonoBehaviours with a missing script from the given GameObject.
SetParentAndAlignSets the parent and gives the child the same layer and position.
SetStaticEditorFlagsSets the StaticEditorFlags of the specified GameObject.

Did you find this page useful? Please give it a rating: