Exemple #1
0
    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);
    }
Exemple #2
0
 public virtual void OnDestroy()
 {
     if (request != null)
     {
         request.RemoveWeightingRule(this);
         request = null;
     }
 }
Exemple #3
0
 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);
 }
Exemple #6
0
 public void Awake()
 {
     request = GetComponent <LODRequest>();
     request.AddWeightingRule(this);
 }