61 lines
1.3 KiB
C#
61 lines
1.3 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
|
||
public class Canvas_UI : MonoBehaviour
|
||
{
|
||
[SerializeField]
|
||
Button XuanZhuan_Btn;
|
||
[SerializeField]
|
||
Button ChongZhi_Btn;
|
||
|
||
[SerializeField]
|
||
Dropdown dd;
|
||
|
||
[SerializeField]
|
||
ModelRot modelRot;
|
||
|
||
/// <summary>
|
||
/// ÏÂÀ¿ò¶ÔÓ¦µÄGameÎïÌå
|
||
/// </summary>
|
||
public List<GameObject> ddGame;
|
||
// Start is called before the first frame update
|
||
void Start()
|
||
{
|
||
XuanZhuan_Btn.onClick.AddListener(() =>
|
||
{
|
||
modelRot.isRot = !modelRot.isRot;
|
||
});
|
||
ChongZhi_Btn.onClick.AddListener(() =>
|
||
{
|
||
modelRot.isRot = false;
|
||
modelRot.ChongZhi_BtnCallBack();
|
||
});
|
||
|
||
dd.value = 0;
|
||
dd.onValueChanged.AddListener((c) =>
|
||
{
|
||
modelRot.isRot = false;
|
||
modelRot.ChongZhi_BtnCallBack();
|
||
for (int i = 0; i < ddGame.Count; i++)
|
||
{
|
||
if (i!=c)
|
||
{
|
||
ddGame[i].SetActive(false);
|
||
}
|
||
else
|
||
{
|
||
ddGame[i].SetActive(true);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
// Update is called once per frame
|
||
void Update()
|
||
{
|
||
|
||
}
|
||
}
|