//Settingsプロパティの描画 void DrawAssetFileManagerSettingsProperty(SerializedProperty property) { property = property.Copy(); string rootPath = property.propertyPath + "."; UtageEditorToolKit.BeginGroup("Load Setting"); SerializedObjectHelper.DrawProperty(rootPath + "loadType"); //タブの表示 List <string> tabName = new List <string>(); foreach (AssetFileSetting setting in Settings.FileSettings) { tabName.Add(setting.FileType.ToString()); } tabIndex = GUILayout.Toolbar(tabIndex, tabName.ToArray(), EditorStyles.toolbarButton); //タブの中身の表示 string arrayRootPath = rootPath + "fileSettings." + string.Format("Array.data[{0}]", tabIndex) + "."; bool isAdVanced = Settings.LoadTypeSetting == AssetFileManagerSettings.LoadType.Advanced; AssetFileSetting currentSetting = Settings.FileSettings[tabIndex]; GUILayout.Space(-5f); EditorGUILayout.BeginVertical("box"); EditorGUI.indentLevel++; { GUILayout.Space(4f); GUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical(); //AdVanced以外では編集不可 if (isAdVanced) { SerializedObjectHelper.DrawProperty(arrayRootPath + "isStreamingAssets"); SerializedObjectHelper.DrawProperty(arrayRootPath + "encodeType"); } else { EditorGUI.BeginDisabledGroup(true); EditorGUILayout.Toggle("IsStreamingAssets", currentSetting.IsStreamingAssets); EditorGUILayout.LabelField("EncodeType", currentSetting.EncodeType.ToString()); EditorGUI.EndDisabledGroup(); } SerializedObjectHelper.DrawProperty(arrayRootPath + "extensions"); } EditorGUI.indentLevel--; UtageEditorToolKit.EndGroup(); UtageEditorToolKit.EndGroup(); }
/// <summary> /// エディタ上に保存してあるデータをセーブ /// </summary> protected virtual void Save() { string str = BinaryUtil.BinaryWriteToString(writer => SerializedObjectHelper.WriteAllVisibleProperties(writer)); switch (EditorSaveType) { case SaveType.EditorPrefs: EditorPrefs.SetString(SaveKey(), str); break; case SaveType.EditorUserSettings: default: EditorUserSettings.SetConfigValue(SaveKey(), str); break; } }
/// <summary> /// エディタ上に保存してあるデータをロード /// </summary> protected virtual void Load() { string str = ""; switch (EditorSaveType) { case SaveType.EditorPrefs: str = EditorPrefs.GetString(SaveKey(), ""); break; case SaveType.EditorUserSettings: default: str = EditorUserSettings.GetConfigValue(SaveKey()); break; } if (!string.IsNullOrEmpty(str)) { BinaryUtil.BinaryReadFromString(str, reader => SerializedObjectHelper.ReadAllVisibleProperties(reader)); } }
protected virtual bool DrawProperties() { return(SerializedObjectHelper.OnGUI()); }
void OnDrawCustom(SerializedObjectHelper helper) { helper.IsDrawScript = true; helper.DrawHeader(); helper.BeginGroup("Resources"); { helper.DrawProperty("isConvertResources", "Convert"); if (this.IsConvertResources) { helper.DrawProperty("resourcesDirectory"); helper.DrawProperty("isOnlyNew"); } } helper.EndGroup(); helper.BeginGroup("Scenario"); { helper.DrawProperty("isConvertScenario", "Convert"); if (this.IsConvertScenario) { helper.DrawProperty("projectSetting", "Project Setting"); } } helper.EndGroup(); helper.BeginGroup("AssetBundle"); { helper.DrawProperty("assetBundleBuildMode", "BuildMode"); if (this.assetBundleBuildMode != AssetBundleBuildMode.None) { helper.DrawProperty("assetBundleDirectory", "Directory"); helper.DrawProperty("assetBundleRenameType", "RenameType"); helper.DrawProperty("buildTargetFlags", "buildTarget"); } } helper.EndGroup(); helper.BeginGroup("Output Setting"); { helper.DrawProperty("outputType"); if (outputType == OutputType.Default) { helper.BeginGroup("Local"); { helper.DrawProperty("isOutputLocal", "Output"); if (isOutputLocal) { helper.DrawProperty("isOutputLocalLog", "Output Log"); helper.DrawProperty("localDirectory", "Directory"); } } helper.EndGroup(); helper.BeginGroup("Server"); { helper.DrawProperty("isOutputServer", "Output"); if (isOutputServer) { helper.DrawProperty("isOutputServerLog", "Output Log"); helper.DrawProperty("outputServerResourcePath", "Output Path"); } } helper.EndGroup(); } else { helper.DrawProperty("isOutputAdvancedLog", "Output Log"); helper.DrawProperty("advancedOutputPath"); } } helper.EndGroup(); }
public override void OnInspectorGUI() { if (SerializedObjectHelper.OnGUI()) { } }
//ロード後初期化 protected virtual void OnSerializedObjectHelperInit() { SerializedObjectHelper.AddGroupInfo("Debug", "isOutPutDebugLog", "isDebugBootDeleteChacheAll"); SerializedObjectHelper.DrawCustomProperty = DrawCustomProperty; tabIndex = 0; }