Exemplo n.º 1
0
 private void func(ref RestricedAxis ra, string s)
 {
     ra.restriced = EditorGUILayout.Toggle("Restrict " + s, ra.restriced);
     if (ra.restriced)
     {
         EditorGUI.indentLevel = 1;
         EditorGUILayout.LabelField("Minimum " + s + ":", ra.min.ToString());
         EditorGUILayout.LabelField("Maximum " + s + ":", ra.max.ToString());
         EditorGUILayout.MinMaxSlider(ref ra.min, ref ra.max, -50, 50);
         EditorGUI.indentLevel = 0;
     }
 }
Exemplo n.º 2
0
 private float func(float f, RestricedAxis ra)
 {
     return(ra.restriced ? Mathf.Clamp(f, ra.min, ra.max) : f);
 }