/// <summary> /// Change the fonts of all Text Objects in the scene. /// </summary> private void ChangeAllFontsButton() { EditorGUILayout.Space(); if (GUILayout.Button("Change All Fonts In Scene")) { PropertyLibrary.ChangeAllFonts(); RepaintAll(); } }
/// <summary> /// Change the FontSize of every Text in the scene. /// </summary> private void ChangeAllFontSizeButton() { EditorGUILayout.Space(); if (GUILayout.Button("Change All Fonts Size In Scene")) { PropertyLibrary.ChangeAllFontSize(); RepaintAll(); } if (GlobalTextSettings.TextSettings != null) { GlobalTextSettings.TextSettings.fontSize = EditorGUILayout.IntField(GlobalTextSettings.TextSettings.fontSize); } else { EditorGUILayout.IntField(0); } }
/// <summary> /// Change the font color of all Text objects in the scene, in real-time. /// </summary> private void ChangeAllFontsColorRealTime() { EditorGUILayout.Space(); GUILayout.Label("Change All Fonts Color In Scene"); Selection.activeObject = GlobalTextSettings.TextSettings; if (GlobalTextSettings.TextSettings != null) { // Allows us to use the Color Picker to change color. if (Event.current.commandName == "ColorPickerChanged") { GlobalTextSettings.TextSettings.color = EditorGUILayout.ColorField(GlobalTextSettings.TextSettings.color); PropertyLibrary.ChangeAllColor(); } // Allows us to use the dropper to change color. else if (Event.current.commandName == "EyeDropperClicked") { GlobalTextSettings.TextSettings.color = EditorGUILayout.ColorField(GlobalTextSettings.TextSettings.color); PropertyLibrary.ChangeAllColor(); } else { // Do not change color when a new TextData is loaded. EditorGUILayout.ColorField(GlobalTextSettings.TextSettings.color); } RepaintAll(); } else { // No TextData, show Black. EditorGUILayout.ColorField(Color.black); RepaintAll(); } }
private static void ChangeToAllGlobalPresets(MenuCommand menuCommand) { var thisText = menuCommand.context as Text; PropertyLibrary.ChangeAllProperties(thisText); }
private static void SetTextToCustom() { PropertyLibrary.ChangeAllProperties(Selection.activeGameObject.GetComponent <Text>()); }