I am trying to change the font for my game and I have been reading the documents and stuff for it and they all say use the GUISkin and Style. The problem is, my class doesn’t use MonoBehavior and, if I’m correct, you need MonoBehavior to call OnGUI. I was wondering, is there is a way to call a font without using OnGUI? If not, is there a way to revise my class to use MonoDevelop?
This is my Class
using UnityEngine;
using System.Collections;
public class DisplayCreatePlayerFunctions {
public static int classSelection;
private string[] classSelectionNames = new string[6] {"Mage", "Warrior", "Archer", "Monk", "Cleric", "Vampire"};
public GameObject Spawn;
public void DisplayClassSelections() {
//A list of toggle buttons and each button will be a different class
//Selection grid
classSelection = GUI.SelectionGrid (new Rect (50, 50, 250, 300), classSelection, classSelectionNames, 2);
GUI.Label (new Rect (1275, 50, 300, 300), FindClassDescription (classSelection));
GUI.Label (new Rect (700, 200, 300, 300), FindClassStatValues (classSelection));
}
public static string FindClassDescription(int classSelection) {
if (classSelection == 0) {
BaseCharacterClass tempClass = new BaseMageClass ();
return tempClass.CharacterClassDescription;
} else if (classSelection == 1) {
BaseCharacterClass tempClass = new BaseWarriorClass ();
return tempClass.CharacterClassDescription;
} else if (classSelection == 2) {
BaseCharacterClass tempClass = new BaseArcherClass ();
return tempClass.CharacterClassDescription;
} else if (classSelection == 3) {
BaseCharacterClass tempClass = new BaseMonkClass ();
return tempClass.CharacterClassDescription;
} else if (classSelection == 4) {
BaseCharacterClass tempClass = new BaseClericClass ();
return tempClass.CharacterClassDescription;
} else if (classSelection == 5) {
BaseCharacterClass tempClass = new BaseVampireClass ();
return tempClass.CharacterClassDescription;
}
return "NO CLASS FOUND";
}
}