public override void OnInspectorGUI() { if (Event.current.type == EventType.Repaint) { _dragRects.Clear(); _dropRects.Clear(); } Attributes = serializedObject.targetObject.GetType().GetCustomAttributes(false).Cast <Attribute>().ToList(); //if(Attributes.Exists(o => o is PerunDrawerAttribute)) { EditorGUI.BeginChangeCheck(); serializedObject.Update(); PropertyData = new PropertyData(serializedObject); Generic.Draw(PropertyData); DragUpdate(); DropUpdate(); serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); if (GUI.changed) { Repaint(); } } //else // base.OnInspectorGUI(); }
public override void OnInspectorGUI() { if (Event.current.type == EventType.Repaint) { _dragRects.Clear(); _dropRects.Clear(); } //Stopwatch SW = new Stopwatch(); //SW.Start(); if (PerunSettings.Enabled) //if(Attributes.Exists(o => o is PerunDrawerAttribute)) { Attributes = serializedObject.targetObject.GetType().GetCustomAttributes(false).Cast <Attribute>().ToList(); EditorGUI.BeginChangeCheck(); serializedObject.Update(); PropertyData = new PropertyData(serializedObject); Generic.Draw(PropertyData); DragUpdate(); DropUpdate(); serializedObject.ApplyModifiedProperties(); EditorGUI.EndChangeCheck(); if (GUI.changed) { Repaint(); } } else { base.OnInspectorGUI(); } //SW.Stop(); //EditorGUILayout.Space(); //EditorGUILayout.LabelField("Draw time: " + SW.ElapsedMilliseconds + " ms."); }