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.
71 lines
1.9 KiB
71 lines
1.9 KiB
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
using UnityEngine.EventSystems; |
|
using AX.MessageSystem; |
|
|
|
public class NodeDetailShow : MonoBehaviour, IPointerClickHandler |
|
{ |
|
public Text detail; |
|
public ReplayManager replayManager; |
|
public bool control = false; |
|
private float time; |
|
public TagShow TagShow; |
|
// Use this for initialization |
|
void Awake() |
|
{ |
|
TagShow = GameObject.Find("Canvas/TopUI/TagPanel/TagShow") .GetComponent<TagShow>(); |
|
} |
|
|
|
// Update is called once per frame |
|
void Update() |
|
{ |
|
if (control) |
|
{ |
|
time -= Time.deltaTime; |
|
if (time < 0) |
|
{ |
|
gameObject.SetActive(false); |
|
control = false; |
|
if (replayManager.playOrPause.isOn)//增加判断,防止在显示提示信息的时候点击了暂停播放 |
|
{ |
|
replayManager.Play(); |
|
} |
|
} |
|
} |
|
} |
|
public void SetUI(string text) |
|
{ |
|
detail.text = text; |
|
time = 5; |
|
control = true; |
|
|
|
} |
|
public void SetControl() |
|
{ |
|
control = false; |
|
if (GameObject.Find("Canvas/TopUI/TagPanel/TagShow")) |
|
{ |
|
TagShow= GameObject.Find("Canvas/TopUI/TagPanel/TagShow").GetComponent<TagShow>(); |
|
TagShow.tagDetail.SetActive(false); |
|
TagShow.tagMessage.SetActive(false); |
|
TagShow.gameObject.SetActive(false); |
|
|
|
} |
|
|
|
gameObject.SetActive(false); |
|
} |
|
public void OnPointerClick(PointerEventData eventData) |
|
{ |
|
TagShow.tagDetail.SetActive(false); |
|
TagShow.tagMessage.SetActive(false); |
|
TagShow.gameObject.SetActive(false); |
|
if (transform.parent.name== "TopUI") |
|
{ |
|
gameObject.SetActive(false); |
|
} |
|
control = false; |
|
replayManager.Play(); |
|
} |
|
}
|
|
|