_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Conversion/DonatePanel.cs

25 lines
779 B
C#
Raw Normal View History

2024-11-26 15:50:49 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2024-11-26 22:41:24 +08:00
using UnityEngine.UI;
2024-11-26 15:50:49 +08:00
2024-11-26 22:41:24 +08:00
public class DonatePanel : BaseUIPanel
2024-11-26 15:50:49 +08:00
{
2024-11-26 22:41:24 +08:00
public Button Button1;
public Button Button2;
public GameObject game;
2024-11-26 15:50:49 +08:00
void Start()
{
2024-11-26 22:41:24 +08:00
Button1.onClick.AddListener(() => ButtononClick(DonatePanelItem.mode.voluteCoin, Button1));
Button2.onClick.AddListener(() => ButtononClick(DonatePanelItem.mode.slot, Button2));
2024-11-26 15:50:49 +08:00
}
2024-11-26 22:41:24 +08:00
void ButtononClick(DonatePanelItem.mode mymode, Button button)
2024-11-26 15:50:49 +08:00
{
2024-11-26 22:41:24 +08:00
ButtonClickAnimationAsync(button.gameObject);
Canvas canvas = GetComponentInParent<Canvas>();
GameObject conver = Instantiate(game, canvas.transform);
conver.GetComponentInChildren<DonatePanelItem>().mymode = mymode;
2024-11-26 15:50:49 +08:00
}
}