Particle Photon + Unity

We’re making a mobile game that will read input from the Photon. We’re planning on using Unity as the game engine, although we are flexible about that part.

What I’m worried about is the device setup library. Is it possible to setup the network for the device from a mobile game in Unity?

It would be awesome to have it and I bet it would open a world of possibilities for game devs.

Hello,

We have a lot of unity3d experience and a bit of particle dev experience.

You would have to wrap the device setup library as a Unity plugin. for both IOS and Android versions (once available).

Leveraging the built-in UIs from the libs will involve a bit more work because you’ll have to exit from the Unity UI context such that the plugin is in charge until dismissed.

Cheers

1 Like

I’m assuming you would need to use the documentation from either the Android or iOS Setup Libraries.
https://docs.particle.io/reference/android/#android-device-setup-library
https://docs.particle.io/reference/ios/#ios-device-setup-library

I personally couldn’t tell you more than that but would love to see some documentation if you figure it out. Any more you can tell us about your game? Sounds like an interesting project.

@javo Are you writing your game in C# with Unity? I might be able to help out some if you are still working on this.

I know Unity3D (in its paid license) has support for native code plug-in extensions - so that can be your solution.
Let me know if specific help is required. I once developed a native code plugin bridge to a different game engine (Corona).

Hi–

Hope it’s ok to revive this old topic. I am interested in making a custom controller for unity using a particle photon. I have successfully implemented bidirectional communication between unity and the photon with unity’s native unitywebrequest methods. I can call a function on the photon using POST and can get a variable via GET. The main problem is speed when getting info from the photon. I would prefer to subscribe to the photon’s events rather than poll it for changes. I can only get variable values at about twice a second, and that seems like an unstable rate. I am aware of the windows sdk. This is outside my expertise, but I did try building the sdk with mono (I’m working on a Mac) it appears to be built, and I can reference the particle.sdk namespace, but I’m getting errors I don’t know how to handle. I don’t think I’m doing this correctly or that what I’m trying to do is even possible. So here’s my question: is it possible to subscribe to photon events, or even better, can the particle sdk be a plugin for unity (OS X and windows or only windows?) again, I’m a little out of my element here. Any advice would be greatly appreciated.

Will your controller ever be connected to a different network than your “client”?
Do you need a secure/encrypted transport?

If you can answer both questions with no, you might better go for UDP or TCPClient/TCPServer than via the Particle cloud when speed is an issue.
You can subscribe to Particle events, but the Photon will be limited to one even per second, which isn’t brilliant for gaming either.

As an alternative you could run a local cloud server which cuts the latency and if you tweak the cloud code and the system firmware on the Photon you can even lift the 1/sec rate limit.

1 Like