private bool createRemotePlayer(DataEntityHandle remotePlayerHandle, bool attemptSpawn = true) { if (!dataEntityCollection.HasComponent <GameObjectReferenceData>(remotePlayerHandle)) { dataEntityCollection.AddComponent <GameObjectReferenceData>(remotePlayerHandle); } if (!dataEntityCollection.HasComponent <AirBubbleData>(remotePlayerHandle)) { dataEntityCollection.AddComponent <AirBubbleData>(remotePlayerHandle); } PositionData component = dataEntityCollection.GetComponent <PositionData>(remotePlayerHandle); RemotePlayerData component2 = dataEntityCollection.GetComponent <RemotePlayerData>(remotePlayerHandle); component2.PlayerRemoved += onPlayerRemoved; playerRemovedListeners.Add(component2); PresenceData component3 = dataEntityCollection.GetComponent <PresenceData>(remotePlayerHandle); if (component3 != null) { component3.PresenceDataUpdated += onPresenceDataUpdated; } if (!dataEntityCollection.HasComponent <LODRequestReference>(remotePlayerHandle)) { LODRequestData requestData = new LODRequestData(LODSystem.REMOTE_PLAYER, remotePlayerHandle, component); requestData.OnGameObjectGeneratedEvent += onLODGameObjectGenerated; requestData.OnGameObjectRevokedEvent += onLODGameObjectRevoked; LODRequest request = Service.Get <LODService>().Request(requestData, attemptSpawn); dataEntityCollection.AddComponent <LODRequestReference>(remotePlayerHandle).Request = request; } return(false); }
public virtual void OnDestroy() { if (request != null) { request.RemoveWeightingRule(this); request = null; } }
public void UnpauseRequest(LODRequest request) { if (Manager == null) { throw new ArgumentException("Called RemoveRequest with a null entity", "manager"); } Manager.UnpauseRequest(request); }
public void UnpauseRequest(LODRequest request) { getRequestSystem(request.Data.Type).UnpauseRequest(request); }
public void RemoveRequest(LODRequest request) { getRequestSystem(request.Data.Type).RemoveRequest(request); }
public void Awake() { request = GetComponent <LODRequest>(); request.AddWeightingRule(this); }