docs.unity3d.com
    Show / Hide Table of Contents

    Class GameObjectExtensions

    Extensions methods for GameObjects

    Inheritance
    Object
    GameObjectExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.XR.CoreUtils
    Syntax
    public static class GameObjectExtensions

    Methods

    AddToHideFlagsRecursively(GameObject, HideFlags)

    Adds hideFlags to the hide flags on this GameObject and all of its descendants

    Declaration
    public static void AddToHideFlagsRecursively(this GameObject gameObject, HideFlags hideFlags)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject at the root of the hierarchy that will be modified

    HideFlags hideFlags

    Should the GameObjects be hidden, saved with the scene or modifiable by the user?

    SetHideFlagsRecursively(GameObject, HideFlags)

    Sets the hide flags on this GameObject and all of its descendants

    Declaration
    public static void SetHideFlagsRecursively(this GameObject gameObject, HideFlags hideFlags)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject at the root of the hierarchy that will be modified

    HideFlags hideFlags

    Should the GameObjects be hidden, saved with the scene or modifiable by the user?

    SetLayerAndAddToHideFlagsRecursively(GameObject, Int32, HideFlags)

    Sets the layer of this GameObject and adds to its HideFlags, and does the same for all of its descendants

    Declaration
    public static void SetLayerAndAddToHideFlagsRecursively(this GameObject gameObject, int layer, HideFlags hideFlags)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject at the root of the hierarchy that will be modified

    Int32 layer

    The layer to recursively assign GameObjects to

    HideFlags hideFlags

    Should the GameObjects be hidden, saved with the scene, or modifiable by the user?

    SetLayerAndHideFlagsRecursively(GameObject, Int32, HideFlags)

    Sets the layer and HideFlags of this GameObject and all of its descendants

    Declaration
    public static void SetLayerAndHideFlagsRecursively(this GameObject gameObject, int layer, HideFlags hideFlags)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject at the root of the hierarchy that will be modified

    Int32 layer

    The layer to recursively assign GameObjects to

    HideFlags hideFlags

    Should the GameObjects be hidden, saved with the scene, or modifiable by the user?

    SetLayerRecursively(GameObject, Int32)

    Sets the layer of this GameObject and all of its descendants

    Declaration
    public static void SetLayerRecursively(this GameObject gameObject, int layer)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject at the root of the hierarchy that will be modified

    Int32 layer

    The layer to recursively assign GameObjects to

    SetRunInEditModeRecursively(GameObject, Boolean)

    Set runInEditMode on all MonoBehaviours on this GameObject and its children

    Declaration
    public static void SetRunInEditModeRecursively(this GameObject gameObject, bool enabled)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject at the root of the hierarchy that will be modified

    Boolean enabled

    The value to which runInEditMode will be assigned

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023