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>(); } }
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; }
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; }