Skip to content

How can I use Photon or any other C# library? #31

Answered by exodrifter
andr0s asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you should be able to do that. You can see an example of something similar happening in the PythonUnityHelloWorld.cs example.

However, in order for this to work, you need to load the assemblies when you create the engine. You can see an example of that in UnityPython, which is used in the example. I've included the relevant snippet below:

// Load assemblies for the `UnityEngine*` namespaces
foreach (var assembly in GetAssembliesInNamespace("UnityEngine"))
{
	engine.Runtime.LoadAssembly(assembly);
}

If you add the assembly containing PhotonNetwork to the runtime, you should be able to find the type in Python. Let me know if this isn't the case.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by exodrifter
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #31 on December 21, 2020 15:26.