protected virtual void OnDestroy()
        {
            if (m_object != null)
            {
                m_object.Reset();
                m_object = null;
            }

            if (m_dragDrop != null)
            {
                m_dragDrop.Reset();
            }
            if (m_instance == this)
            {
                m_instance = null;
            }
        }
        protected virtual void Awake()
        {
            if (m_instance != null)
            {
                Debug.LogWarning("Another instance of RTE exists");
                return;
            }
            if (m_useBuiltinUndo)
            {
                m_undo = new RuntimeUndo(this);
            }
            else
            {
                m_undo = new DisabledUndo();
            }

            if (m_raycaster == null)
            {
                m_raycaster = GetComponent <GraphicRaycaster>();
            }



            IsVR        = UnityEngine.XR.XRDevice.isPresent && m_enableVRIfAvailable;
            m_selection = new RuntimeSelection(this);
            m_dragDrop  = new DragDrop(this);
            m_object    = new ExposeToEditorEvents(this);

            if (IsVR)
            {
                m_input = new InputLowVR();
            }
            else
            {
                m_input = new InputLow();
            }

            m_instance = this;

            bool isOpened = m_isOpened;

            m_isOpened = !isOpened;
            IsOpened   = isOpened;
        }