private void OnEnable() { mulitpleInputManagerError = FindObjectsOfType <UltimateRadialMenuInputManager>().Length > 1; targ = ( UltimateRadialMenuInputManager )target; worldSpaceMenus = false; UltimateRadialMenu[] allMenus = FindObjectsOfType <UltimateRadialMenu>(); for (int i = 0; i < allMenus.Length; i++) { if (allMenus[i].IsWorldSpaceRadialMenu) { worldSpaceMenus = true; break; } } }
void Awake() { // If this input manager is not located on the event system... if (!GetComponent <EventSystem>()) { // Log an error to the user explaining the issue and what to do to fix it. Debug.LogError("Ultimate Radial Menu Input Manager\nThis component is not attached to the EventSystem in your scene. Please make sure that you have only one Ultimate Radial Menu Input Manager in your scene and that it is located on the EventSystem."); // Destroy this component and return. Destroy(this); return; } // Assign the instance as this. Instance = this; UltimateRadialMenuInformations = new List <UltimateRadialMenuInfomation>(); }
void Awake() { // If this input manager is not located on the event system... if (!GetComponent <EventSystem>()) { // If the event system in the scene does not have a input manager, then add one to it. if (!FindObjectOfType <EventSystem>().GetComponent <UltimateRadialMenuInputManager>()) { FindObjectOfType <EventSystem>().gameObject.AddComponent <UltimateRadialMenuInputManager>(); } // Destroy this component and return. Destroy(this); return; } // Assign the instance as this. Instance = this; }
private void OnEnable() { mulitpleInputManagerError = FindObjectsOfType <UltimateRadialMenuInputManager>().Length > 1; targ = ( UltimateRadialMenuInputManager )target; }