How can I use a font without GUI?

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";
	}

}

Well this is guesswork but as you’ve managed to not get any answers so far maybe it’ll help.

How about this, upgrade to 4.6 if not already on it. Oh and backup, backup, backup your projects first. Make sure you have a path back to where you are now.

Anyway if not on 4.6 backup then upgrade.

Then in using at the top add

Using UnityEngine.UI;

OnGUI is a behaviour of MonoBehaviour but I don’t think the 4.6 UI is so just follow a few tutorials on the new UI or ask how to use the bit you need on here. In theory it should work.

Good luck

EDIT:

Well that’s annoying. I got some free time so I thought I’d try this and it’s fine up to the point where I copy the script onto a gameObject. Then it complains.

Turns out there is no way to have a script without MonoBehaviour be placed on a gameObject regardless of OnGUI or 4.6 UI.

Instead you need a script that does derive from Mono but also references the non-mono classes in your game setup and do the getting and setting of values. You could do a lot worse than watch BurgZerg tutorials for BaseCharacter and CharacterGeneration. 18 - 25 in the tutorials. here

Really sorry for sending you down the wrong path. I suppose the upside is you can use this method to continue using the OnGUI if you want.

Or if you want to get your version of BurgZergs BaseCharacter script ready and carry on using the new I’d be happy to continue the tutorial.