Skip to content

Commit 11b3949

Browse files
authored
Merge pull request #50 from Thundernerd/fix/remove_custom_line_drawing
2 parents e5ef8bb + e7f7cb3 commit 11b3949

9 files changed

+19
-55
lines changed

Editor/Builders/ClassesItemBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private AdvancedDropdownItem GetOrCreateParentItem(Type type, AdvancedDropdownIt
5656
foreach (string split in splits)
5757
{
5858
currentPath += split + '.';
59-
59+
6060
if (splitToItem.TryGetValue(currentPath, out AdvancedDropdownItem foundItem))
6161
{
6262
splitItem = foundItem;

Editor/Builders/SceneItemBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public AdvancedDropdownItem Build()
3535
AdvancedDropdownItem root = new AdvancedDropdownItemWrapper("Scene");
3636

3737
GameObject[] rootGameObjects = scene.Value.GetRootGameObjects();
38-
38+
3939
foreach (GameObject rootGameObject in rootGameObjects)
4040
{
4141
CreateItemsRecursive(rootGameObject.transform, root);
@@ -52,12 +52,12 @@ private void CreateItemsRecursive(Transform transform, AdvancedDropdownItem pare
5252
};
5353

5454
Component[] components = transform.GetComponents(interfaceType);
55-
55+
5656
foreach (Component component in components)
5757
{
5858
advancedDropdownItem.AddChild(new SceneDropdownItem(component));
5959
}
60-
60+
6161
foreach (Transform child in transform)
6262
{
6363
CreateItemsRecursive(child, advancedDropdownItem);

Editor/Drawers/CustomObjectDrawer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public partial class CustomObjectDrawer
2121
public event ClickedDelegate Clicked;
2222
public event DeletePressedDelegate DeletePressed;
2323
public event PropertiesClickedDelegate PropertiesClicked;
24-
24+
2525
public void OnGUI(Rect position, GUIContent label, GUIContent content, SerializedProperty property)
2626
{
2727
Rect positionWithoutThumb = new Rect(position);

Editor/Drawers/RawReferenceDrawer.Styles.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

Editor/Drawers/RawReferenceDrawer.Styles.cs.meta

Lines changed: 0 additions & 3 deletions
This file was deleted.

Editor/Drawers/RawReferenceDrawer.cs

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,19 @@ public void OnGUI(Rect position)
5151

5252
if (rawReferenceValue == null)
5353
return;
54-
55-
DrawLine(position);
54+
5655
DrawProperty(position);
57-
5856
previousPropertyPath = Property.propertyPath;
5957
}
6058

6159
private void DrawProperty(Rect position)
6260
{
63-
Rect objectDrawerRect = new Rect(position);
64-
65-
EditorGUI.PropertyField(objectDrawerRect,
61+
EditorGUI.PropertyField(position,
6662
RawReferenceProperty,
6763
GUIContent.none,
6864
true);
6965
}
7066

71-
private void DrawLine(Rect position)
72-
{
73-
Rect line = new Rect(position)
74-
{
75-
width = 5,
76-
yMin = position.yMin + EditorGUIUtility.singleLineHeight,
77-
x = position.x + EditorGUI.indentLevel * 15 - 9
78-
};
79-
EditorGUI.DrawRect(line, Styles.LineColor);
80-
}
81-
8267
protected override void PingObject(SerializedProperty property)
8368
{
8469
// No support for pinging raw objects for now (I guess this would ping the MonoScript?)
@@ -89,7 +74,7 @@ protected override void OnPropertiesClicked(SerializedProperty property)
8974
{
9075
if (RawReferenceValue == null)
9176
return;
92-
77+
9378
Type type = RawReferenceValue.GetType();
9479
string typeName = type.Name;
9580

@@ -108,12 +93,12 @@ protected override void OnPropertiesClicked(SerializedProperty property)
10893

10994
private void AvoidDuplicateReferencesInArray()
11095
{
111-
if (!ShouldCheckProperty())
96+
if (!ShouldCheckProperty())
11297
return;
11398

11499
object currentReferenceValue = RawReferenceValue;
115100

116-
if (currentReferenceValue == null)
101+
if (currentReferenceValue == null)
117102
return;
118103

119104
if (previousReferenceValue == currentReferenceValue)
@@ -127,8 +112,8 @@ private void AvoidDuplicateReferencesInArray()
127112

128113
private bool ShouldCheckProperty()
129114
{
130-
return IsPropertyInArray(Property) &&
131-
previousPropertyPath != null &&
115+
return IsPropertyInArray(Property) &&
116+
previousPropertyPath != null &&
132117
previousPropertyPath != Property.propertyPath;
133118
}
134119

Editor/Items/NoneDropdownItem.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
namespace TNRD.Items
44
{
5-
public class NoneDropdownItem : AdvancedDropdownItem, IDropdownItem
5+
public class NoneDropdownItem : AdvancedDropdownItem, IDropdownItem
66
{
7-
public NoneDropdownItem() : base("None") { }
7+
public NoneDropdownItem()
8+
: base("None")
9+
{
10+
}
811

912
ReferenceMode IDropdownItem.Mode => ReferenceMode.Raw;
1013

Runtime/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
using System.Runtime.CompilerServices;
22

3-
[assembly:InternalsVisibleTo("TNRD.SerializableInterface.Editor")]
3+
[assembly: InternalsVisibleTo("TNRD.SerializableInterface.Editor")]

Runtime/Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ out TInterface value
3131
value = serializableInterface.Value;
3232
return true;
3333
}
34-
34+
3535
/// <inheritdoc cref="IsDefined{TInterface}"/>
3636
public static bool TryGetValue<TInterface>(
3737
this SerializableInterface<TInterface> serializableInterface,

0 commit comments

Comments
 (0)