I am trying to use GameObject.FindObjectsOfTypeAll()
in UnityEngine and it is asking for an
Il2Cpp class, and if i do GameObject.FindObjectsOfTypeAll(typeof(Image))
i get the error cannot convert from "System.Type" to "Il2cppSystem.Type"
I also tried using GameObject.FindObjectsOfTypeAll(Il2CppSystem.Type.GetType("Image")) But this ends in a null reference exception.
This is what Im trying to do but it doesn't enter the foreach obviously
foreach (GameObject image in GameObject.FindObjectsOfTypeAll(typeof(Image)))
{
image.GetComponent<Image>().color = panelColor;
}
and
foreach (GameObject image in GameObject.FindObjectsOfTypeAll(Il2CppSystem.Type.GetType("Image")))
{
image.GetComponent<Image>().color = panelColor;
}