Last active
February 6, 2019 06:36
-
-
Save fuqunaga/0f90be8ef7f538c6882d22eac5472f41 to your computer and use it in GitHub Desktop.
Log10Slider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float Log10Slider(float v, float min, float max, string label) | |
{ | |
using (new GUILayout.HorizontalScope()) | |
{ | |
GUILayout.Label(label); | |
var log = GUILayout.HorizontalSlider(Mathf.Log10(v), Mathf.Log10(min), Mathf.Log10(max), GUILayout.MinWidth(200f)); | |
v = Mathf.Pow(10, log); | |
v = GUIUtil.Field(v); | |
} | |
return v; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GUIUtil.Field() is here
https://github.com/fuqunaga/PrefsGUI/blob/master/Runtime/GUIUtil/Field.cs