Skip to content

Commit a05110a

Browse files
committed
feat: Added SerializedTypeReference.SetType(Type type) method
1 parent e5a69ca commit a05110a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Editor/Util/SerializedTypeReference.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ public void SetTypeNameAndAssembly(string value)
5252
_parentObject.ApplyModifiedProperties();
5353
}
5454

55+
public void SetType(Type type)
56+
{
57+
_typeNameProperty.stringValue = TypeReference.GetTypeNameAndAssembly(type);
58+
_guidProperty.stringValue = TypeReference.GetClassGUID(type);
59+
_parentObject.ApplyModifiedProperties();
60+
}
61+
5562
private void SetGUIDAssignmentFailed(bool value)
5663
{
5764
_guidAssignmentFailedProperty.boolValue = value;

0 commit comments

Comments
 (0)