public static void ToggleLegacy(Object target, string name, ref bool selected, GUIStyle guiStyle, params GUILayoutOption[] options) { bool tempSelected = GUILayout.Toggle(selected, name, guiStyle, options); if (selected != tempSelected) { Undo.RecordObject(target, target.GetType().Name); selected = tempSelected; FullBodyIKEditorUtility.SetDirty(target); } }
public static void ToggleLeft(Object target, string name, ref bool selected) { bool tempSelected = EditorGUILayout.ToggleLeft(name, selected); if (selected != tempSelected) { Undo.RecordObject(target, target.GetType().Name); selected = tempSelected; FullBodyIKEditorUtility.SetDirty(target); } }
public static void Toolbar(Object target, ref int toolbarSelected, string[] toolbarContents) { int tempToolbarSelected = GUILayout.Toolbar(toolbarSelected, toolbarContents); if (toolbarSelected != tempToolbarSelected) { Undo.RecordObject(target, target.GetType().Name); toolbarSelected = tempToolbarSelected; FullBodyIKEditorUtility.SetDirty(target); } }
public static void ObjectField <TYPE_>(Object target, string name, ref TYPE_ obj, bool allowSceneObjects, params GUILayoutOption[] options) where TYPE_ : Object { TYPE_ tempObj = (TYPE_)EditorGUILayout.ObjectField(name, obj, typeof(TYPE_), allowSceneObjects, options); if (obj != tempObj) { Undo.RecordObject(target, target.GetType().Name); obj = tempObj; FullBodyIKEditorUtility.SetDirty(target); } }
public static void HorizonalSlider(Object target, ref float value, float minValue, float maxValue, params GUILayoutOption[] options) { EditorGUI.BeginChangeCheck(); float tempValue = GUILayout.HorizontalSlider(value, minValue, maxValue, options); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(target, target.GetType().Name); value = tempValue; FullBodyIKEditorUtility.SetDirty(target); } }
public static void FloatField(Object target, string name, ref float value, params GUILayoutOption[] options) { EditorGUI.BeginChangeCheck(); float tempValue = EditorGUILayout.FloatField(name, value, options); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(target, target.GetType().Name); value = tempValue; FullBodyIKEditorUtility.SetDirty(target); } }
public static void TransformField(Object target, string name, ref Transform obj, bool allowSceneObjects, params GUILayoutOption[] options) { Transform tempObj = (Transform)EditorGUILayout.ObjectField(name, obj, typeof(Transform), allowSceneObjects, options); if (obj != tempObj) { if (tempObj != null && target is Component) { GameObject go = ((Component)target).gameObject; if (!tempObj.IsChildOf(go.transform)) { return; } } Undo.RecordObject(target, target.GetType().Name); obj = tempObj; FullBodyIKEditorUtility.SetDirty(target); } }