81 lines
1.7 KiB
C#
81 lines
1.7 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Video;
|
|
|
|
public class GameManager : MonoBehaviour
|
|
{
|
|
private static GameManager instance;
|
|
public static GameManager Instance { get { return instance; } }
|
|
|
|
|
|
public GameObject goParent;
|
|
public GameObject aIquestionAnswer;
|
|
public GameObject questionAnswer;
|
|
public GameObject onePageOne;
|
|
|
|
public GameObject BlackboardOne;
|
|
|
|
public GameObject OnePageThree;
|
|
public TextMeshProUGUI infoTGo;
|
|
public GameObject onePageEnd;
|
|
public GameObject Robot;
|
|
public InfoShow infoShow;
|
|
public GameObject Shop;
|
|
|
|
public Transform []shopModel;
|
|
public GameObject ImgMask;
|
|
public bool stopAnimation = false;
|
|
|
|
public string pointStrName = "";
|
|
void Start()
|
|
{
|
|
|
|
if (instance==null)
|
|
{
|
|
instance = this;
|
|
}
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
[Header("视频播放相关")]
|
|
public VideoPlayer videoPlayer;
|
|
public void showVideoPlayer(string path)
|
|
{
|
|
string fullPath = System.IO.Path.Combine(Application.streamingAssetsPath, path);
|
|
videoPlayer.url = fullPath;
|
|
// 播放视频
|
|
videoPlayer.Play();
|
|
}
|
|
|
|
public void StopVideoPlayer()
|
|
{
|
|
// 播放视频
|
|
videoPlayer.Stop();
|
|
}
|
|
|
|
public void SetActiveShop(int i)
|
|
{
|
|
int j = 0;
|
|
while (j <=shopModel.LongLength - 1)
|
|
{
|
|
if (j == i)
|
|
{
|
|
shopModel[j].gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
shopModel[j].gameObject.SetActive(false);
|
|
}
|
|
j++;
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|