Ejemplo n.º 1
0
        private void OnGUI()
        {
            EnsureGUIStyles();

            if (m_keyBindingData == null)
            {
                m_keyBindingData = (KeyBindingData)Resources.Load(ConstantVar.ResourcesPath.XR_CONTROLLER_DATA);
                return;
            }

            Undo.RecordObject(m_keyBindingData, "KeyBindingData");

            if (m_currentHierarchyTabState != HierarchyTabState.None)
            {
                DrawMainPanel();
            }

            UpdateHierarchyPanelWidth();
            DrawHierarchyPanel();
            DrawTopBar();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(m_keyBindingData);
            }
        }
Ejemplo n.º 2
0
        private void OnEnable()
        {
            IsOpen = true;

            EditorApplication.playModeStateChanged += HandlePlayModeChanged;
            m_isDisposed = false;
            if (m_keyBindingData == null)
            {
                m_keyBindingData = (KeyBindingData)Resources.Load(ConstantVar.ResourcesPath.XR_CONTROLLER_DATA);
            }
        }
Ejemplo n.º 3
0
        private void InitKeyBindingData()
        {
            KeyBindingData keyBindingData = Resources.Load <KeyBindingData>(ConstantVar.ResourcesPath.XR_CONTROLLER_DATA);

            if (keyBindingData != null)
            {
                try
                {
                    keyMapped = keyBindingData.controllerList.Find((obj) => (obj.deviceType == (int)deviceType && (obj.hand == HandType))).keyMappingList.ToArray();
                }
                catch (NullReferenceException e)
                {
                    Debug.LogError("KEY MAPPING NOT FOUND IN DATA FOR \nDevice: " + deviceType + " InputDevice: " + device.name);
                }
            }
        }