Game Without PhotonView

Options
In my game, I only need to communicate commands between players so I think using Photon View for RPC's would be inefficient. Is there a way to send an RPC without a photon view?

Comments

  • Tobias
    Options
    There is no way to use RPCs without any PhotonView. But: You can use a single PhotonView in a scene and keep that.

    Or even better: You make yourself at home with PhotonNetwork.RaiseEvent() and implement a EventCallback delegate method to set as PhotonNetwork.OnEventCall. This way, you skip anything view related and can make up event codes and event content as you see fit. You can send Hashtables (to have key-values) or object[] or other data types as content.

    RaiseEvent is the leanest way.
  • SnpM
    Options
    Thanks! I'll do that then. Is this similar to the method in the 'Adding Operations' tutorial where you call custom operations with PhotonNetwork.NetworkPeer.OpCustom()? Which one is more efficient?
  • vadim
    Options
    You need events, not custom operations. Use RaiseEvent().

    OpCustom() is for custom operations supported by on-premise server.