60 lines
1.1 KiB
C#
60 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Video;
|
|
|
|
public class GuoLuManager : MonoBehaviour
|
|
{
|
|
public static GuoLuManager Instance;
|
|
|
|
[Header("所有页面")]
|
|
public GameObject[] AllPages;
|
|
private int m_curPageNum = 0;
|
|
|
|
[Header("所有视频播放器")]
|
|
public VideoPlayer[] AllVideos;
|
|
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void ToOpenPage(int pageNum)
|
|
{
|
|
if (m_curPageNum != pageNum)
|
|
{
|
|
AllPages[pageNum].SetActive(true);
|
|
AllPages[m_curPageNum].SetActive(false);
|
|
m_curPageNum = pageNum;
|
|
|
|
if (m_curPageNum == 5)
|
|
{
|
|
QuizSystem.Instance.ToStartQuestion();
|
|
}
|
|
}
|
|
}
|
|
|
|
public void ToStartVideo(int videoNum)
|
|
{
|
|
AllVideos[videoNum].Play();
|
|
}
|
|
|
|
public void ToEndVideo(int videoNum)
|
|
{
|
|
AllVideos[videoNum].time = 0;
|
|
AllVideos[videoNum].Stop();
|
|
}
|
|
}
|