Ejemplo n.º 1
0
        void Awake()
        {
            if (cursor)
            {
                _cursor = GameObject.Instantiate(cursor);
            }

            // If no Line Renderer was specified in the editor, check this Transform
            if (lineRenderer == null)
            {
                lineRenderer = GetComponent <LineRenderer>();
            }

            // Line Renderer is positioned using world space
            if (lineRenderer != null)
            {
                lineRenderer.useWorldSpace = true;
            }

            if (EventSystem.current == null)
            {
                Debug.Log("No Event System Found. Creating from scratch");
                GameObject eventSystem = new GameObject("EventSystem");
                eventSystem.AddComponent <EventSystem>();
            }

            uiSystem = EventSystem.current.gameObject.GetComponent <VRUISystem>();

            // Add if one doesn't already exist
            if (uiSystem == null)
            {
                uiSystem = EventSystem.current.gameObject.AddComponent <VRUISystem>();
            }
        }
Ejemplo n.º 2
0
        void Awake()
        {
            if (cursor)
            {
                _cursor = GameObject.Instantiate(cursor);
                _cursor.transform.SetParent(transform);
                _cursorInitialLocalScale = transform.localScale;
            }

            // If no Line Renderer was specified in the editor, check this Transform
            if (lineRenderer == null)
            {
                lineRenderer = GetComponent <LineRenderer>();
            }

            uiSystem = VRUISystem.Instance;
        }
Ejemplo n.º 3
0
        void Awake()
        {
            if (cursor)
            {
                _cursor = GameObject.Instantiate(cursor);
            }

            // If no Line Renderer was specified in the editor, check this Transform
            if (lineRenderer == null)
            {
                lineRenderer = GetComponent <LineRenderer>();
            }

            // Line Renderer is positioned using world space
            if (lineRenderer != null)
            {
                lineRenderer.useWorldSpace = true;
            }

            uiSystem = VRUISystem.Instance;
        }