Beispiel #1
0
 public static void RpcMaster <E>(this MonoBehaviourPun mb, Action <E> func, E e)
 {
     if (PunUtils.offlineOrNoRoom)
     {
         func.Invoke(e);
         return;
     }
     mb.photonView.RPC(func.Method.Name, RpcTarget.MasterClient, e);
     PunRpcProfiler.AddRpcSent(func.Method.Name);
 }
Beispiel #2
0
 public static void Rpc(this MonoBehaviourPun mb, Player player, Action func)
 {
     if (PunUtils.offlineOrNoRoom)
     {
         if (Equals(player, PhotonNetwork.LocalPlayer))
         {
             func.Invoke();
         }
         return;
     }
     mb.photonView.RPC(func.Method.Name, player);
     PunRpcProfiler.AddRpcSent(func.Method.Name);
 }
Beispiel #3
0
 public static void RpcSecure(this MonoBehaviourPun mb, RpcTarget target, Action func)
 {
     if (PunUtils.offlineOrNoRoom)
     {
         if (target == RpcTarget.All)
         {
             func.Invoke();
         }
         return;
     }
     mb.photonView.RpcSecure(func.Method.Name, target, true);
     PunRpcProfiler.AddRpcSent(func.Method.Name);
 }