更改字体大小全局GUI标签上
问题描述:
我试图在全球范围内更改字体大小在我的GUI标签,但它给我一个错误:更改字体大小全局GUI标签上
MissingFieldException: UnityEngine.GUIStyle.fonSize Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.FindExtension (IEnumerable`1 candidates)
这是我的代码
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);
}