Photon in JavaScript?


I am working with Photon in JavaScript and I need it to make some GUI stuff. But I just get this error “Unknown identifier: PhotonNetwork”. It works in C# but not in JavaScript.

The thing I need to get working:


My code:

GUI.Box(new Rect(20, 20, 300, 40), "Server Status: " + PhotonNetwork.connectionStateDetailed.ToString() );

I can’t vouch for this as I haven’t tried it, but Alucard Jay posted a video about how to make sure Photon is setup for use with js.

I use C# with photon so beyond that I can’t help much, good luck! If you can use C# it may be easier since Photon is made in C#. Don’t have to worry about conversions that way, and C# is pretty easy to pick up if you’ve done some javascript work. Especially since Unity’s scripting reference lets you swap between them and is well documented.