Hi
I am trying to make my code into a dll, I managed to patch the png images into the solution, but as much as i understand, now i need to generate all the custom styles and the gui skin by the code myself, this is what i have :
public static GUISkin DarkSkin;
public static GUISkin LightSkin;
static GuiStyleUtility()
{
DarkSkin = GetDarkSkin();
LightSkin = GetLightSkin();
}
private static GUISkin GetDarkSkin()
{
GUISkin skin = ScriptableObject.CreateInstance<GUISkin>();
List<GUIStyle> styles = new List<GUIStyle>();
GUIStyle style = new GUIStyle
{
name = "ToolsViewBackground",
normal =
{
background = Resource.ViewBackNormalDark,
textColor = GraphicUtility.ColorFrom256(193, 193, 193, 75)
},
border = new RectOffset(2, 2, 2, 2),
fontSize = 18,
alignment = TextAnchor.MiddleCenter,
stretchWidth = true
};
styles.Add(style);
skin.customStyles = styles.ToArray();
skin.hideFlags = HideFlags.HideAndDontSave;
return skin;
}
}
As much as I understand, this should generate the Gui skin and assign it to the public constant DarkSKin and i should be able to access it outside of the static class, but, when i generate the custom editor window that is using this skin it yells that the custom style is not found, of course i triple checked the typing and there is no error there.
so how can i make this work? or how can I make a gui skin totally by code myself?