172 lines
3.3 KiB
C#
172 lines
3.3 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Game
|
|||
|
// Author : Kimch
|
|||
|
// Created : 2020-09-16
|
|||
|
// Description :
|
|||
|
// Last Modified By :
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "IngameWindow.View" company="KUNPO"></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
namespace G.UI
|
|||
|
{
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
partial class GameWindow
|
|||
|
{
|
|||
|
#region Field
|
|||
|
|
|||
|
#pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|||
|
[KUIFlag]
|
|||
|
GameObject __goInput;
|
|||
|
[KUIFlag]
|
|||
|
GameObject __goBattle;
|
|||
|
[KUIFlag]
|
|||
|
GameObject __goMenu;
|
|||
|
[KUIFlag]
|
|||
|
GameObject __goRivive;
|
|||
|
[KUIFlag]
|
|||
|
GameObject __goMovesShop;
|
|||
|
#pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|||
|
|
|||
|
private InputPanel _inputPanel;
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Method
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public void InitView()
|
|||
|
{
|
|||
|
SetViewData();
|
|||
|
_inputPanel = __goInput.GetComponent<InputPanel>();
|
|||
|
//if (!__goMovesShop)
|
|||
|
// AssetProxy.Instance.UIAsyncInstantiater("MoveShopPanel", (obj) =>
|
|||
|
// {
|
|||
|
// __goMovesShop = obj as GameObject;
|
|||
|
// __goMovesShop.transform.SetParent(this.transform, false);
|
|||
|
// __goMovesShop.transform.SetSiblingIndex(2);
|
|||
|
// });
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public void RefreshView()
|
|||
|
{
|
|||
|
ShowBattle();
|
|||
|
|
|||
|
__goMenu.SetActive(false);
|
|||
|
if (__goMovesShop)
|
|||
|
__goMovesShop.SetActive(false);
|
|||
|
__goRivive.SetActive(false);
|
|||
|
//__goSettle.SetActive(false);
|
|||
|
//__goEndlessSettle.SetActive(false);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public void UpdateView()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public void ShowBattle()
|
|||
|
{
|
|||
|
ShowPanel(__goInput);
|
|||
|
ShowPanel(__goBattle);
|
|||
|
}
|
|||
|
|
|||
|
public void HideBattle()
|
|||
|
{
|
|||
|
HidePanel(__goInput);
|
|||
|
HidePanel(__goBattle);
|
|||
|
}
|
|||
|
|
|||
|
public void ShowBag()
|
|||
|
{
|
|||
|
//__goBag.SetActive(true);
|
|||
|
}
|
|||
|
|
|||
|
public void ShowMenu()
|
|||
|
{
|
|||
|
HideBattle();
|
|||
|
|
|||
|
__goMenu.SetActive(true);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 结算
|
|||
|
/// </summary>
|
|||
|
public void ShowSettle(object type)
|
|||
|
{
|
|||
|
HideBattle();
|
|||
|
|
|||
|
if (type is string args && args.StartsWith("endless"))
|
|||
|
{
|
|||
|
OpenWindow<EndlessSettleWindow>();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
OpenWindow<SettleWindow>();
|
|||
|
}
|
|||
|
//__goSettle.SetActive(true);
|
|||
|
//__goSettle.GetComponent<SettlePanel>().SetData(type);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 复活
|
|||
|
/// </summary>
|
|||
|
public void ShowRivive()
|
|||
|
{
|
|||
|
__goRivive.SetActive(true);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 技能卡
|
|||
|
/// </summary>
|
|||
|
public void ShowMovesShop(object data)
|
|||
|
{
|
|||
|
HideBattle();
|
|||
|
|
|||
|
if (__goMovesShop)
|
|||
|
{
|
|||
|
__goMovesShop.SetActive(true);
|
|||
|
var panel = __goMovesShop.GetComponent<MovesShopPanel>();
|
|||
|
panel.SetData(data);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void ShowPanel(GameObject panel)
|
|||
|
{
|
|||
|
var panelCanvas = panel.GetComponent<Canvas>();
|
|||
|
if (panelCanvas)
|
|||
|
{
|
|||
|
panelCanvas.enabled = true;
|
|||
|
}
|
|||
|
else
|
|||
|
panel.transform.localScale = Vector3.one;
|
|||
|
}
|
|||
|
|
|||
|
private void HidePanel(GameObject panel)
|
|||
|
{
|
|||
|
var panelCanvas = panel.GetComponent<Canvas>();
|
|||
|
if (panelCanvas)
|
|||
|
{
|
|||
|
panelCanvas.enabled = false;
|
|||
|
}
|
|||
|
else
|
|||
|
panel.transform.localScale = Vector3.zero;
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|