File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -346,7 +346,11 @@ public static void GenerateIndirectAccessForCollectionItemType(string collection
346346
347347 // Delete any existing files that have the old deprecated extension.
348348 string deprecatedFileName = targetFileName + ExtensionOld ;
349+ #if UNITY_2023_1_OR_NEWER
349350 if ( AssetDatabase . AssetPathExists ( deprecatedFileName ) )
351+ #else
352+ if ( AssetDatabase . LoadAssetAtPath < UnityEngine . Object > ( deprecatedFileName ) != null )
353+ #endif
350354 {
351355 Debug . LogWarning ( $ "Deleting deprecated Indirect Access file '{ deprecatedFileName } '.") ;
352356 AssetDatabase . DeleteAsset ( deprecatedFileName ) ;
Original file line number Diff line number Diff line change @@ -114,7 +114,9 @@ internal void DrawCollectionItemDrawer(
114114 {
115115 float originY = position . y ;
116116 position . height = 15 ;
117- Rect prefixPosition = EditorGUI . PrefixLabel ( position , label ) ;
117+ bool shouldDrawLabel = OptionsAttribute . LabelMode != LabelMode . NoLabel ;
118+ Rect prefixPosition = shouldDrawLabel ? EditorGUI . PrefixLabel ( position , label ) : position ;
119+
118120 int indent = EditorGUI . indentLevel ;
119121 EditorGUI . indentLevel = 0 ;
120122 if ( collectionItem != null )
Original file line number Diff line number Diff line change @@ -9,6 +9,13 @@ public enum DrawType
99 AsReference = 1
1010 }
1111
12+ public enum LabelMode
13+ {
14+ Default = 0 ,
15+ NoLabel = 1 ,
16+ //LabelOnSeparateLine = 2, // TODO
17+ }
18+
1219#if UNITY_2022_2_OR_NEWER
1320 [ Obsolete ( "DrawAsSOCItemAttribute is not needed anymore, since Unity 2022 PropertyDrawers can be applied to interfaces" ) ]
1421#endif
@@ -34,7 +41,9 @@ public class SOCItemEditorOptionsAttribute : Attribute
3441 /// If specified, only show collection items that belong to the collection assigned to the specified field.
3542 /// </summary>
3643 public string ConstrainToCollectionField { get ; set ; }
37-
44+
45+ public LabelMode LabelMode { get ; set ; }
46+
3847 /// <summary>
3948 /// If specified, will perform this method whenever the value changes.
4049 /// Parameters of the method should be: ItemType from, ItemType to
@@ -47,4 +56,4 @@ public class SOCItemEditorOptionsAttribute : Attribute
4756 public class CollectionItemEditorOptions : SOCItemEditorOptionsAttribute
4857 {
4958 }
50- }
59+ }
You can’t perform that action at this time.
0 commit comments