DIY Dialog System (type-writer effect)

I’m trying to come up with a dialogue ‘system’ that mimics the type-writer effect with each letter appearing at a time. I just threw this thing together and am lost on how to make this more efficient and easier to use. I’d appreciate any help I can get!

Here’s what I have right now, all to produce a simple “Hello world!”:

void OnGUI ()
	{
		GUI.Label (new Rect (Screen.width / 2, Screen.height / 2, 500, 500), msg01);

		if (Time.time >= currentTime + .05 && msg01 == "H")
		{
			currentTime = Time.time;
			msg01 += "E";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HE")
		{
			currentTime = Time.time;
			msg01 += "L";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HEL")
		{
			currentTime = Time.time;
			msg01 += "L";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HELL")
		{
			currentTime = Time.time;
			msg01 += "O";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HELLO")
		{
			currentTime = Time.time;
			msg01 += " ";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HELLO ")
		{
			currentTime = Time.time;
			msg01 += "W";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HELLO W")
		{
			currentTime = Time.time;
			msg01 += "O";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HELLO WO")
		{
			currentTime = Time.time;
			msg01 += "R";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HELLO WOR")
		{
			currentTime = Time.time;
			msg01 += "L";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HELLO WORL")
		{
			currentTime = Time.time;
			msg01 += "D";
		}
		else if (Time.time >= currentTime + .05 && msg01 == "HELLO WORLD")
		{
			msg01 += "!";
		}
	}

You can ditch the whole if and else statements by updating the string from a full string with the entire word, try this:

public string msg01;					//What should be shown in the label
private string output = "HELLO WORLD";	//The full string
private int pos = 0;					//Char position in the output string

public float currentTime;

void Update ()
{
	//Update text only when it reach the desired time and the message is different from the full word
	if(Time.time >= currentTime + .05f && msg01 != output) {
		pos++;	//Increase char position by 1
		currentTime = Time.time;
		msg01 = output.Substring(0, pos); //Update msg01 string word by word using the pos index
	}
}
// Use this for initialization
void OnGUI ()
{
	GUI.Label (new Rect (Screen.width / 2, Screen.height / 2, 500, 500), msg01);

}

You can set pos to -1 if you want, this will prevent the word from starting from the first char unless this is the way you want it. I left some comments to explain what I did. This way you can build a more dynamic system by setting the full word that should be shown.

Just a note spaces are threated as chars too, so it will “type” any space, if you want to avoid that you can try by putting the final text into an array of chars and Split the spaces.