2024-11-27 22:24:11 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class RacingPanel : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
public Button btnHelp;
|
|
|
|
|
//Ͷ<><CDB6><EFBFBD>ϵ<EFBFBD>
|
|
|
|
|
public Button btnPut;
|
|
|
|
|
//<2F>ھ<EFBFBD><DABE><EFBFBD>¼
|
|
|
|
|
public Button btnFirst;
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
public Button btnTask;
|
|
|
|
|
//<2F>ر<EFBFBD>
|
|
|
|
|
public Button btnClose;
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
public Button btnMei;
|
|
|
|
|
//֩<><D6A9><EFBFBD><EFBFBD>
|
|
|
|
|
public Button btnPig;
|
|
|
|
|
//<2F><>Һ
|
|
|
|
|
public Button btnDu;
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public Button btnGang;
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public Button btnBian;
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
public Button btnChao;
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
public Button btnLei;
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
public Button btnMie;
|
|
|
|
|
|
|
|
|
|
public RectTransform imgMei;
|
|
|
|
|
public RectTransform imgPig;
|
|
|
|
|
public RectTransform imgDu;
|
|
|
|
|
public RectTransform imgGang;
|
|
|
|
|
public RectTransform imgBian;
|
|
|
|
|
public RectTransform imgChao;
|
|
|
|
|
public RectTransform imgLei;
|
|
|
|
|
public RectTransform imgMie;
|
|
|
|
|
//<2F><>ǰѡ<C7B0>е<EFBFBD>ͼƬλ<C6AC><CEBB>
|
|
|
|
|
private RectTransform nowImg;
|
|
|
|
|
|
|
|
|
|
public GameObject imgMeiQ;
|
|
|
|
|
public GameObject imgPigQ;
|
|
|
|
|
public GameObject imgDuQ;
|
|
|
|
|
public GameObject imgGangQ;
|
|
|
|
|
public GameObject imgBianQ;
|
|
|
|
|
public GameObject imgChaoQ;
|
|
|
|
|
public GameObject imgLeiQ;
|
|
|
|
|
public GameObject imgMieQ;
|
|
|
|
|
//<2F><>ǰѡ<C7B0><D1A1><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3>Ǯ
|
|
|
|
|
private GameObject nowObj;
|
|
|
|
|
|
2024-11-27 23:40:28 +08:00
|
|
|
|
//<2F><>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6>Ǯ
|
|
|
|
|
public Text imgMeiT;
|
|
|
|
|
public Text imgPigT;
|
|
|
|
|
public Text imgDuT;
|
|
|
|
|
public Text imgGangT;
|
|
|
|
|
public Text imgBianT;
|
|
|
|
|
public Text imgChaoT;
|
|
|
|
|
public Text imgLeiT;
|
|
|
|
|
public Text imgMieT;
|
|
|
|
|
|
|
|
|
|
public Text AllimgMeiT;
|
|
|
|
|
public Text AllimgPigT;
|
|
|
|
|
public Text AllimgDuT;
|
|
|
|
|
public Text AllimgGangT;
|
|
|
|
|
public Text AllimgBianT;
|
|
|
|
|
public Text AllimgChaoT;
|
|
|
|
|
public Text AllimgLeiT;
|
|
|
|
|
public Text AllimgMieT;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
btnMei.onClick.AddListener(() =>
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD>°<EFBFBD>ťͼƬ<CDBC>ϻ<EFBFBD>
|
2024-12-06 16:15:57 +08:00
|
|
|
|
ImgUpward(imgMei, imgMeiQ,1);
|
2024-11-27 22:24:11 +08:00
|
|
|
|
//<2F><>ǰѡ<C7B0>е<EFBFBD><D0B5><EFBFBD>ţ
|
2024-12-06 16:15:57 +08:00
|
|
|
|
//BetBtn.instance.BetHorseId = 1;
|
|
|
|
|
|
2024-11-27 22:24:11 +08:00
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
//֩<><D6A9><EFBFBD><EFBFBD>
|
|
|
|
|
btnPig.onClick.AddListener(() =>
|
|
|
|
|
{
|
2024-12-06 16:15:57 +08:00
|
|
|
|
ImgUpward(imgPig, imgPigQ,2);
|
|
|
|
|
//BetBtn.instance.BetHorseId = 2;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
});
|
|
|
|
|
//<2F><>Һ
|
|
|
|
|
btnDu.onClick.AddListener(() =>
|
|
|
|
|
{
|
2024-12-06 16:15:57 +08:00
|
|
|
|
ImgUpward(imgDu, imgDuQ,3);
|
|
|
|
|
//BetBtn.instance.BetHorseId = 3;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
});
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
btnGang.onClick.AddListener(() =>
|
|
|
|
|
{
|
2024-12-06 16:15:57 +08:00
|
|
|
|
ImgUpward(imgGang, imgGangQ,4);
|
|
|
|
|
//BetBtn.instance.BetHorseId = 4;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
});
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
btnBian.onClick.AddListener(() =>
|
|
|
|
|
{
|
2024-12-06 16:15:57 +08:00
|
|
|
|
ImgUpward(imgBian, imgBianQ,5);
|
|
|
|
|
//BetBtn.instance.BetHorseId = 5;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
});
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
btnChao.onClick.AddListener(() =>
|
|
|
|
|
{
|
2024-12-06 16:15:57 +08:00
|
|
|
|
ImgUpward(imgChao, imgChaoQ,6);
|
|
|
|
|
//BetBtn.instance.BetHorseId = 6;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
});
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
btnLei.onClick.AddListener(() =>
|
|
|
|
|
{
|
2024-12-06 16:15:57 +08:00
|
|
|
|
ImgUpward(imgLei, imgLeiQ,7);
|
|
|
|
|
//BetBtn.instance.BetHorseId = 7;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
});
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
btnMie.onClick.AddListener(() =>
|
|
|
|
|
{
|
2024-12-06 16:15:57 +08:00
|
|
|
|
ImgUpward(imgMie, imgMieQ,8);
|
|
|
|
|
//BetBtn.instance.BetHorseId = 8;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-06 16:15:57 +08:00
|
|
|
|
private void ImgUpward(RectTransform rec,GameObject obj,int id)
|
2024-11-27 22:24:11 +08:00
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>жϵ<D0B6>ǰͼƬ<CDBC>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA> <20><>Ϊ<EFBFBD>ղŴ<D5B2><C5B4><EFBFBD>
|
|
|
|
|
if (nowImg!=null)
|
|
|
|
|
{
|
|
|
|
|
nowImg.localPosition = Vector3.zero;
|
|
|
|
|
}
|
|
|
|
|
//<2F>жϵ<D0B6>ǰѡ<C7B0>е<EFBFBD><D0B5><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA> <20><>Ϊ<EFBFBD>ղŴ<D5B2><C5B4><EFBFBD>
|
|
|
|
|
if (nowObj!=null)
|
|
|
|
|
{
|
|
|
|
|
nowObj.SetActive(false);
|
2024-12-06 16:15:57 +08:00
|
|
|
|
|
2024-11-27 22:24:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬһ<CDAC><D2BB><EFBFBD><EFBFBD>ť
|
|
|
|
|
if (nowObj == obj && nowImg == rec)
|
|
|
|
|
{
|
2024-12-06 16:15:57 +08:00
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>ť");
|
|
|
|
|
BetBtn.instance.BetHorseId = 0;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
nowImg = null;
|
|
|
|
|
nowObj = null;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rec.localPosition = new Vector3(0,50,0);
|
|
|
|
|
obj.SetActive(true);
|
2024-12-06 16:15:57 +08:00
|
|
|
|
BetBtn.instance.BetHorseId = id;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
//<2F><><EFBFBD>¸<EFBFBD>ֵ
|
2024-12-06 16:15:57 +08:00
|
|
|
|
nowImg =rec;
|
2024-11-27 22:24:11 +08:00
|
|
|
|
nowObj=obj;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|