2025-05-18 01:04:31 +08:00

141 lines
2.8 KiB
C#

// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2021-02-05
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "AdMoneyBox" company="Kunpo"></copyright>
// <summary></summary>
// ***********************************************************************
namespace G.UI
{
public partial class AdMoneyBox : KUIWindow
{
public static bool ShowAdMoney(int id, bool check = false)
{
if (check)
{
bool showBox = LevelProxy.Instance.currentCompletedLevel > 3;
if (id == Item.Id.kCoin)
{
if (showBox && TimeProxy.Instance.GetTimes(TimeProxy.) > 0)
{
OpenWindow<AdMoneyBox>(Item.Id.kCoin);
return true;
}
else
{
ToastBox.ShowText("金币不足");
return false;
}
}
else if (id == Item.Id.kChip)
{
if (showBox && TimeProxy.Instance.GetTimes(TimeProxy.) > 0)
{
OpenWindow<AdMoneyBox>(Item.Id.kChip);
return true;
}
else
{
ToastBox.ShowText("晶石不足");
return false;
}
}
else if (id == Item.Id.kGem)
{
if (showBox && TimeProxy.Instance.GetTimes(TimeProxy.) > 0)
{
OpenWindow<AdMoneyBox>(Item.Id.kGem);
return true;
}
else
{
ToastBox.ShowText("元宝不足");
return false;
}
}
else if (id == Item.Id.kEnergy)
{
if (TimeProxy.Instance.GetTimes(TimeProxy.) > 0)
{
OpenWindow<AdMoneyBox>(Item.Id.kEnergy);
return true;
}
else
{
ToastBox.ShowText("体力不足");
return false;
}
}
else if (id == Item.Id.kMotility)
{
if (TimeProxy.Instance.GetTimes(TimeProxy.) > 0)
{
OpenWindow<AdMoneyBox>(Item.Id.kMotility);
return true;
}
else
{
ToastBox.ShowText("免费次数不足");
return false;
}
}
else if (id == Item.Id.kChip2)
{
OpenWindow<PropTipsBox>(ItemProxy.Instance.GetStaticItem<ItemProp>(Item.Id.kChip2));
}
else
{
ToastBox.ShowText("货币不足");
return false;
}
}
else
{
OpenWindow<AdMoneyBox>(id);
return true;
}
return false;
}
#region Constructor
public AdMoneyBox()
: base(UILayer.kPopup, UIMode.kNone)
{
uiPath = "ui_w_ad_money";
}
#endregion
#region Method
#endregion
#region Unity
/// <summary>
///
/// </summary>
public override void Awake()
{
InitView();
}
/// <summary>
///
/// </summary>
public override void OnEnable()
{
RefreshView();
}
#endregion
}
}