docs.unity.cn
    Show / Hide Table of Contents

    Class MonoBehaviourExtensions

    Extension methods for MonoBehaviour objects.

    Inheritance
    Object
    MonoBehaviourExtensions
    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 MonoBehaviourExtensions

    Methods

    StartRunInEditMode(MonoBehaviour)

    Starts running this MonoBehaviour while in edit mode.

    Declaration
    public static void StartRunInEditMode(this MonoBehaviour behaviour)
    Parameters
    Type Name Description
    MonoBehaviour behaviour

    The behaviour

    Remarks

    This function sets runInEditMode to true, which, if the behaviour is currently enabled, calls OnDisable and then OnEnable.

    StopRunInEditMode(MonoBehaviour)

    Stops this MonoBehaviour from running in edit mode.

    Declaration
    public static void StopRunInEditMode(this MonoBehaviour behaviour)
    Parameters
    Type Name Description
    MonoBehaviour behaviour

    The behaviour

    Remarks

    If this MonoBehaviour is currently enabled, this function disables it, sets runInEditMode to false, and the re-enables it. OnDisable and OnEnable are called.

    If this MonoBehaviour is currently disabled, this function only sets runInEditMode to false.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Tuesday, July 18, 2023