E_ElecCompetition/Electrical_inspectionCompet.../Assets/Adam/Scripts/UIManager.cs

88 lines
2.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Adam;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
//============================================================
//支持中文文件使用UTF-8编码
//@author #AUTHOR#
//@create #CREATEDATE#
//@company #COMPANY#
//
//@description:总控
//============================================================
public class UIManager : MonoSingleton<UIManager>
{
public ToolsItemManager ToolsItemManager;
public MobileTerminalController MobileTerminalController;
public AssignmentController assignmentController;
public BottomController bottomCotroller;
public JobCardController jobCardController;
public ExitCheckController exitCheckController;
public ToolModelManager toolModelManager;
public Button exitBtn;
public Button backToToolBtn;
public Text threeDTip;
// Use this for initialization
private void Start()
{
exitBtn.onClick.AddListener(() =>
{
if (exitCheckController.num_click != 2)
{
exitCheckController.ResetPlane();
exitCheckController.ExitCheckPanel.SetActive(true);
}
else
{
Application.Quit();
}
});
exitBtn.gameObject.SetActive(false);
backToToolBtn.onClick.AddListener(() =>
{
ToolsItemManager.recoverEvent.RemoveAllListeners();
ToolsItemManager.ResetState();
backToToolBtn.gameObject.SetActive(false);
bottomCotroller.BirdEyeView.gameObject.SetActive(false);
BackToTool();
});
backToToolBtn.gameObject.SetActive(false);
DontDestroyOnLoad(this);
}
private async void BackToTool()
{
SceneLoad.Instance.SceneChange("工具间场景");
await Task.Delay(500);
toolModelManager.GetAllToolModels();
for (int i = 0; i < ToolsItemManager.toolItems.Count; i++)
{
for (int j = 0; j < toolModelManager.toolModelClicks.Length; j++)
{
if (ToolsItemManager.toolItems[i].originPos == toolModelManager.toolModelClicks[j].transform.localPosition)
{
Destroy(toolModelManager.toolModelClicks[j].gameObject);
}
}
}
}
public void SetThreeDTip(string name)
{
if (name == "")
{
threeDTip.transform.parent.gameObject.SetActive(false);
}
else
{
threeDTip.transform.parent.gameObject.SetActive(true);
threeDTip.text = name;
}
}
}