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.
55 lines
1.5 KiB
55 lines
1.5 KiB
using UnityEngine; |
|
using AX.MessageSystem; |
|
using System; |
|
using UnityEngine.UI; |
|
|
|
public class HideTopName : BaseToggle |
|
{ |
|
private Transform topNameParent; |
|
// private Transform haemalPanel; |
|
public bool isPlaneView; |
|
|
|
public override void RespondFun(bool value) |
|
{ |
|
if(isPlaneView) |
|
{ |
|
if (topNameParent.gameObject.activeInHierarchy) |
|
{ |
|
topNameParent.gameObject.SetActive(false); |
|
} |
|
LoadPromptWin.Instance.LoadTextPromptWindow("当前为预案视角,无需隐藏名称", 1f); |
|
GetComponent<Toggle>().isOn = false; |
|
return; |
|
} |
|
topNameParent.gameObject.SetActive(!value); |
|
// haemalPanel.gameObject.SetActive(!value); |
|
|
|
} |
|
|
|
void Start() |
|
{ |
|
|
|
topNameParent = GameObject.Find("Canvas").transform.Find("TheHeadName"); |
|
// haemalPanel = GameObject.Find("Canvas").transform.Find("HaemalPanel"); |
|
//MessageDispatcher.AddListener("PlaneView_Open", Hidename); |
|
} |
|
|
|
//public override void OnDisable() |
|
//{ |
|
// MessageDispatcher.RemoveListener("PlaneView_Open", Hidename); |
|
//} |
|
|
|
//public override void OnDestroy() |
|
//{ |
|
// MessageDispatcher.RemoveListener("PlaneView_Open", Hidename); |
|
//} |
|
|
|
//private void Hidename(IMessage obj) |
|
//{ |
|
// if (GetComponent<Toggle>().isOn) |
|
// { |
|
// GetComponent<Toggle>().isOn = false; |
|
// } |
|
// isPlaneView = true; |
|
//} |
|
}
|
|
|