示例#1
0
 private IEnumerator SyncChestPickup(NetworkInstanceId chestId, string pickupName, float delay)
 {
     while (!NetworkUser.AllParticipatingNetworkUsersReady())
     {
         yield return(new WaitForSeconds(delay));
     }
     NetworkChestSync.instance.RpcAddPickup(chestId, pickupName);
 }
 private void SyncTargets()
 {
     if (GradiusOption.instance.includeModelInsideOrb && NetworkServer.active && NetworkUser.AllParticipatingNetworkUsersReady() && targetIds.Count > 0)
     {
         Tuple <GameObjectType, NetworkInstanceId, short, NetworkInstanceId>[] listCopy = new Tuple <GameObjectType, NetworkInstanceId, short, NetworkInstanceId> [targetIds.Count];
         targetIds.CopyTo(listCopy);
         targetIds.Clear();
         for (int i = 0; i < listCopy.Length; i++)
         {
             GameObjectType    gameObjectType = listCopy[i].Item1;
             NetworkInstanceId netId          = listCopy[i].Item2;
             short             numbering      = listCopy[i].Item3;
             NetworkInstanceId targetId       = listCopy[i].Item4;
             new SyncOptionTarget(gameObjectType, netId, numbering, targetId).Send(NetworkDestination.Clients);
         }
     }
 }