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); } }
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!"); }