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.

79 lines
2.3 KiB

2 years ago
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using static UnityEditor.PlayerSettings;
public class LevelNewTask : MonoBehaviour
{
public static LevelNewTask Instacne;
public GameObject shouTip;
public Transform[] points;//手的点位
public Text tipText;
GameObject shou;
bool gameEnd = false;
int curIndex=-1;
string[] taskInfo = {
"欢迎来到图像模型训练关卡,点击开始按钮进行学习。",
"点击地图上的相应区域可以对区域进行监视",
"点击小地图上的图标可以快速跳转到对应区域",
"点击截图可以对监控区域进行图片取样",
"接下来请自由选择区域进行截图最终需要截取6张图片",
"接下来进入图像模型训练参数配置环节",
"请输入图像模型训练的参数,并点击确认完成参数配置",
"点击按钮查看分析之后的图像"
};
public
void Awake() {
Instacne = this;
}
void Start() {
StartTask(0);
}
void StartTask(int index) {
curIndex = index;
TaskTip(taskInfo[curIndex], points[curIndex].position);
}
void Update() {
if (gameEnd) return;
shou.transform.position = points[curIndex].position + Vector3.down * 10;
}
void TaskTip(string str,Vector3 pos) {
tipText.text = "";
tipText.DOText(str, 1);
if (shou)
{
shou.SetActive(true);
}
else {
shou = Instantiate(shouTip, FindObjectOfType<Canvas>().transform);
}
shou.transform.position = pos + Vector3.down*10;
}
public void FinishTask(int index) {
if (index != curIndex) return;
curIndex++;
if (index == points.Length - 1) {
shou.SetActive(false);
tipText.text = "";
tipText.DOText("恭喜通关", 1);
gameEnd = true;
EduCoderTool.WebConnecter.Singleton.SendResultToWeb(true);
return;
}
shou.SetActive(false);
StartTask(curIndex);
}
public void TaskFinish() {
shou.SetActive(false);
tipText.text = "";
tipText.DOText("恭喜通关", 1);
}
}