临时提交

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-10-19 03:51:59 +08:00
parent 425f2eabea
commit 1315802fa2
162 changed files with 16452 additions and 11111 deletions

View File

@@ -76,52 +76,44 @@ namespace JNGame.Sync.Frame
int deltaTime = TickTime;
dtTotal += deltaTime;
dtInputTotal += deltaTime;
try
int nSyncTime = this.DyTime();
if (nSyncTime > 0)
{
int nSyncTime = this.DyTime();
if (nSyncTime > 0)
this._isLoop = false;
if (dtTotal > nSyncTime && _nFrameQueue.Count > 0)
{
this._isLoop = false;
if (dtTotal > nSyncTime && _nFrameQueue.Count > 0)
{
this.OnRunSimulate();
dtTotal -= nSyncTime;
}
if (_nFrameQueue.Count <= 0)
{
dtTotal = 0;
}
this.OnRunSimulate();
dtTotal -= nSyncTime;
}
else
if (_nFrameQueue.Count <= 0)
{
this._isLoop = true;
//追帧运行 保持前端 15 帧 刷新
long endTime = (new DateTimeOffset(DateTime.UtcNow)).ToUnixTimeMilliseconds() + 100;
while (this.DyTime() == 0 && ((new DateTimeOffset(DateTime.UtcNow)).ToUnixTimeMilliseconds()) < endTime)
{
this.OnRunSimulate();
}
dtTotal = 0;
}
//更新输入
if (dtInputTotal > (_nSyncTime / _nDivideFrame))
{
dtInputTotal = 0;
OnRunInput();
}
}
catch (Exception e)
else
{
Debug.LogError(e.Message);
this._isLoop = true;
//追帧运行 保持前端 15 帧 刷新
long endTime = (new DateTimeOffset(DateTime.UtcNow)).ToUnixTimeMilliseconds() + 100;
while (this.DyTime() == 0 && ((new DateTimeOffset(DateTime.UtcNow)).ToUnixTimeMilliseconds()) < endTime)
{
this.OnRunSimulate();
}
dtTotal = 0;
}
//更新输入
if (dtInputTotal > (_nSyncTime / _nDivideFrame))
{
dtInputTotal = 0;
OnRunInput();
}

View File

@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using JNGame.Sync.Entity;
using System.Collections.Generic;
using JNGame.Sync.Frame.Entity;
using JNGame.Sync.Frame.Entity.Components;
using UnityEngine;
namespace JNGame.Sync.State.Tile.Entity

View File

@@ -1,6 +1,5 @@
using JNGame.Sync.Entity;
using JNGame.Sync.Frame.Entity;
using JNGame.Sync.Frame.Entity.Components;
using JNGame.Sync.State.Tile.Entity.Component;
using JNGame.Sync.System.Data;
using NotImplementedException = System.NotImplementedException;