using UnityEngine; using System.Collections; using AX.TrackRecord; using System; using UnityEngine.EventSystems; public class ShowOilTankResetWin : MonoBehaviour { private DateTime t1, t2; private RaycastHit hit; public GameObject ResteExplodeWin; public GameObject youGuanParent; // Use this for initialization void Start () { ResteExplodeWin = GameObject.Find("Canvas").transform.Find("ResteExplodeWin").gameObject; } // Update is called once per frame void Update () { //创建考题,备课中新建课件,自学 if (ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.CreatQuestion || ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.EditQuestion || ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.CopyQuestion || ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.PrepareMode || ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.EditCourceware || ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.SelfStudyMode) { //新建节点,既没有新建节点也没有加载节点两种情况下允许弹出设置窗口(加载节点不允许弹出灾情设置编辑窗口) if (RecordManager.Instance.IsRecording || (!RecordManager.Instance.IsRecording && !LoadManager.Instance.IsPlayBacking)) { if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject()) { t2 = DateTime.Now; if (t2 - t1 < new TimeSpan(0, 0, 0, 0, 249)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, Mathf.Infinity)) { if (this.transform.parent.GetChild(0).name == hit.transform.parent.parent.GetChild(0).name) { ResteExplodeWin.SetActive(true); ResteExplodeWin.transform.Find("ConfirmButton").GetComponent().youGuanParent = youGuanParent; } } } t1 = t2; } } } } }