Every time I add a text component I have to change all the parameters, like make it all the way black, the font, the alignment, etc. My game has a lot of text objects throughout and they’re mostly the same format. I’d like to be able to change the defaults so that I can click Add Component > UI > Text and have it be set the way I want it right away. Anyone know how to do this?
Id assume you might be able to make a custom editor for text components, draw the default and then add a button that you can click which will set everything to your desired defaults. You can get fancy and add multiple default templates as well.
I didnt try any of this, but Id assume its possible.
Other options you can try:
- Make a type that is derived from Text and initialize its fields with the default values you want. Make sure this type runs during edit mode (has the attribute [ExecuteInEditMode] ) and when it gets created in the editor, initialize all fields to the default values you want.
- Grab the source for the UI system and create a modified version of the Text component with all the values you want.