After a little effort learning the Custom Editor this is the new result. Quite a dramatic difference from what I originally wanted after a little inspiration from Mike’s post. Code is beneath if it can help anyone out (not very well-commented but might be useful!)

import System.Collections.Generic; // So I can use lists
@CustomEditor (LevelData)
class LevelData_CustomInspector extends Editor
{
var levelIndex = 0;
var areaIndex = List.<int>();
var roundIndex = List.<List.<int> >();
function Awake()
{
// Reset
//ResetValues();
// Retrieve all inspector window selections
levelIndex = EditorPrefs.GetInt("levelIndex", 0); // Levels
// Areas
if ( !EditorPrefs.HasKey("areaIndex") )
return;
var areaArray : int[] = EditorPrefsX.GetIntArray ("areaIndex");
for ( var i = 0; i < areaArray.Length; i++ )
{ areaIndex.Add(areaArray*); }*
-
// Rounds*
-
i = 0;*
-
while ( EditorPrefs.HasKey("roundIndex"+i) )*
-
{*
-
var roundIndex_temp = List.<int>();*
-
var roundArray : int[] = EditorPrefsX.GetIntArray ("roundIndex"+i);*
-
for ( var j = 0; j < roundArray.Length; j++ )*
-
roundIndex_temp.Add(roundArray[j]); *
-
roundIndex.Add(roundIndex_temp);*
-
i++;*
-
}*
-
}*
-
function ResetValues()*
-
{ // Resets all stored values*
-
EditorPrefs.DeleteKey("levelIndex");*
-
EditorPrefs.DeleteKey("areaIndex");*
-
var i = 0;*
-
while ( EditorPrefs.HasKey("roundIndex"+i) )*
-
{*
-
EditorPrefs.DeleteKey("roundIndex"+i);*
-
i++;*
-
}*
-
Debug.Log("All stored values reset");*
-
}*
-
function OnDestroy()*
-
{*
-
// Save all inspector window selections*
-
EditorPrefs.SetInt("levelIndex", levelIndex); // Levels*
-
// Areas (check that areas exist)*
-
if ( areaIndex.Count < 1 )*
-
return;*
-
var areaArray : int[] = areaIndex.ToArray();*
-
EditorPrefsX.SetIntArray ("areaIndex", areaArray);*
-
// Rounds (check that rounds exist)*
-
for ( var i = 0; i < roundIndex.Count; i++ )*
-
{*
_ if ( roundIndex*.Count > 0 )_
_ var tempArray : int[] = roundIndex.ToArray();
else*
* tempArray[0] = 0;
EditorPrefsX.SetIntArray (“roundIndex”+i, tempArray);
}
}*_
* function OnInspectorGUI()*
* {*
* GUILayout.Space (20);*
* // Level select*
* GUILayout.BeginHorizontal();*
* var parsedLevels = new String[target.levels.Count];*
* for ( var i = 0; i < parsedLevels.Length; i++ )*
_ { parsedLevels = "Level " + (i+1).ToString(); }
* levelIndex = GUILayout.Toolbar ( levelIndex, parsedLevels, EditorStyles.toolbarButton );
GUILayout.Space (10);
if ( GUILayout.Button(“+”, EditorStyles.toolbarButton, GUILayout.Width(50)) )
{
if ( target.levels.Count < 8 )
{
target.levels.Add(target.Levels);
areaIndex.Add(0); // Also increase areaIndex array*
* roundIndex.Add( new List.() ); // Also increase roundIndex array 1st tier*
* }
else*
* Debug.Log(“Maximum number of levels is 8”);
}
if ( GUILayout.Button(“-”, EditorStyles.toolbarButton, GUILayout.Width(50)) && target.levels.Count > 0 )
{
target.levels.RemoveAt(target.levels.Count -1);
areaIndex.RemoveAt(areaIndex.Count -1); // Also decrease areaIndex array*
* roundIndex.RemoveAt(roundIndex.Count -1); // Also decrease roundIndex array*
* if ( levelIndex > target.levels.Count -1 )
levelIndex–; // Lower levelIndex if player had it selected upon deletion*
* if ( levelIndex < 0 )
levelIndex = 0;
}
GUILayout.EndHorizontal();*_
* GUILayout.Space (5);*
* // Area select*
* GUI.backgroundColor = Color(0.95,0.99,1,1);*
* if ( target.levels.Count < 1 || target.levels[levelIndex] == null )*
* return; // Quit if there are no levels yet*
* GUILayout.BeginHorizontal();*
* var parsedAreas = new String[target.levels[levelIndex].areas.Count];*
* for ( i = 0; i < parsedAreas.Length; i++ )*
_ { parsedAreas = "Area " + (i+1).ToString(); }
* areaIndex[levelIndex] = GUILayout.Toolbar (areaIndex[levelIndex], parsedAreas, EditorStyles.toolbarButton );
GUILayout.Space (10);
if ( GUILayout.Button(“+”, EditorStyles.toolbarButton, GUILayout.Width(50)) )
{
if ( target.levels[levelIndex].areas.Count < 10 )
{
target.levels[levelIndex].areas.Add(target.Areas);
roundIndex[levelIndex].Add(0); // Also increase roundIndex array 2nd tier*
* }
else*
* Debug.Log(“Maximum number of areas is 10”);
}
if ( GUILayout.Button(“-”, EditorStyles.toolbarButton, GUILayout.Width(50)) && target.levels[levelIndex].areas.Count > 0 )
{
target.levels[levelIndex].areas.RemoveAt(target.levels[levelIndex].areas.Count -1);
roundIndex[levelIndex].RemoveAt(roundIndex[levelIndex].Count -1); // Also decrease roundIndex array 2nd tier*
* if ( areaIndex[levelIndex] > target.levels[levelIndex].areas.Count -1 )
areaIndex[levelIndex] -= 1; // Lower areaIndex if player had it selected upon deletion*
* if ( areaIndex[levelIndex] < 0 )
areaIndex[levelIndex] = 0;
}
GUILayout.EndHorizontal();*_
* // Start Area Box*
* EditorGUILayout.BeginVertical(EditorStyles.textField);*
* GUILayout.Space (15);*
* // Area details*
* if ( target.levels[levelIndex].areas.Count < 1 || target.levels[levelIndex].areas[areaIndex[levelIndex]] == null )*
* return; // Quit if there’s no areas for this level yet *
* var currentArea = target.levels[levelIndex].areas[areaIndex[levelIndex]];*
* // Convert enum names to string*
* var mapString = System.Enum.GetNames(typeof(currentArea.map));*
* var gameString = System.Enum.GetNames(typeof(currentArea.game));*
* // Map select*
* GUILayout.BeginHorizontal();*
* GUI.backgroundColor = Color(1,0.9,0.25,0.75);*
* GUILayout.Label (“Map”, GUILayout.Width(70));*
* currentArea.map = GUILayout.Toolbar (currentArea.map, mapString, EditorStyles.toolbarButton);*
* GUILayout.EndHorizontal();*
* GUILayout.Space (10);*
* // Game select*
* GUILayout.BeginHorizontal();*
* GUI.backgroundColor = Color(0.75,1,0.9,1);*
* GUILayout.Label (“Game”, GUILayout.Width(70));*
* currentArea.game = GUILayout.Toolbar (currentArea.game, gameString, EditorStyles.toolbarButton);*
* GUILayout.EndHorizontal();*
* GUILayout.Space (10);*
* // Round count*
* GUILayout.BeginHorizontal();*
* GUI.backgroundColor = Color(0.99,0.95,1,1);*
* GUILayout.Label (“Rounds”, GUILayout.Width(70));*
* GUILayout.Label (target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds.Count.ToString(), GUILayout.Width(40));*
* if ( GUILayout.Button(“+”, EditorStyles.toolbarButton, GUILayout.Width(30)) )*
* target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds.Add(target.Rounds);*
* if ( GUILayout.Button(“-”, EditorStyles.toolbarButton, GUILayout.Width(30)) && target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds.Count )*
* {*
* target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds.RemoveAt(target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds.Count -1);*
* if ( roundIndex[levelIndex][areaIndex[levelIndex]] > target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds.Count -1 )*
* roundIndex[levelIndex][areaIndex[levelIndex]] -= 1; // Lower roundIndex if player had it selected upon deletion*
* if ( roundIndex[levelIndex][areaIndex[levelIndex]] < 0 )*
* roundIndex[levelIndex][areaIndex[levelIndex]] = 0;*
* }*
* GUILayout.EndHorizontal();*
* GUILayout.Space (10);*
* // End Area box*
* EditorGUILayout.EndVertical();*
* // Round dropdown*
* if ( target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds.Count < 1 || target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds[roundIndex[levelIndex][areaIndex[levelIndex]]] == null )*
* return; // Quit if there are no rounds yet*
* var parsedRounds = new String[target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds.Count];*
* for ( i = 0; i < parsedRounds.Length; i++ )*
_ { parsedRounds = "Round " + (i+1).ToString(); }
* roundIndex[levelIndex][areaIndex[levelIndex]] = EditorGUILayout.Popup (roundIndex[levelIndex][areaIndex[levelIndex]], parsedRounds, EditorStyles.toolbarDropDown);*_
* // Round details*
* // if escape is selected, hide certain variables, and so on for each game type…*
* EditorGUILayout.BeginVertical(EditorStyles.textField);*
* GUILayout.Space (10);*
* GUI.backgroundColor = Color.white;*
* EditorGUIUtility.LookLikeInspector ();*
* var currentRound = target.levels[levelIndex].areas[areaIndex[levelIndex]].rounds[roundIndex[levelIndex][areaIndex[levelIndex]]];*
* currentRound.reward = EditorGUILayout.IntField (“Reward”, currentRound.reward);*
* currentRound.time = EditorGUILayout.IntField (“Time”, currentRound.time);*
* currentRound.enemiesToKill = EditorGUILayout.IntField (“Enemies to Kill”, currentRound.enemiesToKill);*
* currentRound.houseIntegrityMin = EditorGUILayout.IntSlider (“Minimum House Integrity %”, currentRound.houseIntegrityMin, 0, 100);*
* currentRound.waves = EditorGUILayout.IntField (“Waves of Enemies”, currentRound.waves);*
* // Enemy select*
* // Convert enum names to string*
* var werewolvesString = System.Enum.GetNames(typeof(currentRound.werewolves));*
* var batsString = System.Enum.GetNames(typeof(currentRound.bats));*
* GUILayout.BeginHorizontal();*
* GUI.backgroundColor = Color(1,0.9,0.75,1);*
* EditorGUILayout.LabelField (“Werewolves”);*
* currentRound.werewolves = EditorGUILayout.Popup (currentRound.werewolves, werewolvesString, EditorStyles.toolbarPopup);*
* GUILayout.EndHorizontal();*
* GUILayout.BeginHorizontal();*
* GUI.backgroundColor = Color(0.9,1,0.75,1);*
* EditorGUILayout.LabelField (“Bats”);*
* currentRound.bats = EditorGUILayout.Popup (currentRound.bats, batsString, EditorStyles.toolbarPopup);*
* GUILayout.EndHorizontal();*
* // Weapons*
* GUILayout.Space (5);*
* GUILayout.BeginHorizontal();*
* GUI.backgroundColor = Color(0.9,0.9,0.9,1);*
* GUILayout.Space(50);*
* currentRound.pistol = GUILayout.Toggle(currentRound.pistol, “Pistol”, EditorStyles.miniButton);*
* currentRound.shotgun = GUILayout.Toggle(currentRound.shotgun, “Shotgun”, EditorStyles.miniButton);*
* currentRound.rifle = GUILayout.Toggle(currentRound.rifle, “Rifle”, EditorStyles.miniButton);*
* currentRound.automatic = GUILayout.Toggle(currentRound.automatic, “Automatic”, EditorStyles.miniButton);*
* GUILayout.Space(50);*
* GUILayout.EndHorizontal();*
* GUILayout.Space (10);*
* EditorGUILayout.EndVertical();*
* }*
}