/******************************************************************** 文件: LoginFrame.cs 作者: 梦语 邮箱: 1982614048@qq.com 创建时间: 2024/03/29 17:28:19 最后修改: 梦语 最后修改时间: 2024/04/05 16:29:43 功能: 登录 *********************************************************************/ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; namespace Ether { public class LoginFrame : LoginFrameBase { protected override void OnSubscribe() { string str; //EventCenter.AddListener(EtherInputType.Up, OnInputUpEvent); //EventCenter.AddListener(EtherInputType.Down, OnInputDownEvent); //EventCenter.AddListener(EtherInputType.Left, OnInputLeftEvent); //EventCenter.AddListener(EtherInputType.Right, OnInputRightEvent); } protected override void OnUnSubscribe() { //EventCenter.RemoveListener(EtherInputType.Up, OnInputUpEvent); //EventCenter.RemoveListener(EtherInputType.Down, OnInputDownEvent); //EventCenter.RemoveListener(EtherInputType.Left, OnInputLeftEvent); //EventCenter.RemoveListener(EtherInputType.Right, OnInputRightEvent); } //private void OnInputUpEvent(int state) //{ // Debug.Log("UpUpUpUpUp:" + state); //} //private void OnInputDownEvent(int state) //{ // Debug.Log("DownDownDownDown:" + state); //} //private void OnInputLeftEvent(int state) //{ // Debug.Log("LeftLeftLeft:" + state); //} //private void OnInputRightEvent(int state) //{ // Debug.Log("RightRightRightRightRight:" + state); //} protected override void OnShow() { _BtnExContinuGame.OnClick.AddListener(() => { Debug.Log("点击继续游戏"); UIManager.Inst.OpenFrame(); SceneSystemManager.Inst.LoadScene("Login"); }); _BtnExContinuGame.OnEnter.AddListener(() => { _BtnExContinuGame.transform.localScale = _BtnExContinuGame.BaseScale * 1.05f; }); _BtnExContinuGame.OnExit.AddListener(() => { _BtnExContinuGame.transform.localScale = _BtnExContinuGame.BaseScale; }); _BtnExStartGame.OnClick.AddListener(() => { Debug.Log("点击新的游戏"); Close(); OpenFrameData openFrameData = new OpenFrameData(); openFrameData.AddData("SelectIndex", 2); UIManager.Inst.OpenFrame(openFrameData); SceneSystemManager.Inst.LoadScene("DiningCar"); }); _BtnExStartGame.OnEnter.AddListener(() => { _BtnExStartGame.transform.localScale = _BtnExStartGame.BaseScale * 1.05f; }); _BtnExStartGame.OnExit.AddListener(() => { _BtnExStartGame.transform.localScale = _BtnExStartGame.BaseScale; }); _BtnExSetting.OnClick.AddListener(() => { Debug.Log("点击设置"); }); _BtnExSetting.OnEnter.AddListener(() => { _BtnExSetting.transform.localScale = _BtnExSetting.BaseScale * 1.05f; }); _BtnExSetting.OnExit.AddListener(() => { _BtnExSetting.transform.localScale = _BtnExSetting.BaseScale; }); _BtnExExit.OnClick.AddListener(() => { Application.Quit(); Debug.Log("点击离开游戏"); }); _BtnExExit.OnEnter.AddListener(() => { _BtnExExit.transform.localScale = _BtnExExit.BaseScale * 1.05f; }); _BtnExExit.OnExit.AddListener(() => { _BtnExExit.transform.localScale = _BtnExExit.BaseScale; }); } } }