Files
taptap2024_GJ_chidouren/Assets/Scripts/Views/HomePanel.cs
2024-10-23 18:46:37 +08:00

85 lines
2.5 KiB
C#

using System.Collections.Generic;
using System.StateSystem;
using Framework.UI;
using UnityEngine;
using UnityEngine.UI;
using IcecreamView;
using Script.Core.Utils.Extend;
using StateSystem;
namespace Views{
public class HomePanel : IcecreamView.IC_AbstractModule
{
public Button _toGame;
public Button _settingGame;
public Button _aboutGame;
public override void OnOpenView(IC_ViewData parameters)
{
}
public override void OnCloseView()
{
}
public override void OnInitView ()
{
this._toGame.onClick.AddListener (OnClickToGame , SeAudio.Btn_Click);
this._aboutGame.onClick.AddListener(OnClickAboutGame , SeAudio.Btn_Click);
this._settingGame.onClick.AddListener(OnClickSettingGame , SeAudio.Btn_Click);
// this._achiveGame.onClick.AddListener(OnClickAchiveGame , SeAudio.Btn_Click);
// this._changlleGame.onClick.AddListener(OnClickChanglleGame , SeAudio.Btn_Click);
}
private void OnClickChanglleGame()
{
UIManager.Instance.OpenPropTip("前面的区域,以后再来探索吧!");
}
private void OnClickAchiveGame()
{
UIManager.Instance.OpenPropTip("成就".ToColorString("red")+"暂未开放!敬请期待!");
}
public override void OnFocusActive()
{
this._aboutGame.gameObject.SetActive(true);
this._settingGame.gameObject.SetActive(true);
this._toGame.gameObject.SetActive(true);
}
public override void OnFocusInactive()
{
this._toGame.gameObject.SetActive(false);
this._aboutGame.gameObject.SetActive(false);
this._settingGame.gameObject.SetActive(false);
}
private void OnClickToGame()
{
// UIManager.Instance.OpenView (UIPanel.SuccessPanel);
// return;
UIManager.Instance.OpenLoading (() =>
{
this.ViewConnector.CloseView ();
GameStateManager.Instance.OpenState (GameGlobalState.GameRoom);
});
}
private void OnClickSettingGame()
{
UIManager.Instance.OpenView (UIPanel.SettingPanel);
}
private void OnClickAboutGame()
{
UIManager.Instance.OpenView (UIPanel.AboutPanel);
}
}
}