Ejemplo n.º 1
0
 public void RegisterFromRemote(GameObject gameObject, int id)
 {
     if (!NetworkedGameObjects.Contains(gameObject))
     {
         NetworkedGameObjects.Add(id, gameObject);
     }
 }
Ejemplo n.º 2
0
 public void Register(GameObject gameObject)
 {
     if (!NetworkedGameObjects.Contains(gameObject))
     {
         NetworkView networkView = gameObject.AddComponent <NetworkView>();
         int         newID       = random.Next(0, int.MaxValue);
         while (NetworkedGameObjects.Contains(newID))
         {
             newID = random.Next(0, int.MaxValue);
         }
         networkView.networkID = newID;
         NetworkedGameObjects.Add(newID, gameObject);
     }
 }