ドキュメント

Unity Engine

Unity Engine

font

The default font to use for all styles.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.IMGUIModule
public Font font { get; set; }

Examples

using UnityEngine;public class Example : MonoBehaviour{ // Modifies the font only of the current GUISkin. public Font font; void OnGUI() { if (!font) { Debug.LogError("No font found, assign one in the inspector."); return; } GUI.skin.font = font; GUILayout.Label("This is a label with the font"); GUILayout.Button("And this is a button"); }}