You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.1 KiB
90 lines
2.1 KiB
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
using UnityEngine.UI;
|
|
using DG.Tweening;
|
|
|
|
public class GZUI : MonoBehaviour
|
|
{
|
|
public GameObject uiPanel;
|
|
public GameObject tip;
|
|
public Button gz;
|
|
public QuestionPanel question;
|
|
public bool quesFlag = false;
|
|
public PlayableDirector open;
|
|
public List<PlayableDirector> operation;
|
|
|
|
public Transform cameraPos;
|
|
public List<Button> trigger;
|
|
public List<JDTLoad> jdts;
|
|
public int id = 0;
|
|
private void Awake()
|
|
{
|
|
gz.onClick.AddListener(() =>
|
|
{
|
|
tip.SetActive(false);
|
|
question.gameObject.SetActive(true);
|
|
gz.gameObject.SetActive(false);
|
|
question.InitQuestion("电脑故障判断");
|
|
question.sureEvent.AddListener(() =>
|
|
{
|
|
uiPanel.SetActive(true);
|
|
});
|
|
});
|
|
|
|
trigger[0].onClick.AddListener(() =>
|
|
{
|
|
operation[0].Play();
|
|
trigger[0].gameObject.SetActive(false);
|
|
});
|
|
|
|
trigger[1].onClick.AddListener(() =>
|
|
{
|
|
operation[1].Play();
|
|
trigger[1].gameObject.SetActive(false);
|
|
});
|
|
}
|
|
|
|
public void ReturnCamera()
|
|
{
|
|
Camera.main.transform.DOMove(cameraPos.position, 2);
|
|
Camera.main.transform.DOLocalRotate(cameraPos.localEulerAngles, 2);
|
|
}
|
|
|
|
IEnumerator Wait(Action action)
|
|
{
|
|
yield return new WaitForSeconds(2);
|
|
action?.Invoke();
|
|
}
|
|
|
|
public void End()
|
|
{
|
|
ReturnCamera();
|
|
jdts[id].Load();
|
|
id++;
|
|
if (id>=2)
|
|
{
|
|
EduCoderTool.WebConnecter.Singleton.SendResultToWeb(true);
|
|
return;
|
|
}
|
|
StartCoroutine(Wait(() =>
|
|
{
|
|
trigger[id].gameObject.SetActive(true);
|
|
}));
|
|
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 开始检测
|
|
/// </summary>
|
|
public void StartJC()
|
|
{
|
|
open.Play();
|
|
GameStageManager.Instance.currentStage = GameStage.展示;
|
|
trigger[0].gameObject.SetActive(true);
|
|
}
|
|
}
|