void GUICreator(bool recreate) { serializedObject.Update(); MadGUI.PropertyField(inputType, "Input Type"); bool canCreate = false; switch ((MadFont.InputType)inputType.enumValueIndex) { case MadFont.InputType.TextureAndGlyphList: canCreate = GUITextureAndGlyphListCreator(); break; case MadFont.InputType.Bitmap: canCreate = GUIBitmapFontCreator(); break; } MadGUI.PropertyField(forceWhite, "Force White Color", "Forces this font to be rendered with white color only."); serializedObject.ApplyModifiedProperties(); GUI.enabled = canCreate; if (GUILayout.Button(recreate ? "Recreate" : "Create")) { var builder = new MadFontBuilder(target as MadFont); builder.white = forceWhite.boolValue; builder.Build(); } GUI.enabled = true; }
void GUICreator(bool created) { serializedObject.Update(); MadGUI.PropertyField(inputType, "Input Type"); bool canCreate = false; switch ((MadFont.InputType)inputType.enumValueIndex) { case MadFont.InputType.TextureAndGlyphList: canCreate = GUITextureAndGlyphListCreator(); break; case MadFont.InputType.Bitmap: canCreate = GUIBitmapFontCreator(); break; } EditorGUI.BeginChangeCheck(); MadGUI.PropertyField(forceWhite, "Force White Color", "Forces this font to be rendered with white color only."); if (EditorGUI.EndChangeCheck()) { if (script.created) { ReloadColors(); } } MadGUI.ConditionallyEnabled(!forceWhite.boolValue, () => { EditorGUI.BeginChangeCheck(); primaryColor = EditorGUILayout.ColorField("Primary Color", primaryColor); secondaryColor = EditorGUILayout.ColorField("Secondary Color", secondaryColor); if (EditorGUI.EndChangeCheck()) { if (created) { SetColors(); } } }); serializedObject.ApplyModifiedProperties(); GUI.enabled = canCreate; if (GUILayout.Button(created ? "Recreate" : "Create")) { var builder = new MadFontBuilder(script); builder.white = forceWhite.boolValue; builder.Build(); if (!forceWhite.boolValue && script.created) { SetColors(); } } GUI.enabled = true; }
static void CreateFont() { MadFontBuilder.CreateFont(); }
void GUICreator(bool created) { serializedObject.Update(); MadGUI.PropertyField(inputType, "Input Type"); bool canCreate = false; switch ((MadFont.InputType) inputType.enumValueIndex) { case MadFont.InputType.TextureAndGlyphList: canCreate = GUITextureAndGlyphListCreator(); break; case MadFont.InputType.Bitmap: canCreate = GUIBitmapFontCreator(); break; } MadGUI.PropertyField(forceWhite, "Force White Color", "Forces this font to be rendered with white color only."); MadGUI.ConditionallyEnabled(!forceWhite.boolValue, () => { EditorGUI.BeginChangeCheck(); primaryColor = EditorGUILayout.ColorField("Primary Color", primaryColor); secondaryColor = EditorGUILayout.ColorField("Primary Color", secondaryColor); if (EditorGUI.EndChangeCheck()) { if (created) { SetColors(); } } }); serializedObject.ApplyModifiedProperties(); GUI.enabled = canCreate; if (GUILayout.Button(created ? "Recreate" : "Create")) { var builder = new MadFontBuilder(script); builder.white = forceWhite.boolValue; builder.Build(); if (!forceWhite.boolValue && script.created) { SetColors(); } } GUI.enabled = true; }