// this is code
public class Foo1Parent
{
}
public delegate void CallBack<T>(T arg1);
public delegate void CallBack();
public class Foo
{
public void openWindow<T>(CallBack<T> onWindowAwake) where T : Foo1Parent
{
Debug.Log("test");
onWindowAwake(T);
}
//I use reflection to call methods "openWindow"
public void openCWindow(CallBack onback, string dialogName)
{
Type t = Assembly.GetExecutingAssembly().GetType(dialogName);
MethodInfo meth1 = this.GetType().GetMethod("openWindow");
object[] obj = new object[] { null }
meth.Invoke(this, obj );
}
}
//this is my code
//this object[] How do you write it? or has other methods?
jeudi 24 octobre 2019
How to call this function with reflection method,Parameters are delegates and generics
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire