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

public class SwitchText : MonoBehaviour {

    public string onText;
    public string offText;

    private bool state = true;

    void Awake()
    {
        if (state)
            gameObject.GetComponent<Text>().text = onText;
        else if (!state)
            gameObject.GetComponent<Text>().text = offText;
    }

    public void SwitchUIText()
    {
        state = !state;

        if(state)
            gameObject.GetComponent<Text>().text = onText;
        else if (!state)
            gameObject.GetComponent<Text>().text = offText;
    }
}
