我尝试在GUI标签上全局更改字体大小,但它给我一个错误:
MissingFieldException:UnityEngine.GUIStyle.fonSize Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.FindExtension (IEnumerable`1候选人)
这是我的代码
static var myScore = 0;
static var score = 0;
static var money = 0;
static var level = 0;
static var drinks = 0;
var fontSize : int = 20;
public var guiSkin : GUISkin;
function OnGUI()
{
GUI.skin = guiSkin;
GUI.contentColor = Color.red;
GUI.skin.label.fontSize = fontSize;
GUI.Label(Rect((Screen.width / 2) - 60,15, 200, 30), "Score: " + score);
GUI.Label(Rect((Screen.width / 2) - 60,30, 200, 30), "Money: " + money);
GUI.Label(Rect((Screen.width / 2) - 60,42, 200, 30), "Level: " + level);
GUI.Label(Rect((Screen.width / 2) - -320,25, 200, 30), "Drinks: " + drinks);
}