[SOLVED]
I have trouble understanding how to write this piece of code.
for instance:
void Start()
{
//To find all Fonts in InputField Text components
FindAllFonts<InputField>();
}
void FindAllFonts<T>()
{
//How to let my code now what objecttype it is.
//if I eg want to use T[] tempObject = FindObjectsOfType<T>();
//I can't use T directly but still want to keep it completely generic
}
I tried a lot of approaches but mostly get this error:
//
Severity Code Description Project File Line Suppression State
Error CS0314 The type ‘T’ cannot be used as type parameter ‘T’ in the generic type or method ‘Object.FindObjectsOfType()’. There is no boxing conversion or type parameter conversion from ‘T’ to ‘UnityEngine.Object’. UIPath_Prototyping01 E:\Unity Projects\Projects\UIPath_Prototyping01\Assets\Resources\Scripts\UITech\UIFactory.cs 91 Active
//