void Awake() { if (Application.isPlaying) { if (Controller == CurvedUIController.VIVE) { #if CURVEDUI_VIVE //Remove all other InputModules from event system and add the ViveInputModule. GameObject eventGO = EventSystem.current.gameObject; foreach (BaseInputModule module in eventGO.GetComponents <BaseInputModule>()) { if (!(module is CurvedUIViveInputModule)) { module.enabled = false; } } CurvedUIViveInputModule viveInput = eventGO.GetComponent <CurvedUIViveInputModule>(); if (viveInput == null) { viveInput = eventGO.AddComponent <CurvedUIViveInputModule>(); } viveInput.EventController = usedViveController; #else Debug.LogWarning("Add CURVEDUI_VIVE to your platform custom defines to enable Vive support in CurvedUI."); #endif } } }
//not using these now, but may come handy later: //private Vector2 rightControllerTouchPos = Vector2.zero; //private Vector2 leftControllerTouchPos = Vector2.zero; //private bool rightDown = false; //private bool leftDown = false; #endregion #region LIFECYCLE protected override void Awake() { instance = this; base.Awake(); SetupControllers(); }