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

public class UILoginPanel : MonoBehaviour {

    public GameObject buttonStart;
    public GameObject buttonHotFix;
    public TextAsset luaFile;

    //private static XLua.LuaEnv luaState = new XLua.LuaEnv();

	// Use this for initialization
	void Start () {

        buttonStart.GetComponent<UnityEngine.UI.Button>().onClick.AddListener(onClickStartButton);
        buttonHotFix.GetComponent<UnityEngine.UI.Button>().onClick.AddListener(onClickHotFixButton);
	}

    void onClickStartButton()
    {
        Debug.Log("C# -> onClickStartButton");

        UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene");
    }

    void onClickHotFixButton()
    {
        Debug.Log("C# -> onClickHotFixButton");

        XLua.LuaEnv luaState = new XLua.LuaEnv();

        luaState.DoString(luaFile.text);

        //luaState.Dispose();
    }
}
