public void ResetFileList() { this.index = 0; this.fileNameList = PresetManager.GetFileList(this.selectedCategory, this.objectName); this.contentList = new GUIContent[this.fileNameList.Length + 1]; this.contentList[0] = new GUIContent("未選択"); for (int i = 0; i < this.fileNameList.Length; i++) { this.contentList[i + 1] = new GUIContent(this.fileNameList[i]); } this.combo = new ComboBoxLO(this.contentList[0], this.contentList, UIParams.Instance.bStyle, UIParams.Instance.winStyle, UIParams.Instance.listStyle, false); }
public static void SaveObjectData(string fileName) { PresetManager.DirectoryCheckAndCreate(); ObjectData objectDataFromObject = PresetManager.GetObjectDataFromObject(); XmlSerializer xmlSerializer = new XmlSerializer(typeof(ObjectData)); StreamWriter streamWriter = new StreamWriter(PresetManager.directoryPath + fileName + ".xml", false, new UTF8Encoding(false)); xmlSerializer.Serialize(streamWriter, objectDataFromObject); streamWriter.Close(); PresetFileData presetFileData = new PresetFileData(); presetFileData.filename = fileName; presetFileData.objectData = objectDataFromObject; PresetManager.PresetFileDataDic[fileName] = presetFileData; }
private void DrawImportButton() { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); bool flag = this.index <= 0; if (flag) { GUI.enabled = false; } bool flag2 = GUILayout.Button("Import", UIParams.Instance.bStyle, new GUILayoutOption[0]); if (flag2) { PresetManager.LoadObjectData(this.fileNameList[this.index - 1]); Setting.mode = Mode.Edit; } GUI.enabled = true; GUILayout.EndHorizontal(); }
public static void LoadObjectData(string fileName) { ObjectData objectData = PresetManager.PresetFileDataDic[fileName].objectData; PresetManager.ApplyObjectDataToObject(objectData); }