Unity IMGUI extensions for Rapid prototyping/development.
The package is available on the openupm registry. It's recommended to install it via openupm-cli.
openupm add ga.fuquna.rapidgui
Add following lines to the dependencies
section of the Packages/manifest.json
.
"ga.fuquna.rapidgui": "https://github.com/fuqunaga/RapidGUI.git"
Download a .unitypackage
file from the Release page.
- Open and checkout the RapidGUI/Example/RapidGUIExample.unity
- see also the usage from the script below RapidGUI/Example/Scripts/
value = RGUI.Field(value, label);
- Display standard GUI according to type of value
- Right-drag label to edit numbers
- Color picker
- Array/List has a right-click menu like inspector
- Supports custom class
Serializing but ignoring in RGUI.Field
With this attribute you can serialize field by Unity to change some values from editor, but can hide this field in RGUI.Field for some reasons, for example, perfomance (Suitable for long List's)
public class GameConfig
{
public float unitSpeed;
[RGUIIgnore]
public List<UnitConfigInfo> unitConfigs;
{
CustomClass
public class CustomClass
{
public int publicField;
[SerializeField]
protected int serializeField;
[NonSerialized]
public int nonSerializedField;
[Range(0f, 10f)]
public float rangeVal;
public string longNameFieldWillBeMultiLine;
}
customClass = RGUI.Field(customClass, nameof(customClass));
value = RGUI.Slider(value, min, max, label);
- Display slider GUI according to type of numbers
RGUI.MinMaxSlider(minMaxVal, minMaxRange, label);
RGUI.MinMaxSlider(ref floatMin, ref floatMax, rangeMin, rangeMax, label);
- Display min max slider GUI according to type of numbers
- RapidGUI defines some basic MinMax type(
MinMaxInt
,MinMaxFloat
,MinMaxVector2
...) - You can also create your own MinMax type by inheriting
MinMax<T>
selectionPopupIdx = RGUI.SelectionPopup(selectionPopupIdx, new[] { "One", "Two", "Three" });
selectionPopupStr = RGUI.SelectionPopup(selectionPopupStr, new[] { "One", "Two", "Three" });
// Initialize
fold = new Fold("Fold");
fold.Add(() => GUILayout.Label("Added function"));
fold.DoGUI();
// Initialize
launcher = new WindowLauncher("WindowLauncher");
launcher.Add(() => GUILayout.Label("Added function"));
launcher.DoGUI();
- Toggle open/close window
- Resizable
- Has a close button
- WindowLaunchers automatically adjusts the layout when opening a window
Please check the usage from the script below RapidGUI/Example/Scripts/
the object is a RapidGUI settings and update hooks. If not in the scene, it will be generated automatically.
See PrefsGUI
- unity-immediate-color-picker https://github.com/mattatz/unity-immediate-color-picker
- PrefsGUI https://github.com/fuqunaga/PrefsGUI