1
我試圖在全球範圍內更改字體大小在我的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);
}