示例#1
0
    public static void doSyncTick()
    {
        try {
            Scheduler.onAsycTick();
            Scheduler.onSyncTick();
            deltaTime  += Time.deltaTime;
            deltaTime2 += Time.deltaTime;
            ChunkMeshCreator.onImmediateDisplayChunksTick();
            if (GameManager.deltaTime >= 0.1f)
            {
                ChunkMeshCreator.onDisplayChunkTick();
                PlayerTrackingHandler.onUnloadFarChunks();
                BlockLogicHandler.onTick();
                GameManager.deltaTime = 0;


                foreach (Entity e in GameManager.getEntitiesByType(ReuseableGameObject.ITEM_ENTITY).ToArray())
                {
                    if (e.isRemoved() == false && e.isInitiated())
                    {
                        e.onTick();
                    }
                }
            }
            if (deltaTime >= 1 && Chunk.changed > 3)
            {
                //StaticBatchingUtility.Combine(Chunk.childList.ToArray(), GameManager.getGameManager().mapHolder);
                //Chunk.changed = 0;
                deltaTime = 0;
            }
        } catch (Exception e) {
            Debug.LogException(e);
        }
    }
示例#2
0
    public static void doAsycTick()
    {
        while (isPlaying)
        {
            //0.5s timer;
            //if (GameManager.deltaTime >= 0.5f) {
            ChunkMeshCreator.onImmediateConstractMeshTick();
            PlayerTrackingHandler.onGenerateNearbyChunks();
            ChunkMeshCreator.onConstractMeshTick();
            //    GameManager.deltaTime = 0;
            //}

            Thread.Sleep(200);
        }

        Debug.Log("Asyc Thread ended!");
    }