using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class BTN_Hide : MonoBehaviour { static Toggle _toggle; static GameObject[] _toHide = null; public static void ShowBTNS() { if (!SceneModeManager.CompareSceneMode(SceneModes.Navigate)) return; if (_toggle == null) { GameObject pNLOnOff = Get.o1("PNLOnOff"); if (pNLOnOff == null) return; _toggle = pNLOnOff.GetComponent(); if (_toggle == null) return; } if (_toHide == null) { _toHide = GameObject.FindGameObjectsWithTag("tohide"); if( _toHide == null) { return; } } if (!_toggle.isOn) return; bool ONOFF = MouseCheck.MouseOn_BTN_Around(); //_G.SM = SceneModes.ShowTips; foreach (GameObject see in _toHide) { CanvasGroup canvasGroup = see.GetComponent(); if (canvasGroup == null) continue; canvasGroup.alpha = ONOFF ? 1f : 0f; } } }