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)

    Start this behaviour running in edit mode This sets runInEditMode to true, which, if the behaviour is enabled will call OnDisable and then OnEnable

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

    The behaviour

    StopRunInEditMode(MonoBehaviour)

    Stop this behaviour running in edit mode If the behaviour is enabled, we first disable it so that OnDisable is called. Then we set runInEditMode to false. Then, if the behaviour was enabled, we re-enable it

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

    The behaviour

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, December 21, 2022
    Terms of use