125 lines
2.8 KiB
C#
125 lines
2.8 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.UIElements;
|
|
using Button = UnityEngine.UI.Button;
|
|
using Image = UnityEngine.UI.Image;
|
|
using Toggle = UnityEngine.UI.Toggle;
|
|
using ScrollView = PhxhSDK.PhxhScrollView;
|
|
using Framework;
|
|
using Cysharp.Threading.Tasks;
|
|
using Gameplay;
|
|
using Gameplay.Common;
|
|
|
|
public class UI_CreditPointExchangePanelController : UIWindow
|
|
{
|
|
//UI GameObj
|
|
///Auto Gen Start///
|
|
public Image Image_TopBar;
|
|
public Image Image_Bg;
|
|
//public Button Button_Back;
|
|
public Button Button_back;
|
|
public TMP_Text Text_Back;
|
|
public Button Button_Home;
|
|
public Image Image_GoldBg;
|
|
public Image Image_GoldIconBg;
|
|
public Image Image_GoldIcon;
|
|
public TMP_Text Text_GoldNum;
|
|
public Image Image_DiamondBg;
|
|
public Image Image_DiamondIconBg;
|
|
public Image Image_DiamondIcon;
|
|
public TMP_Text Text_DiamondNum;
|
|
public Button Button_DiamondAdd;
|
|
public Image Image_CreditPointBg;
|
|
public Image Image_CreditPoint;
|
|
public TMP_Text Text_CreditPointNum;
|
|
public Image Image_Arrow;
|
|
public Image Image_StuffBg;
|
|
public Image Image_Stuff;
|
|
public TMP_Text Text_StuffNum;
|
|
public Button Button_Zero;
|
|
public TMP_Text Text_Zero;
|
|
public Button Button_Decrease;
|
|
//public TMP_Text Text_Decrease;
|
|
public Button Button_Add;
|
|
//public TMP_Text Text_Add;
|
|
public Button Button_Max;
|
|
public TMP_Text Text_Max;
|
|
public Image Image_NumBg;
|
|
public TMP_Text Text_Num;
|
|
public TMP_Text Text_Cost;
|
|
public Image Image_CostIcon;
|
|
public TMP_Text Text_CostNum;
|
|
public Button Button_ExchangeBtn;
|
|
|
|
///Auto Gen End///
|
|
|
|
private int UseCount = 0;
|
|
|
|
|
|
public async static UniTask<UIWindow> Open(int defaultCount = 1)
|
|
{
|
|
CommonUtils.CaptureScreenshot();
|
|
return await UIManager.Instance.CreateAndOpenWindow(UINameConst.UI_CreditPointExchangePanel, defaultCount);
|
|
}
|
|
|
|
// deal with input data
|
|
public override void PreLoad(object data = null)
|
|
{
|
|
UseCount = (int)data;
|
|
}
|
|
|
|
// Use this for initialization
|
|
public override void OnInit()
|
|
{
|
|
//bind UI GameObj
|
|
UI_CreditPointExchangePanelBinder.GetComponents(this);
|
|
|
|
var rawImage = GetComponent<RawImage>("GaussianBlurMask");
|
|
rawImage.texture = CommonUtils.GetScreenTexture2D();
|
|
|
|
BindButton(Button_back, OnBackClick);
|
|
|
|
|
|
}
|
|
|
|
//invoke when open window
|
|
protected override void OnShowWindow(object data = null)
|
|
{
|
|
|
|
}
|
|
|
|
//invoke when reload window
|
|
protected override void OnReloadWindow(object data = null)
|
|
{
|
|
|
|
}
|
|
|
|
//invoke when close window
|
|
protected override void OnHideWindow()
|
|
{
|
|
|
|
}
|
|
|
|
//invoke when destroy
|
|
public override void OnRelease()
|
|
{
|
|
base.OnRelease();
|
|
}
|
|
|
|
void RefreshCountUI()
|
|
{
|
|
var creditPoint = UseCount;
|
|
//var itemCfg = TableManager.Instance.Tables.Item.DataMap[GLConfig.Inst.data.p];
|
|
|
|
}
|
|
|
|
void OnBackClick()
|
|
{
|
|
CloseWindow();
|
|
}
|
|
|
|
|
|
} |