@@ -28,8 +28,7 @@ public class ThemeInspector : Editor
2828 {
2929 protected SerializedProperty settings ;
3030
31- protected static string [ ] themeOptions ;
32- protected static Type [ ] themeTypes ;
31+ protected static InteractableTypesContainer themeOptions ;
3332 protected static string [ ] shaderOptions ;
3433 protected static State [ ] themeStates ;
3534
@@ -185,9 +184,7 @@ protected virtual State[] GetStates()
185184
186185 protected void SetupThemeOptions ( )
187186 {
188- InteractableProfileItem . ThemeLists lists = InteractableProfileItem . GetThemeTypes ( ) ;
189- themeOptions = lists . Names . ToArray ( ) ;
190- themeTypes = lists . Types . ToArray ( ) ;
187+ themeOptions = InteractableProfileItem . GetThemeTypes ( ) ;
191188 }
192189
193190 protected virtual void AddThemeProperty ( int [ ] arr , SerializedProperty prop = null )
@@ -209,13 +206,16 @@ protected virtual void AddThemePropertySettings(SerializedProperty themeSettings
209206 {
210207 SerializedProperty settingsItem = themeSettings . GetArrayElementAtIndex ( themeSettings . arraySize - 1 ) ;
211208 SerializedProperty className = settingsItem . FindPropertyRelative ( "Name" ) ;
209+ SerializedProperty assemblyQualifiedName = settingsItem . FindPropertyRelative ( "AssemblyQualifiedName" ) ;
212210 if ( themeSettings . arraySize == 1 )
213211 {
214212 className . stringValue = "ScaleOffsetColorTheme" ;
213+ assemblyQualifiedName . stringValue = typeof ( ScaleOffsetColorTheme ) . AssemblyQualifiedName ;
215214 }
216215 else
217216 {
218- className . stringValue = themeOptions [ 0 ] ;
217+ className . stringValue = themeOptions . ClassNames [ 0 ] ;
218+ assemblyQualifiedName . stringValue = themeOptions . AssemblyQualifiedNames [ 0 ] ;
219219 }
220220
221221 SerializedProperty easing = settingsItem . FindPropertyRelative ( "Easing" ) ;
@@ -244,21 +244,19 @@ public static SerializedProperty ChangeThemeProperty(int index, SerializedProper
244244
245245 SerializedProperty className = settingsItem . FindPropertyRelative ( "Name" ) ;
246246
247- InteractableProfileItem . ThemeLists lists = InteractableProfileItem . GetThemeTypes ( ) ;
248- string [ ] options = lists . Names . ToArray ( ) ;
249- Type [ ] types = lists . Types . ToArray ( ) ;
247+ InteractableTypesContainer themeTypes = InteractableProfileItem . GetThemeTypes ( ) ;
250248
251249 // get class value types
252250 if ( ! String . IsNullOrEmpty ( className . stringValue ) )
253251 {
254- int propIndex = InspectorUIUtility . ReverseLookup ( className . stringValue , options ) ;
252+ int propIndex = InspectorUIUtility . ReverseLookup ( className . stringValue , themeTypes . ClassNames ) ;
255253 GameObject renderHost = null ;
256254 if ( target != null )
257255 {
258256 renderHost = ( GameObject ) target . objectReferenceValue ;
259257 }
260258
261- InteractableThemeBase themeBase = ( InteractableThemeBase ) Activator . CreateInstance ( types [ propIndex ] , renderHost ) ;
259+ InteractableThemeBase themeBase = ( InteractableThemeBase ) Activator . CreateInstance ( themeTypes . Types [ propIndex ] , renderHost ) ;
262260
263261 // does this object have the right component types
264262 SerializedProperty isValid = settingsItem . FindPropertyRelative ( "IsValid" ) ;
@@ -766,7 +764,7 @@ public static SerializedProperty SerializeThemeValues(InteractableThemePropertyV
766764 return copyTo ;
767765 }
768766
769- public static void RenderThemeSettings ( SerializedProperty themeSettings , SerializedObject themeObj , string [ ] themeOptions , SerializedProperty gameObject , int [ ] listIndex , State [ ] states )
767+ public static void RenderThemeSettings ( SerializedProperty themeSettings , SerializedObject themeObj , InteractableTypesContainer themeOptions , SerializedProperty gameObject , int [ ] listIndex , State [ ] states )
770768 {
771769 GUIStyle box = InspectorUIUtility . Box ( 0 ) ;
772770 if ( themeObj != null )
@@ -784,10 +782,10 @@ public static void RenderThemeSettings(SerializedProperty themeSettings, Seriali
784782 EditorGUILayout . BeginVertical ( box ) ;
785783 // a dropdown for the type of theme, they should make sense
786784 // show theme dropdown
787- int id = InspectorUIUtility . ReverseLookup ( className . stringValue , themeOptions ) ;
785+ int id = InspectorUIUtility . ReverseLookup ( className . stringValue , themeOptions . ClassNames ) ;
788786
789787 EditorGUILayout . BeginHorizontal ( ) ;
790- int newId = EditorGUILayout . Popup ( "Theme Property" , id , themeOptions ) ;
788+ int newId = EditorGUILayout . Popup ( "Theme Property" , id , themeOptions . ClassNames ) ;
791789
792790 if ( n > 0 )
793791 {
@@ -809,7 +807,9 @@ public static void RenderThemeSettings(SerializedProperty themeSettings, Seriali
809807
810808 if ( id != newId )
811809 {
812- className . stringValue = themeOptions [ newId ] ;
810+ SerializedProperty assemblyQualifiedName = settingsItem . FindPropertyRelative ( "AssemblyQualifiedName" ) ;
811+ className . stringValue = themeOptions . ClassNames [ newId ] ;
812+ assemblyQualifiedName . stringValue = themeOptions . AssemblyQualifiedNames [ newId ] ;
813813
814814 // add the themeOjects if in a profile?
815815 //themeObj = ChangeThemeProperty(n, themeObj, gameObject);
0 commit comments