JetBrains / resharper-unity

Unity support for both ReSharper and Rider
Apache License 2.0
1.21k stars 134 forks source link

Feature: Add references to RPC methods #108

Open breineng opened 7 years ago

breineng commented 7 years ago

Now Invoke, InvokeRepeating, StartCoroutine shows a link to the method, I would like to add the same functionality to the RPC functions photon (Photon Unity Cloud).

citizenmatt commented 7 years ago

Interesting. This looks like a third party component. Do you have any links to the docs of the methods you're interested in? I'm not too keen on supporting a third party component with custom code, but it might be something that's easy to extend with some kind of external annotations (e.g. if it's a string literal in a known method that references a method in the same class, this can be generalised)

breineng commented 7 years ago

Unity have built-in network with rpc's https://docs.unity3d.com/Manual/net-RPCDetails.html

citizenmatt commented 7 years ago

Are those different to the Photon Unity Cloud you mentioned above? They're also marked as legacy, are they still in use?

breineng commented 7 years ago

Yes, this is an outdated functionality, but it still works. If you do support, it should work automatically for plugin photon. And here and there the use method of RPC. For Photon:

PhotonPlayer.RPC("RPCMethodName");
[PunRPC]
void RPCMethodName()
{
//any code
}

For Unity built-in network

NetworkPlayer.RPC("RPCMethodName");
[RPC]
void RPCMethodName()
{
//any code
}