Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,15 @@ private static void ShowContextMenu(SerializedProperty property, Type fieldType)
{
var path = candidate.Path;
menu.AddItem(new GUIContent($"Link to Existing/{candidate.Type.Name} ({path})"), false,
() => SerializeReferenceLinker.LinkTo(property, path));
() => SerializeReferenceLinker.LinkTo(persistent, path));
}

// Generate a new subclass of the field's type and assign it once it compiles.
if (fieldType != null)
menu.AddItem(new GUIContent("Create New Script…"), false, () =>
{
if (SerializeReferenceScriptCreator.TryCreateSubclassStub(fieldType, out _, out var fullTypeName))
SerializeReferencePendingAssignment.Enqueue(property.serializedObject.targetObject, property.propertyPath, fullTypeName);
SerializeReferencePendingAssignment.Enqueue(persistent.serializedObject.targetObject, persistent.propertyPath, fullTypeName);
});

// Save the current instance as a durable named template, and paste any assignable saved template.
Expand All @@ -358,7 +358,7 @@ private static void ShowContextMenu(SerializedProperty property, Type fieldType)
{
if (fieldType != null && !fieldType.IsAssignableFrom(template.Type)) continue;
var name = template.Name;
menu.AddItem(new GUIContent($"Paste Template/{name}"), false, () => ApplyTemplate(property, name));
menu.AddItem(new GUIContent($"Paste Template/{name}"), false, () => ApplyTemplate(persistent, name));
}

menu.ShowAsContext();
Expand Down
Loading