public void CloseMesseageAndDeleteResponse() { GameObject panelMesseage = GameObject.FindWithTag("Window");; Destroy(panelMesseage); RiskManager riskManager = GameObject.Find("RiskManager").GetComponent <RiskManager>(); ResponseManager responseManager = GameObject.Find("InventoryData").GetComponent <ResponseManager>(); if (responseManager.responses[riskManager.response] != null) { responseManager.DeleteResponse(riskManager.response); } SetIsAllopenWindow(); }