예제 #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);
 }
예제 #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);
 }
예제 #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);
 }