// ------------------ public void Draw(JoystickStateBinding bind, InputRig rig) { bool bindingEnabled = bind.enabled; EditorGUILayout.BeginVertical(); if (bindingEnabled = EditorGUILayout.ToggleLeft(this.labelContent, bindingEnabled, GUILayout.MinWidth(30))) { InspectorUtils.BeginIndentedSection(); this.horzAxisInspector.Draw(bind.horzAxisBinding, rig); this.vertAxisInspector.Draw(bind.vertAxisBinding, rig); this.dirInspector.Draw(bind.dirBinding, rig); InspectorUtils.EndIndentedSection(); GUILayout.Space(InputBindingGUIUtils.VERT_MARGIN); } EditorGUILayout.EndVertical(); if ((bindingEnabled != bind.enabled)) { CFGUI.CreateUndo("Joy State Binding modification.", this.undoObject); bind.enabled = bindingEnabled; CFGUI.EndUndo(this.undoObject); } }
// ----------------- public TouchJoystick() : base() { this.joyStateBinding = new JoystickStateBinding(); this.pressBinding = new DigitalBinding(); this.centerWhenFollowing = false; this.config = new JoystickConfig(); this.state = new JoystickState(this.config); }