示例#1
0
 public void SafeAdd(Type type, JObject jObject)
 {
     // we have a local lock here
     lock (_lock)
     {
         if (!_networkedComponentsInGameObject.ContainsKey(type))
         {
             var newComponent = gameObject.AddComponent(type);
             _networkedComponentsInGameObject.Add(type, new UpdateEvent());
             ComponentUpdater.UpdateObjectOfType((NetworkedComponent)newComponent, jObject);
         }
         else
         {
             _networkedComponentsInGameObject[type].AddNewestMessage(jObject);
         }
     }
 }
示例#2
0
 public void Update(NetworkedComponent component)
 {
     HasBeenUpdatedSinceLastGet = false;
     ComponentUpdater.UpdateObjectOfType(component, _mostRecentMessage);
 }