1118OPSSNew/Assets/Zion/Scripts/指挥界面/TipsManager.cs

59 lines
1.4 KiB
C#

using DataModel.Model;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TipsManager : MonoBehaviour
{
public static TipsManager instance;
public Text tipText;
public GameObject tipsObj;
private void Awake()
{
instance = this;
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void ShowStepsTip(string pratciesubjectstepId)
{
if (LoadManage.Instance.currentPractice.MissionModel=="考核") return;
practicesubjectstep pstep = LoadManage.Instance.psteps.Find(a => a.ID== pratciesubjectstepId);
practiceseat pseat = LoadManage.Instance.myPracticeSeat.Find(a => a.Field_Char1 == pstep.PracticeSubjectId);
if (pseat != null&& pseat.SeatId== pstep.SeatId)
{
tipsObj.SetActive(true);
tipText.text = pstep.Name;
Invoke("HideTips", 5);
}
}
public void ShowSubjectTip(string subjectName, bool isOn)
{
tipsObj.SetActive(true);
if (isOn)
{
tipText.text = subjectName + "科目已开启";
}
else
{
tipText.text = subjectName + "科目已关闭";
}
Invoke("HideTips", 5);
}
public void HideTips()
{
tipsObj.SetActive(false);
}
}