コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: Terrain.cs プロジェクト: Harbringer12/hello-world
        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);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }