Packing PUN+ into a DLL

Options
Hello,

I'm trying to compile all of my project's code into a DLL. Obviously, a lot of my scripts use Photon's classes and code, so what I've been trying to do is to also include PUN in my custom DLL.

Everything's good, up to the moment when I have my DLL ready, I press play, and litterally every object that has a PhotonView component on it generates this exception on the console

--- NullReferenceException: Object reference not set to an instance of an object
--- PhotonNetwork..cctor ()
--- Rethrow as TypeInitializationException: An exception was thrown by
the type initializer for PhotonNetwork
--- ExitGames.Client.Photon.SupportClass+<>c__DisplayClass7_0.b__0 ()

Any ideas?

Comments

  • Oh, right, some additional info I forgot to add.

    I've been compiling the code without all of the scripts inside folders called Editor, and without the UNITY_EDITOR Symbol.

    I am on version 1.83 of photon, and can't update it right now.

    It appears that the error is thrown the first time PhotonServerSettings is tried to be accessed in the PhotonNetwork's class constructor.