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); } } }
public void Update(NetworkedComponent component) { HasBeenUpdatedSinceLastGet = false; ComponentUpdater.UpdateObjectOfType(component, _mostRecentMessage); }