6 namespace HKI.Core.Variables.Editor
14 const float buttonHeight = 14.0f;
15 int varTypesSlideId = 1;
16 int selectedVarTypeId = 0;
18 bool isLimited =
false;
19 int limitedVarTypesSlideId = 0;
21 const string containerSPName =
"container";
22 SerializedProperty containerSP = null;
29 this.container = container;
30 this.isLimited = isLimited;
31 this.limitedVarTypesSlideId = limitedVarTypesSlideId;
33 containerSP = serializedObject.FindProperty(containerSPName);
38 EditorGUILayout.LabelField(
"Create new element in this container", EditorStyles.boldLabel);
40 EditorGUILayout.BeginHorizontal();
42 GUI.enabled = !isLimited;
45 if (newVarTypesSlideId != varTypesSlideId)
47 varTypesSlideId = newVarTypesSlideId;
48 selectedVarTypeId = 0;
53 if (GUILayout.Button(
"Add", GUILayout.Width(50.0f), GUILayout.Height(buttonHeight)))
58 AssetDatabase.AddObjectToAsset(newVariable, container);
59 AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(newVariable));
61 containerSP.InsertArrayElementAtIndex(containerSP.arraySize);
62 SerializedProperty elementSP = containerSP.GetArrayElementAtIndex(containerSP.arraySize - 1);
64 elementSP.objectReferenceValue = newVariable;
67 EditorGUILayout.EndHorizontal();
static List< string > VarTypesCollectionNames
This abstract class of a ScriptableObject is provides child classes with on value changed callback ca...
This class is for container editor to find out what HKIVar value types are existing.
static List< HKIVarTypesCollection > VarTypesCollections