ZhangZhouSpecialEquipment/Assets/Scripts/ForkliftScreenController.cs

68 lines
1.6 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// ²æ³µÆÁÄ»¿ØÖÆ£¨³¡¾°Ìø×ª¡¢ÊÓÆµ²¥·Å£©
/// </summary>
public class ForkliftScreenController : MonoBehaviour
{
[Header("ģʽ½çÃæ")]
public GameObject[] AllRawImage;
public Button CZMNBtn; //Ä£Äâ²Ù×÷°´Å¥
public Button SGMNBtn; //ʹÊÄ£Äâ°´Å¥
public Button SGAlBtn; //ʹʰ¸Àý°´Å¥
[Header("ʹʰ¸Àý·µ»Ø°´Å¥")]
public Button SBCJRetrueBtn; //ʹʰ¸Àý·µ»Ø°´Å¥
private void Awake()
{
Init();
}
public void Init()
{
for (int i = 0; i < AllRawImage.Length; i++)
{
AllRawImage[i].SetActive(i == 0);
}
}
void Start()
{
CZMNBtn.onClick.AddListener(() =>
{
Debug.Log("CZMNBtn");
for (int i = 0; i < AllRawImage.Length; i++)
{
AllRawImage[i].SetActive(i == 1);
}
});
SGMNBtn.onClick.AddListener(() =>
{
Debug.Log("SGMNBtn");
for (int i = 0; i < AllRawImage.Length; i++)
{
AllRawImage[i].SetActive(i == 3);
}
});
SGAlBtn.onClick.AddListener(() =>
{
Debug.Log("SGAlBtn");
for (int i = 0; i < AllRawImage.Length; i++)
{
AllRawImage[i].SetActive(i == 3);
}
});
SBCJRetrueBtn.onClick.AddListener(() =>
{
Debug.Log("ʹʰ¸Àý·µ»Ø°´Å¥");
for (int i = 0; i < AllRawImage.Length; i++)
{
AllRawImage[i].SetActive(i == 0);
}
});
}
}