You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Editor/DynamicObjectInspector.cs
+79-47Lines changed: 79 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ public override void OnInspectorGUI()
49
49
boolbasicGUIChanged=false;
50
50
EditorGUI.BeginChangeCheck();
51
51
52
+
//consider adding an actual property for id source - instead of infering from useCustomId and objectPool references. should simplify property display in inspector
EditorGUILayout.LabelField(newGUIContent("Id will be generated at runtime","This object will not be included in aggregation metrics on the dashboard"));
143
-
EditorGUI.EndDisabledGroup();
144
-
customId.stringValue=string.Empty;
145
-
useCustomId.boolValue=false;
146
-
idPool.objectReferenceValue=null;
140
+
targetIdType=1;
141
+
idType=1;
147
142
}
148
-
elseif(idType==2)//id pool
143
+
144
+
//check if all selected objects have the same idtype
145
+
foreach(vartintargets)
149
146
{
150
-
EditorGUILayout.ObjectField(idPool,newGUIContent("","Provides a consistent list of Ids to be used at runtime. Allows aggregated data from objects spawned at runtime"));
EditorGUILayout.LabelField(newGUIContent("Id will be generated at runtime","This object will not be included in aggregation metrics on the dashboard"));
174
+
EditorGUI.EndDisabledGroup();
175
+
customId.stringValue=string.Empty;
176
+
useCustomId.boolValue=false;
177
+
idPool.objectReferenceValue=null;
178
+
}
179
+
elseif(idType==2)//id pool
180
+
{
181
+
EditorGUILayout.ObjectField(idPool,newGUIContent("","Provides a consistent list of Ids to be used at runtime. Allows aggregated data from objects spawned at runtime"));
if(GUILayout.Button("New Dynamic Object Id Pool"))//this can overwrite an existing id pool with the same name. should this just find a pool?
174
193
{
175
-
//popup - new pool asset, add to existing pool (if matching mesh name), cancel
176
-
intresult=EditorUtility.DisplayDialogComplex("Found Id Pool","An existing Id Pool with the same mesh name was found. Do you want to use this Id Pool instead?","New Asset","Cancel","Use Existing");
194
+
stringpoolMeshName=dyn.MeshName;
195
+
stringassetPath="Assets/"+poolMeshName+" Id Pool.asset";
//popup - new pool asset, add to existing pool (if matching mesh name), cancel
207
+
intresult=EditorUtility.DisplayDialogComplex("Found Id Pool","An existing Id Pool with the same mesh name was found. Do you want to use this Id Pool instead?","New Asset","Cancel","Use Existing");
0 commit comments