/* * public void OpenPanel() * { * if(Panel != null) * { * bool isActive = Panel.activeSelf; * Panel.SetActive(!isActive); * } * } */ public void OpenPanel1() { InventoryScript inventory = InventoryScript.MyInstance; if (inventory.transform.position.z == 0) { inventory.GetComponent <CanvasGroup>().blocksRaycasts = false; inventory.transform.position = new Vector3(inventory.transform.position.x, inventory.transform.position.y, 1500f); } else { inventory.GetComponent <CanvasGroup>().blocksRaycasts = true; inventory.transform.position = new Vector3(inventory.transform.position.x, inventory.transform.position.y, 0f); } }