Constructors are ranked using these heuristics:
1. Empty constructors are preferred first.
2. Constructors where all parameters have default values are preferred next.
3. Shorter constructors are preferred over longer ones.
4. Constructors with more parameters that have default values are preferred.
5. Constructors with more value-type parameters are preferred.
[GlobalConfig("Assets/Resources/MyConfigFiles/")]
public class MyGlobalConfig : GlobalConfig<MyGlobalConfig>
{
public int MyGlobalVariable;
}
void SomeMethod()
{
int value = MyGlobalConfig.Instance.MyGlobalVariable;
}
// Generates garbage:
GUILayout.Label(label, GUILayout.Label(label, GUILayout.Width(20), GUILayout.ExpandHeight(), GUILayout.MaxWidth(300)));
// Does not generate garbage:
GUILayout.Label(label, GUILayout.Label(label, GUILayoutOptions.Width(20).ExpandHeight().MaxWidth(300)));