Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [CustomEditor(typeof(ScriptableIntVariable))]
- [CanEditMultipleObjects]
- public abstract class ScriptableIntVariableEditor : Editor
- {
- SerializedProperty value;
- void OnEnable()
- {
- value = serializedObject.FindProperty("Inspector_Value");
- }
- public override void OnInspectorGUI()
- {
- serializedObject.Update();
- EditorGUILayout.PropertyField(value, new GUIContent("Value"));
- serializedObject.ApplyModifiedProperties();
- if (targets != null)
- foreach (var x in targets)
- {
- ScriptableIntVariable y = (x as ScriptableIntVariable);
- if (y)
- {
- y.Value = y.Inspector_Value;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment