jeudi 19 novembre 2020

Unity, get access to internal class of another packages

So, I got this official unity package called python for untiy. It has a few internal class and a few public classes.

I need to access a property of internal class. So basiclly what i did was, I find the container assembly using some public class in that package. So basicly:

var pythonPackageAssembly = typeof(ThePublicClass).Assembly;
var theInternalType = pythonAssembly.GetType("internalClassName");
if (type is null){
    Oah no, it is null
}

But it says the type I found is null. I wonder if there's any mistake I made during the process. Or what is the correct way to access it, thank you!

There is a few similiar topiced question in SO, here is a quick explanation why I'm in a bit different situation

  1. First Link, I don't have a instance of the class to start from, and I cannot modify the package.
  2. Second Link, I basically follow the answer there, but the problem is I dont think in unity C# you can give full trust




Aucun commentaire:

Enregistrer un commentaire