144 lines
3.1 KiB
C#
144 lines
3.1 KiB
C#
|
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;
|
|||
|
|
|||
|
// Start is called before the first frame update
|
|||
|
void Start()
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
btnMei.onClick.AddListener(() =>
|
|||
|
{
|
|||
|
//<2F><><EFBFBD>°<EFBFBD>ťͼƬ<CDBC>ϻ<EFBFBD>
|
|||
|
ImgUpward(imgMei, imgMeiQ);
|
|||
|
//<2F><>ǰѡ<C7B0>е<EFBFBD><D0B5><EFBFBD>ţ
|
|||
|
|
|||
|
});
|
|||
|
//֩<><D6A9><EFBFBD><EFBFBD>
|
|||
|
btnPig.onClick.AddListener(() =>
|
|||
|
{
|
|||
|
ImgUpward(imgPig, imgPigQ);
|
|||
|
});
|
|||
|
//<2F><>Һ
|
|||
|
btnDu.onClick.AddListener(() =>
|
|||
|
{
|
|||
|
ImgUpward(imgDu, imgDuQ);
|
|||
|
});
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
btnGang.onClick.AddListener(() =>
|
|||
|
{
|
|||
|
ImgUpward(imgGang, imgGangQ);
|
|||
|
});
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
btnBian.onClick.AddListener(() =>
|
|||
|
{
|
|||
|
ImgUpward(imgBian, imgBianQ);
|
|||
|
});
|
|||
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
btnChao.onClick.AddListener(() =>
|
|||
|
{
|
|||
|
ImgUpward(imgChao, imgChaoQ);
|
|||
|
});
|
|||
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
btnLei.onClick.AddListener(() =>
|
|||
|
{
|
|||
|
ImgUpward(imgLei, imgLeiQ);
|
|||
|
});
|
|||
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
btnMie.onClick.AddListener(() =>
|
|||
|
{
|
|||
|
ImgUpward(imgMie, imgMieQ);
|
|||
|
});
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
// Update is called once per frame
|
|||
|
void Update()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
private void ImgUpward(RectTransform rec,GameObject obj)
|
|||
|
{
|
|||
|
//<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);
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬһ<CDAC><D2BB><EFBFBD><EFBFBD>ť
|
|||
|
if (nowObj == obj && nowImg == rec)
|
|||
|
{
|
|||
|
nowImg = null;
|
|||
|
nowObj = null;
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
rec.localPosition = new Vector3(0,50,0);
|
|||
|
obj.SetActive(true);
|
|||
|
|
|||
|
//<2F><><EFBFBD>¸<EFBFBD>ֵ
|
|||
|
nowImg=rec;
|
|||
|
nowObj=obj;
|
|||
|
|
|||
|
}
|
|||
|
}
|