C#C
C#2y ago
Althos

Delegate.CreateDelegate returns "ArgumentException: method arguments are incompatible"

Any idea what I did wrong here ? My method seems to be of the correct type
        public void RegenerateEventEnums()
        {
            FieldInfo[] fields = typeof(Card).GetFields();
            foreach (FieldInfo field in fields)
            {
                var del = Delegate.CreateDelegate(typeof(Action<Card>), GetType().GetMethod("Test"));
            }
        }

        public void Test(Card card)
        {
            Debug.Log("My card!");
        }
Was this page helpful?