void AddItem() { InteractionObjectData newData = CreateInteractionObjectList.CreateData(); if (newData) { string relPath = AssetDatabase.GetAssetPath(newData); EditorPrefs.SetString("ObjectPath", relPath); interactionObjectList.objectList.Add(newData); viewIndex = interactionObjectList.objectList.Count; } }
void CreateNewItemList() { // There is no overwrite protection here! // There is No "Are you sure you want to overwrite your existing object?" if it exists. // This should probably get a string from the user to create a new name and pass it ... viewIndex = 1; interactionObjectList = CreateInteractionObjectList.Create(); if (interactionObjectList) { interactionObjectList.objectList = new List <InteractionObjectData>(); string relPath = AssetDatabase.GetAssetPath(interactionObjectList); EditorPrefs.SetString("ObjectPath", relPath); } }