Example #1
0
        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    = gameObject.GetComponent <RuntimeObjects>();

            SetInput();

            m_instance = this;

            bool isOpened = m_isOpened;

            m_isOpened = !isOpened;
            IsOpened   = isOpened;
        }