Guest User

Untitled

a guest
Feb 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. [CustomEditor(typeof(ScriptableIntVariable))]
  2. [CanEditMultipleObjects]
  3. public abstract class ScriptableIntVariableEditor : Editor
  4. {
  5. SerializedProperty value;
  6.  
  7. void OnEnable()
  8. {
  9. value = serializedObject.FindProperty("Inspector_Value");
  10. }
  11. public override void OnInspectorGUI()
  12. {
  13. serializedObject.Update();
  14. EditorGUILayout.PropertyField(value, new GUIContent("Value"));
  15. serializedObject.ApplyModifiedProperties();
  16. if (targets != null)
  17. foreach (var x in targets)
  18. {
  19. ScriptableIntVariable y = (x as ScriptableIntVariable);
  20. if (y)
  21. {
  22. y.Value = y.Inspector_Value;
  23. }
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment