using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class RandomizeLoadingText : MonoBehaviour {

	public float changeInterval;

	public string[] LoadText;

	float timer = 0f;

	// Use this for initialization
	void Start () {
		GetComponent<Text>().text = LoadText[Random.Range(0, LoadText.Length)];
	}

	void Update(){
		if(GlobalScript.controlEnabled)
			return;
		if(GlobalScript.planetaryMovementEnabled)
			gameObject.SetActive(false);
		timer += Time.deltaTime;
		if(timer > changeInterval){
			timer -= changeInterval;
			GetComponent<Text>().text = LoadText[Random.Range(0, LoadText.Length)];
		}
	}

}
