- Home /
What's your equivalent of old GUIStyle ?
Hi there,
I was wondering if there is an equivalent of the old GUIStyle in the new uGui system. One of the feature I liked was to create some custom styles in a GUISKin and use it it simply in the code to set a text into this style. For exemple :
floatingText.Style = Skin.GetStyle(style);
Where Skin is a GUISkin, Style a GUIStyle and style a simple string that identify my text style that is preset in the GUISkin's custom styles in the editor.
I was thinking about using prefabs for text style but I don't think it's really worth. An other solution is maybe to make a class to manage text styles and save different presets into code.
What do you think or what is your home made solution ?
$$anonymous$$mm all the properties of 'style' are splitted in different components: padding and stuff like that in the rect transform, font, material, color, ... in the text component itself ...
You can create a class with all the stuff you want to find again and make some little scripting to make the link between your class and the different components.