public void OnPointerClick(PointerEventData eventData) { Debug.Log(gameObject.transform.GetChild(0)); GeneralSubMenu subPanel = gameObject.transform.GetChild(0).gameObject.GetComponent <GeneralSubMenu>(); if (!subPanel.isOnMouse()) { gameObject.SetActive(false); } }
// Start is called before the first frame update void Awake() // Может и не сработать { SMSP = gameObject.GetComponent <SellMineralSubPanel>(); GSM = gameObject.GetComponent <GeneralSubMenu>(); }