using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.Video; /// /// 起重机屏幕控制(场景跳转、视频播放) /// public class DisplayScreenController : MonoBehaviour { public GameObject[] AllRawImage; [Header("视频播放")] public Button StopBtn; //暂停按钮 public Button PlayBtn; //播放按钮 public Button SPBFRetrueBtn; //视频播放返回按钮 public AudioSource audioSource; //视频播放 public VideoPlayer player; //音频 [Header("模式选择")] public Button JGZCBtn; // 结构组成 public Button GNYLBtn; // 功能原理 public Button MNCZBtn; // 模拟操作 [Header("设备拆解返回按钮")] public Button SBCJRetrueBtn; //设备拆解返回按钮 [Header("操作界面")] public GameObject CZJMCanvas; //起重机操作界面 public Button CZJMRetrueBtn; //起重机操作界面返回按钮 public void Init() { for (int i = 0; i < AllRawImage.Length; i++) { AllRawImage[i].SetActive(i == 0); } } private void Awake() { Init(); } void Start() { JGZCBtn.onClick.AddListener(() => { Debug.Log("JGZCBtn"); for (int i = 0; i < AllRawImage.Length; i++) { AllRawImage[i].SetActive(i == 3); } }); GNYLBtn.onClick.AddListener(() => { Debug.Log("GNYLBtn"); for (int i = 0; i < AllRawImage.Length; i++) { AllRawImage[i].SetActive(i == 1); } }); MNCZBtn.onClick.AddListener(() => { Debug.Log("模拟操作"); for (int i = 0; i < AllRawImage.Length; i++) { AllRawImage[i].SetActive(i == 2); } CZJMCanvas.SetActive(true); }); SBCJRetrueBtn.onClick.AddListener(() => { Debug.Log("设备拆解返回按钮"); for (int i = 0; i < AllRawImage.Length; i++) { AllRawImage[i].SetActive(i == 0); } }); CZJMRetrueBtn.onClick.AddListener(() => { Debug.Log("起重机操作界面返回按钮"); for (int i = 0; i < AllRawImage.Length; i++) { AllRawImage[i].SetActive(i == 0); } CZJMCanvas.SetActive(false); }); SPBFRetrueBtn.onClick.AddListener(() => { Debug.Log("视频播放界面返回按钮"); for (int i = 0; i < AllRawImage.Length; i++) { AllRawImage[i].SetActive(i == 0); } }); } // Update is called once per frame void Update() { } }