public void OnClick() { foreach (var item in buttons) { mBtnScript = item.GetComponent <M_ButtonScript>(); if (mBtnScript.isMoving) { return; } } if (!menuOpen) { MenuSet(true); } else { foreach (var item in buttons) { mBtnScript = item.GetComponent <M_ButtonScript>(); mBtnScript.Return(); } } menuOpen = !menuOpen; }
private void Update() { if (comeBackNum >= 3) { comeBackNum = 0; foreach (var item in buttons) { mBtnScript = item.GetComponent <M_ButtonScript>(); mBtnScript.Reset(); } MenuSet(false);//////// } // if(Input.GetKeyUp(KeyCode.Escape)) // { // } }