Thanks Jean
I have the code working now, although i have found an issue with updating FSMArray using the 'GetFsmArray'. I check to see if the value has changed but it doesnt work. The value reverts back to default after using '_pfsm.Fsm.SaveActions();' Why doesnt it work for this part of my code?
the 'databasekey' works, but the 'subArray' doesnt.
string databasekey = EditorGUILayout.TextField("", pdt.databaseColumnKeys[i], EditorStyles.label, minwidth, expandwidth);
//works ok
if (databasekey != pdt.databaseColumnKeys[i])
{
dirty = true;
pdt.databaseColumnKeys[i] = databasekey;
}
//doesnt save
FsmArray subArray = _pfsm.FsmVariables.GetFsmArray(pdt.databaseColumnValues[i].variableName);
for (var x = 0; x < subArray.Length; x++)
{
switch (subArray.ElementType)
{
case VariableType.String:
string test = EditorGUILayout.TextField("", subArray.Values[x] as string, minwidth, expandwidth);
if (test != subArray.Values[x])
{
dirty = true;
subArray.Values[x] = test;
}
break;
}
}