2024-11-27 22:24:11 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Unity.VisualScripting;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
public class BetBtn : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public static BetBtn instance;
|
2024-11-27 23:40:28 +08:00
|
|
|
|
public int BetHorseId;//Ͷע<CDB6><D7A2>ƥid
|
2024-11-27 22:24:11 +08:00
|
|
|
|
public GameObject BetList;
|
|
|
|
|
public Button NumBtn;
|
|
|
|
|
public Text BetText;
|
|
|
|
|
public float BetValue;//Ͷע<CDB6><D7A2>ֵ
|
|
|
|
|
public float AllBetValue;//Ͷע<CDB6><D7A2>ֵ
|
|
|
|
|
|
|
|
|
|
public Button BetButton;//Ͷע<CDB6>İ<EFBFBD>ť
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
instance = this;
|
|
|
|
|
BetList.SetActive(false);
|
|
|
|
|
NumBtn.onClick.AddListener(OnClickNumBtn);
|
|
|
|
|
BetValue = 50;//Ĭ<><C4AC>50
|
|
|
|
|
SetBet();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2024-11-28 03:35:20 +08:00
|
|
|
|
void BetOnClick()//<2F><><EFBFBD><EFBFBD>Ͷע
|
|
|
|
|
{
|
|
|
|
|
AllManeger.instance.Fuck523();
|
|
|
|
|
foreach (HorseInfo house in AllManeger.instance.horseInfos)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-27 22:24:11 +08:00
|
|
|
|
void OnClickNumBtn()
|
|
|
|
|
{
|
|
|
|
|
BetList.SetActive(true);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void SetBet()
|
|
|
|
|
{
|
|
|
|
|
// <20><>ȡ<EFBFBD><C8A1><EFBFBD>е<EFBFBD>Button<6F><6E><EFBFBD><EFBFBD>
|
|
|
|
|
Button[] buttons = BetList.GetComponentsInChildren<Button>();
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ÿһ<C3BF><D2BB>Button<6F><6E><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD>¼<EFBFBD>
|
|
|
|
|
foreach (Button button in buttons)
|
|
|
|
|
{
|
|
|
|
|
button.onClick.AddListener(() => {
|
|
|
|
|
BetText.text = button.transform.GetComponentInChildren<Text>().text;
|
|
|
|
|
BetValue = float.Parse(BetText.text);
|
|
|
|
|
BetList.SetActive(false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|