Version: 2021.1
LanguageEnglish
  • C#

GameObjectUtility

class in UnityEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

GameObject utility functions.

Static Methods

AreStaticEditorFlagsSetReturns true if the passed in StaticEditorFlags are set on the GameObject specified.
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.
GetNavMeshAreaGet the navmesh area index for the GameObject.
GetNavMeshAreaFromNameGet the navmesh area index from the area name.
GetNavMeshAreaNamesGet all the navmesh area names.
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.
SetNavMeshAreaSet the navmesh area for the gameobject.
SetParentAndAlignSets the parent and gives the child the same layer and position.
SetStaticEditorFlagsSets the StaticEditorFlags of the specified GameObject.