private IEnumerator WaitAndAddCell(Int3 batchId, Int3 cellId, int level) { yield return(new WaitForSeconds(0.5f)); AbsoluteEntityCell cell = new AbsoluteEntityCell(batchId.Model(), cellId.Model(), level); if (!visibleCells.Contains(cell)) { visibleCells.Add(cell); added.Add(cell); } }
private IEnumerator WaitAndAddCell(Int3 batchId, Int3 cellId, int level) { yield return(new WaitForSeconds(0.5f)); VisibleCell cell = new VisibleCell(batchId, cellId, level); if (!visibleCells.Contains(cell)) { visibleCells.Add(cell); added.Add(cell); packetReceiver.CellLoaded(cell); } }
private bool PacketWasDeferred(Packet packet) { if (packet is DeferrablePacket) { DeferrablePacket deferrablePacket = (DeferrablePacket)packet; if (visibleCells.Contains(deferrablePacket.AbsoluteEntityCell)) { return(false); } Log.Debug($"Packet {packet} was deferred, cell not loaded (with required lod): {deferrablePacket.AbsoluteEntityCell}"); AddPacketToDeferredMap(deferrablePacket, deferrablePacket.AbsoluteEntityCell); return(true); } return(false); }
private bool PacketWasDeferred(Packet packet) { Optional <AbsoluteEntityCell> deferLocation = packet.GetDeferredCell(); if (deferLocation.IsPresent()) { AbsoluteEntityCell mustBeLoadedCell = deferLocation.Get(); if (visibleCells.Contains(mustBeLoadedCell)) { return(false); } Log.Debug($"Packet {packet} was deferred, cell not loaded (with required lod): {mustBeLoadedCell}"); AddPacketToDeferredMap(packet, mustBeLoadedCell); return(true); } return(false); }