Skip to content
This repository was archived by the owner on Feb 17, 2020. It is now read-only.

Commit d11d011

Browse files
committed
Removed isDirty check
1 parent d9406e2 commit d11d011

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

ExtendedEvent/Assets/ExtendedEvent/Editor/ExtendedEventPropertyDrawer.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public class ExtendedEventPropertyDrawer : PropertyDrawer {
1313
private ExtendedEvent.GameObjectContainer listener;
1414

1515
private SerializedProperty serializedProperty;
16-
private bool isDirty = false;
1716

1817
private void RestoreState( SerializedProperty property ) {
1918
if ( rList == null || eEvent == null ) {
@@ -44,7 +43,6 @@ public override void OnGUI( Rect position, SerializedProperty property, GUIConte
4443
serializedProperty = property;
4544

4645
EditorGUI.BeginProperty( position, label, property );
47-
EditorGUI.BeginChangeCheck();
4846

4947
RestoreState( property );
5048
rList.DoList( position );
@@ -54,10 +52,6 @@ public override void OnGUI( Rect position, SerializedProperty property, GUIConte
5452
} else if ( Event.current.type == EventType.DragPerform ) {
5553
HandlePerformDrag();
5654
}
57-
58-
if ( EditorGUI.EndChangeCheck() ) {
59-
isDirty = true;
60-
}
6155
EditorGUI.EndProperty();
6256
}
6357

@@ -80,11 +74,9 @@ private void HandlePerformDrag() {
8074
if ( item.GetType() == gameObjectType ) {
8175
var gobj = item as GameObject;
8276
eEvent.Listeners.Add( new ExtendedEvent.GameObjectContainer( gobj ) );
83-
isDirty = true;
8477
} else if ( item.GetType().IsSubclassOf( componentType ) ) {
8578
var cmp = item as Component;
8679
eEvent.Listeners.Add( new ExtendedEvent.GameObjectContainer( cmp.gameObject ) );
87-
isDirty = true;
8880
}
8981
}
9082
}
@@ -93,12 +85,9 @@ private void DrawHeaderInternal( Rect rect ) {
9385
EditorGUI.LabelField( rect, header );
9486

9587
if ( serializedProperty.isInstantiatedPrefab ) {
96-
EditorGUI.BeginDisabledGroup( !isDirty );
9788
if ( GUI.Button( new Rect( rect.x + rect.width * 0.85f, rect.y, rect.width * 0.15f, rect.height ), "Apply" ) ) {
98-
isDirty = false;
9989
EditorUtility.SetDirty( serializedProperty.serializedObject.targetObject );
10090
}
101-
EditorGUI.EndDisabledGroup();
10291
}
10392
}
10493

0 commit comments

Comments
 (0)