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.

94 lines
2.7 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MenuWindow : WindowBase
{
[Header("镜头移动面板")]
public GameObject CameraMovePanel;
public ButtonExtension upBtn;
public ButtonExtension downBtn;
public ButtonExtension leftBtn;
public ButtonExtension rightBtn;
[Header("按钮")]
public Button BuShuBtn;
public Button BuShuOkBtn;
public Button SceneSlectedBtn;
public Button ModelTrainBtn;
[Header("物件")]
public GameObject FangZhiAear;
public GameObject ToolAear;
public GameObject ModelTrainPanel;
public GameObject OverTip;
public GameObject kuang;
public Text tougeText;
private bool CheckResult;
public override void Init()
{
base.Init();
ButtonRigister();
}
private void ButtonRigister()
{
upBtn.onPress.AddListener(() => { CameraManager.Instance.MoveMainCamera(-Vector3.back); });
downBtn.onPress.AddListener(() => { CameraManager.Instance.MoveMainCamera(Vector3.back); });
leftBtn.onPress.AddListener(() => { CameraManager.Instance.MoveMainCamera(Vector3.left); });
rightBtn.onPress.AddListener(() => { CameraManager.Instance.MoveMainCamera(-Vector3.left); });
BuShuBtn.onClick.AddListener(() => {
ToolAear.SetActive(true);
BuShuBtn.gameObject.SetActive(false);
BuShuOkBtn.gameObject.SetActive(true);
FangZhiAear.SetActive(true);
});
BuShuOkBtn.onClick.AddListener(() => {
if (GameRoot.Instance.gameModeWindow.CheckBushuState())
{
BuShuOkBtn.gameObject.SetActive(false);
ToolAear.SetActive(false);
FangZhiAear.SetActive(false);
//SceneSlectedBtn.gameObject.SetActive(true);
//第一关写图像分析代码做模型训练在这接着写
ModelTrainBtn.gameObject.SetActive(true);
}
});
ModelTrainBtn.onClick.AddListener(() => {
ModelTrainPanel.SetActive(true);
CheckResult = true;
});
SceneSlectedBtn.onClick.AddListener(() => {
GameRoot.Instance.sceneSlectedWnd.gameObject.SetActive(true);
SceneSlectedBtn.gameObject.SetActive(false);
});
}
private void Update()
{
if ((tougeText.text.Contains("Y")|| (tougeText.text.Contains("T"))|| (tougeText.text.Contains("t")) && CheckResult))
{
CheckResult = false;
OverTip.SetActive(true);
kuang.SetActive(true);
EduCoderTool.WebConnecter.Singleton.SendResultToWeb(true);
}
}
}