I guess this question would be more related to C# instead of Unity, but it kind of has to do with the Editor as well.
So I’m made a custom class which is going to be like Unity’s EditorStyles, I noticed when you call something like EditorStyles.label or EditorStyles.toolbar there is no () after the label/toolbar, where when I call my function LittleStyles.SubTitleBar() I have to use brackets.
I’m guessing its something to do with how the function is declared, and its really not causing me problems I’m just wondering and always trying to expand my knowledge.
So the question is, what makes that function not have to use brackets?
Edit: Also one more question. When creating styles I sometimes like to duplicate a current one, so basically
public static GUIStyle SubTitleBar()
{
GUIStyle s = new GUIStyle();
s = EditorStyles.toolbar;
s.alignment = TextAnchor.MiddleCenter;
s.fontStyle = FontStyle.Bold;
s.fontSize = 10;
return s;
}
But when I do that, everything that uses EditorStyle.toolbar uses the new font size. It doesn’t seem to copy the style either.
I could just set it back after I use the new one, but its kind of annoying to have to do that every time.