I'm working on a utility for an upcoming project, and I'm delving into the world of editor programming. I'm having trouble figuring out how to write a script that will allow the user to set a number of new vars and then name and fill in the values for them. I'm essentially trying to replicate the 'Animations' inspector field. Here's what I have so far:
@CustomEditor(SimpleExampleScript)
class CustomEditorExample extends Editor
{
function OnInspectorGUI()
{
target.amountOfAnimations = EditorGUILayout.IntField("Total Animations ", target.amountOfAnimations);
for(anims = 0; anims < target.amountOfAnimations; anims++)
{
var txt : String;
txt = EditorGUILayout.TextField("Anim Name ", txt);
}
}
}
At the moment I can define the amount of animations and the text fields show up, but I'm lost on how to actually create new variables with these names for the user to fill in.