Ejemplo n.º 1
0
        public static void FloatInput(string in_label, ref float in_currentValue, string in_savedName)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(in_label + ": ", GUILayout.MaxWidth(MaxWidth));
            var tmpvar = EditorGUILayout.FloatField(in_currentValue);

            if (!string.IsNullOrEmpty(in_savedName) && Math.Abs(tmpvar - in_currentValue) > float.Epsilon)
            {
                Google2uGUIUtil.SetFloat(in_savedName, tmpvar);
            }
            in_currentValue = tmpvar;
            EditorGUILayout.EndHorizontal();
        }