Unity3d 多次显示关闭一个UI
publicclass OpenClooseGoUI : MonoBehaviour {
public GameObject closeBt;
public GameObject goUI;
public GameObject openBt;
void Start () {
if(closeBt)
UIEventListener.Get(closeBt).onPress += closeList;
if(openBt)
UIEventListener.Get(openBt).onPress += openList;
}
void closeList(GameObject go, bool istrue) {
if (istrue)
return;
openCloose(false);
}
internal void openCloose(bool isbool){
opencloosegoUI(isbool);
}
void openList(GameObject go, bool istrue) {
if (istrue)
return;
openCloose(true);
}
void opencloosegoUI(bool isbool)
{
if(goUI && goUI.active!=isbool)
goUI.SetActiveRecursively(isbool);
}
}