using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using System.Diagnostics.Tracing;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
public class LoginWin : UIBase
|
{
|
private InputField username;
|
private InputField password;
|
private Button loginBtn;
|
private Button registerBtn;
|
|
protected override void InitComponent()
|
{
|
base.InitComponent();
|
Debug.Log("初始化登录窗口");
|
username = transform.Find("InputUserName").GetComponent<InputField>();
|
password = transform.Find("InputPassword").GetComponent<InputField>();
|
loginBtn = transform.Find("Buttons/ButtonLogin").GetComponent<Button>();
|
registerBtn = transform.Find("Buttons/ButtonRegister").GetComponent<Button>();
|
|
loginBtn.onClick.AddListener(OnLoginBtnClick);
|
registerBtn.onClick.AddListener(OnRegisterBtnClick);
|
}
|
|
public override void HandleOpen()
|
{
|
base.HandleOpen();
|
Debug.Log("打开登录窗口");
|
Refresh();
|
}
|
|
public override void HandleClose()
|
{
|
base.HandleClose();
|
Debug.Log("关闭登录窗口");
|
}
|
|
public override void Refresh()
|
{
|
base.Refresh();
|
Debug.Log("刷新登录窗口");
|
}
|
|
private void OnRegisterBtnClick()
|
{
|
// TODO 注册
|
Debug.Log("注册");
|
}
|
|
private void OnLoginBtnClick()
|
{
|
// TODO 登录
|
Debug.Log("登录" + username.text + " / " + password.text);
|
UIManager.Instance.CloseWindow(this);
|
|
StageManager.Instance.ToGameScene();
|
}
|
}
|