Visual Studio Analyser for Photon RPCs

Since misspelled method names or wrong arguments submitted to the PhotonView.RPC method are a likely source of errors, I decided to create an analyser for Visual Studio which displays errors for those cases immediately. It checks the following:

- Does the method with the specified name exist in the same class?
- Is this method decorated with the PunRPC attribute?
- Is the number of arguments correct?
- If so, do the types of the arguments match the ones of the actual method
- Are the types of the arguments even serializable for Photon?

There are currently some limitations, however:

- Only default types are supported (see https://doc.photonengine.com/en/realtime/current/reference/serialization-in-photon)
- Only methods of the MonoBehaviour the RPC method is called in are recognized (if you want to call an RPC method of another component, you can create a method within that calls the RPC method however)

I hope it helps some of you :smile:
Download link (.vsix extension): mediafire.com/download/wq2n5l86ex7ddoc/RPCAnalyser.Vsix.vsix

Comments