Question by
MikeBelyayev · Nov 15, 2019 at 05:49 AM ·
canvassetactive
UI will not reenalble after it was disabled
I'm disabling all UI canvas in my game, then I want to re-enable without much luck. It will re-enable if I reference particular canvas as GameObject but not using array and tag.
private void disableAllCanvas()
{
GameObject[] allCanvas = GameObject.FindGameObjectsWithTag("Canvas");
foreach(GameObject i in allCanvas)
{
i.SetActive(false);
}
}
private void enableAllCanvas()
{
GameObject[] allCanvas = GameObject.FindGameObjectsWithTag("Canvas");
foreach (GameObject i in allCanvas)
{
i.SetActive(true);
}
}
Comment
Your answer

Follow this Question
Related Questions
SetActive canvas relative to selected object 0 Answers
Hide/Unhide Canvas in AR Project 0 Answers
Enabling a disabled Canvas containing a ScrollRect makes the content jump to the bottom 0 Answers
UI Element not turning on with SetActive(true) 1 Answer
Getting component from derived classes 0 Answers