@@ -14,13 +14,15 @@ internal readonly struct SerializedTypeReference
1414 private readonly SerializedObject _parentObject ;
1515 private readonly SerializedProperty _guidProperty ;
1616 private readonly SerializedProperty _guidAssignmentFailedProperty ;
17+ private readonly SerializedProperty _suppressLogs ;
1718
1819 public SerializedTypeReference ( SerializedProperty typeReferenceProperty )
1920 {
2021 _parentObject = typeReferenceProperty . serializedObject ;
2122 TypeNameProperty = typeReferenceProperty . FindPropertyRelative ( nameof ( TypeReference . _typeNameAndAssembly ) ) ;
2223 _guidProperty = typeReferenceProperty . FindPropertyRelative ( nameof ( TypeReference . GUID ) ) ;
2324 _guidAssignmentFailedProperty = typeReferenceProperty . FindPropertyRelative ( nameof ( TypeReference . GuidAssignmentFailed ) ) ;
25+ _suppressLogs = typeReferenceProperty . FindPropertyRelative ( nameof ( TypeReference . _suppressLogs ) ) ;
2426
2527 FindGuidIfAssignmentFailed ( ) ;
2628 }
@@ -31,17 +33,39 @@ public string TypeNameAndAssembly
3133 set => SetTypeNameAndAssembly ( value ) ;
3234 }
3335
36+ public bool SuppressLogs
37+ {
38+ get => _suppressLogs . boolValue ;
39+ set
40+ {
41+ _suppressLogs . boolValue = value ;
42+ _parentObject . ApplyModifiedProperties ( ) ;
43+ }
44+ }
45+
3446 public bool TypeNameHasMultipleDifferentValues => TypeNameProperty . hasMultipleDifferentValues ;
3547
3648 private bool GuidAssignmentFailed
3749 {
3850 get => _guidAssignmentFailedProperty . boolValue ;
3951 // Used in C# 8
40- [ UsedImplicitly ] set => SetGUIDAssignmentFailed ( value ) ;
52+ [ UsedImplicitly ]
53+ set
54+ {
55+ _guidAssignmentFailedProperty . boolValue = value ;
56+ _parentObject . ApplyModifiedProperties ( ) ;
57+ }
4158 }
4259
4360 // Used in C# 8
44- [ UsedImplicitly ] private string GUID { set => SetGUID ( value ) ; }
61+ [ UsedImplicitly ] private string GUID
62+ {
63+ set
64+ {
65+ _guidProperty . stringValue = value ;
66+ _parentObject . ApplyModifiedProperties ( ) ;
67+ }
68+ }
4569
4670 [ SuppressMessage ( "ReSharper" , "MemberCanBePrivate.Global" ,
4771 Justification = "The method is used by TypeFieldDrawer in C# 7" ) ]
@@ -59,18 +83,6 @@ public void SetType(Type type)
5983 _parentObject . ApplyModifiedProperties ( ) ;
6084 }
6185
62- private void SetGUIDAssignmentFailed ( bool value )
63- {
64- _guidAssignmentFailedProperty . boolValue = value ;
65- _parentObject . ApplyModifiedProperties ( ) ;
66- }
67-
68- private void SetGUID ( string value )
69- {
70- _guidProperty . stringValue = value ;
71- _parentObject . ApplyModifiedProperties ( ) ;
72- }
73-
7486 private static string GetClassGuidFromTypeName ( string typeName )
7587 {
7688 var type = Type . GetType ( typeName ) ;
0 commit comments