124 lines
2.1 KiB
C#
124 lines
2.1 KiB
C#
// ***********************************************************************
|
|
// Assembly : Game
|
|
// Author : Kimch
|
|
// Created : 2020-09-16
|
|
// Description :
|
|
// Last Modified By :
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "GameWindow" company="KUNPO"></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
|
|
using PureMVC.Interfaces;
|
|
using System.Collections.Generic;
|
|
|
|
namespace G.UI
|
|
{
|
|
public partial class GameWindow : KUIWindow
|
|
{
|
|
public static GameWindow Instance;
|
|
|
|
#region Constructor
|
|
|
|
public GameWindow()
|
|
: base(UILayer.kNormal, UIMode.kSequenceRemove)
|
|
{
|
|
uiPath = "ui_battle/ui_w_game.prefab";
|
|
Instance = this;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Method
|
|
|
|
int[] _listNotificationInterests = new int[]
|
|
{
|
|
GlobalDefine.EVENT_GAME_WINDOW,
|
|
};
|
|
|
|
public override IList<int> ListNotificationInterests()
|
|
{
|
|
return _listNotificationInterests;
|
|
}
|
|
|
|
public override void HandleNotification(INotification notification)
|
|
{
|
|
if (notification.Name == GlobalDefine.EVENT_GAME_WINDOW)
|
|
{
|
|
var type = notification.Type;
|
|
|
|
if (type == nameof(BattlePanel))
|
|
{
|
|
ShowBattle();
|
|
}
|
|
else if (type == "skill_shop")
|
|
{
|
|
ShowMovesShop(notification.Body);
|
|
}
|
|
else if (type == "settle")
|
|
{
|
|
ShowSettle(notification.Body);
|
|
}
|
|
else if (type == "rivive")//复活
|
|
{
|
|
ShowRivive();
|
|
}
|
|
else if (type == "menu")
|
|
{
|
|
ShowMenu();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Unity
|
|
|
|
bool _isRegister;
|
|
public bool isRegister => _isRegister;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public override void Awake()
|
|
{
|
|
InitView();
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public override void OnEnable()
|
|
{
|
|
RegisterThis();
|
|
_isRegister = true;
|
|
RefreshView();
|
|
}
|
|
|
|
public override void OnDisable()
|
|
{
|
|
UnregisterThis();
|
|
_isRegister = false;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public override void Update()
|
|
{
|
|
UpdateView();
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public override void UpdatePerSecond()
|
|
{
|
|
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|