2025-07-02 10:24:01 +08:00
|
|
|
using System;
|
2025-06-17 09:31:12 +08:00
|
|
|
using UnityEngine.UI;
|
|
|
|
using TMPro;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace HK
|
|
|
|
{
|
|
|
|
public class Product5ConfirmItem : UIItemBase
|
|
|
|
{
|
2025-07-02 10:24:01 +08:00
|
|
|
[SerializeField] private TMP_Text txtPrice;
|
|
|
|
[SerializeField] private Button btnConfirm;
|
|
|
|
Book_M book;
|
|
|
|
public Action ClickAction;
|
2025-06-17 09:31:12 +08:00
|
|
|
|
|
|
|
public override void OnInit()
|
|
|
|
{
|
|
|
|
base.OnInit();
|
2025-07-02 10:24:01 +08:00
|
|
|
|
2025-06-17 09:31:12 +08:00
|
|
|
#region AutoGen_Init
|
|
|
|
|
2025-07-02 10:24:01 +08:00
|
|
|
txtPrice = GetValue<TMP_Text>("txtPrice");
|
|
|
|
btnConfirm = GetValue<Button>("btnConfirm");
|
|
|
|
|
|
|
|
btnConfirm.onClick.AddListener(OnClickbtnConfirm);
|
2025-06-17 09:31:12 +08:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
|
2025-07-02 10:24:01 +08:00
|
|
|
public void SetBook(Book_M book)
|
|
|
|
{
|
|
|
|
this.book = book;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnShow()
|
|
|
|
{
|
|
|
|
base.OnShow();
|
|
|
|
book.SetIndex(4);
|
|
|
|
}
|
|
|
|
|
2025-06-17 09:31:12 +08:00
|
|
|
#region AutoGen_Method
|
2025-07-02 10:24:01 +08:00
|
|
|
|
|
|
|
private void OnClickbtnConfirm()
|
|
|
|
{
|
|
|
|
ClickAction?.Invoke();
|
|
|
|
}
|
2025-06-17 09:31:12 +08:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
public override void OnDispose()
|
|
|
|
{
|
|
|
|
base.OnDispose();
|
2025-07-02 10:24:01 +08:00
|
|
|
|
2025-06-17 09:31:12 +08:00
|
|
|
#region AutoGen_Dispose
|
|
|
|
|
2025-07-02 10:24:01 +08:00
|
|
|
btnConfirm.onClick.RemoveListener(OnClickbtnConfirm);
|
|
|
|
|
|
|
|
txtPrice = null;
|
|
|
|
btnConfirm = null;
|
2025-06-17 09:31:12 +08:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|