public override void EditorContent(VisualElement element) { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); GUILayout.Label("Left Hand", GestureManagerStyles.GuiHandTitle); Manager.left = GestureManagerEditor.OnCheckBoxGuiHand(Manager, GestureHand.Left, Manager.left, position => 0); GUILayout.EndVertical(); GUILayout.BeginVertical(); GUILayout.Label("Right Hand", GestureManagerStyles.GuiHandTitle); Manager.right = GestureManagerEditor.OnCheckBoxGuiHand(Manager, GestureHand.Right, Manager.right, position => 0); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(4); GmgLayoutHelper.Divisor(1); GUILayout.Label("Radial Menu", GestureManagerStyles.GuiHandTitle); GUILayout.Label("", GUILayout.ExpandWidth(true), GUILayout.Height(RadialMenu.Size)); var extraSize = RadialMenu.Render(element, GmgLayoutHelper.GetLastRect(ref _rect)) - RadialMenu.Size; if (extraSize > 0) { GUILayout.Label("", GUILayout.ExpandWidth(true), GUILayout.Height(extraSize)); } if (_radialDescription != null) { ShowRadialDescription(); } }
public override void EditorContent(VisualElement element) { GUILayout.Space(15); GmgLayoutHelper.MyToolbar(ref _toolBar, new[] { new GmgLayoutHelper.GmgToolbarRow("Gestures", () => { if (Manager.emote != 0 || Manager.onCustomAnimation) { GUILayout.BeginHorizontal(GestureManagerStyles.EmoteError); GUILayout.Label("Gesture doesn't work while you're playing an emote!"); if (GUILayout.Button("Stop!", GestureManagerStyles.GuiGreenButton)) { Manager.StopCurrentEmote(); } GUILayout.EndHorizontal(); } GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); GUILayout.Label("Left Hand", GestureManagerStyles.GuiHandTitle); Manager.left = GestureManagerEditor.OnCheckBoxGuiHand(Manager, GestureHand.Left, Manager.left, position => 0); GUILayout.EndVertical(); GUILayout.BeginVertical(); GUILayout.Label("Right Hand", GestureManagerStyles.GuiHandTitle); Manager.right = GestureManagerEditor.OnCheckBoxGuiHand(Manager, GestureHand.Right, Manager.right, position => 0); GUILayout.EndVertical(); GUILayout.EndHorizontal(); }), new GmgLayoutHelper.GmgToolbarRow("Emotes", () => { GUILayout.Label("Emotes", GestureManagerStyles.GuiHandTitle); GestureManagerEditor.OnEmoteButton(Manager, 1); GestureManagerEditor.OnEmoteButton(Manager, 2); GestureManagerEditor.OnEmoteButton(Manager, 3); GestureManagerEditor.OnEmoteButton(Manager, 4); GestureManagerEditor.OnEmoteButton(Manager, 5); GestureManagerEditor.OnEmoteButton(Manager, 6); GestureManagerEditor.OnEmoteButton(Manager, 7); GestureManagerEditor.OnEmoteButton(Manager, 8); }), new GmgLayoutHelper.GmgToolbarRow("Test Animation", () => { GUILayout.Label("Force animation.", GestureManagerStyles.GuiHandTitle); GUILayout.BeginHorizontal(); var lastAnim = _selectingCustomAnim; _selectingCustomAnim = (AnimationClip)EditorGUILayout.ObjectField("Animation: ", _selectingCustomAnim, typeof(AnimationClip), true, null); if (_selectingCustomAnim != lastAnim) { Manager.SetCustomAnimation(_selectingCustomAnim); } if (Manager.onCustomAnimation) { if (GUILayout.Button("Stop", GestureManagerStyles.GuiGreenButton)) { Manager.OnCustomEmoteStop(); } } else { if (GUILayout.Button("Play", GUILayout.Width(100))) { Manager.StopCurrentEmote(); Manager.SetCustomAnimation(_selectingCustomAnim); Manager.OnCustomEmoteStart(); } } GUILayout.EndHorizontal(); }) }); }