Web_Rot/Assets/Scripts/Canvas_UI.cs
2026-04-08 17:29:58 +08:00

61 lines
1.3 KiB
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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()
{
}
}