mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
临时提交
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user