Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Editor/Builders/ClassesItemBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private AdvancedDropdownItem GetOrCreateParentItem(Type type, AdvancedDropdownIt
foreach (string split in splits)
{
currentPath += split + '.';

if (splitToItem.TryGetValue(currentPath, out AdvancedDropdownItem foundItem))
{
splitItem = foundItem;
Expand Down
6 changes: 3 additions & 3 deletions Editor/Builders/SceneItemBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public AdvancedDropdownItem Build()
AdvancedDropdownItem root = new AdvancedDropdownItemWrapper("Scene");

GameObject[] rootGameObjects = scene.Value.GetRootGameObjects();

foreach (GameObject rootGameObject in rootGameObjects)
{
CreateItemsRecursive(rootGameObject.transform, root);
Expand All @@ -52,12 +52,12 @@ private void CreateItemsRecursive(Transform transform, AdvancedDropdownItem pare
};

Component[] components = transform.GetComponents(interfaceType);

foreach (Component component in components)
{
advancedDropdownItem.AddChild(new SceneDropdownItem(component));
}

foreach (Transform child in transform)
{
CreateItemsRecursive(child, advancedDropdownItem);
Expand Down
2 changes: 1 addition & 1 deletion Editor/Drawers/CustomObjectDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class CustomObjectDrawer
public event ClickedDelegate Clicked;
public event DeletePressedDelegate DeletePressed;
public event PropertiesClickedDelegate PropertiesClicked;

public void OnGUI(Rect position, GUIContent label, GUIContent content, SerializedProperty property)
{
Rect positionWithoutThumb = new Rect(position);
Expand Down
21 changes: 0 additions & 21 deletions Editor/Drawers/RawReferenceDrawer.Styles.cs

This file was deleted.

3 changes: 0 additions & 3 deletions Editor/Drawers/RawReferenceDrawer.Styles.cs.meta

This file was deleted.

29 changes: 7 additions & 22 deletions Editor/Drawers/RawReferenceDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,19 @@ public void OnGUI(Rect position)

if (rawReferenceValue == null)
return;

DrawLine(position);

DrawProperty(position);

previousPropertyPath = Property.propertyPath;
}

private void DrawProperty(Rect position)
{
Rect objectDrawerRect = new Rect(position);

EditorGUI.PropertyField(objectDrawerRect,
EditorGUI.PropertyField(position,
RawReferenceProperty,
GUIContent.none,
true);
}

private void DrawLine(Rect position)
{
Rect line = new Rect(position)
{
width = 5,
yMin = position.yMin + EditorGUIUtility.singleLineHeight,
x = position.x + EditorGUI.indentLevel * 15 - 9
};
EditorGUI.DrawRect(line, Styles.LineColor);
}

protected override void PingObject(SerializedProperty property)
{
// No support for pinging raw objects for now (I guess this would ping the MonoScript?)
Expand All @@ -89,7 +74,7 @@ protected override void OnPropertiesClicked(SerializedProperty property)
{
if (RawReferenceValue == null)
return;

Type type = RawReferenceValue.GetType();
string typeName = type.Name;

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

private void AvoidDuplicateReferencesInArray()
{
if (!ShouldCheckProperty())
if (!ShouldCheckProperty())
return;

object currentReferenceValue = RawReferenceValue;

if (currentReferenceValue == null)
if (currentReferenceValue == null)
return;

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

private bool ShouldCheckProperty()
{
return IsPropertyInArray(Property) &&
previousPropertyPath != null &&
return IsPropertyInArray(Property) &&
previousPropertyPath != null &&
previousPropertyPath != Property.propertyPath;
}

Expand Down
7 changes: 5 additions & 2 deletions Editor/Items/NoneDropdownItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

namespace TNRD.Items
{
public class NoneDropdownItem : AdvancedDropdownItem, IDropdownItem
public class NoneDropdownItem : AdvancedDropdownItem, IDropdownItem
{
public NoneDropdownItem() : base("None") { }
public NoneDropdownItem()
: base("None")
{
}

ReferenceMode IDropdownItem.Mode => ReferenceMode.Raw;

Expand Down
2 changes: 1 addition & 1 deletion Runtime/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;

[assembly:InternalsVisibleTo("TNRD.SerializableInterface.Editor")]
[assembly: InternalsVisibleTo("TNRD.SerializableInterface.Editor")]
2 changes: 1 addition & 1 deletion Runtime/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ out TInterface value
value = serializableInterface.Value;
return true;
}

/// <inheritdoc cref="IsDefined{TInterface}"/>
public static bool TryGetValue<TInterface>(
this SerializableInterface<TInterface> serializableInterface,
Expand Down