My project has 2 DLLs, one is Android specific and the other is platform independent. The independent DLL loads the Android assembly and calls the GetTypes method but it is not returning all of the public classes. The Android DLL has 3 classes, 2 are static with static methods only. Only one can be instantiated. The static classes are not returned.
Class1.cs (compile to dll in VS):
using System;
using System.Reflection;
namespace ClassLibrary1
{
public class Class1
{
public void test()
{
Assembly asm = Assembly.Load("ClassLibrary2");
Type T = asm.GetType("ClassLibrary2.Class2");
T.InvokeMember("Method", BindingFlags.Static | BindingFlags.InvokeMethod, null, T, null);
}
}
}
Class2.cs (Compile to a separate dll in VS):
namespace ClassLibrary2
{
public static class Class2
{
public static void Method()
{
return;
}
}
}
UnityClass.cs (Assign to a Empty GameObject in Unity 5.x):
using UnityEngine;
using System;
class UnityClass : MonoBehaviour
{
public void Start()
{
var x = new ClassLibrary1.Class1();
x.test();
}
}