mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提取RVO 寻路
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Plugins.JNGame.Sync.Frame.Entity;
|
||||
|
||||
namespace Pathfinding {
|
||||
/// <summary>
|
||||
@@ -613,7 +614,7 @@ namespace Pathfinding {
|
||||
/// <summary>
|
||||
/// Calculates the path until completed or until the time has passed targetTick.
|
||||
/// Usually a check is only done every 500 nodes if the time has passed targetTick.
|
||||
/// Time/Ticks are got from System.DateTime.UtcNow.Ticks.
|
||||
/// Time/Ticks are got from JNTime.Time.Ticks.
|
||||
///
|
||||
/// Basic outline of what the function does for the standard path (Pathfinding.ABPath).
|
||||
/// <code>
|
||||
@@ -670,7 +671,7 @@ namespace Pathfinding {
|
||||
// Check for time every 500 nodes, roughly every 0.5 ms usually
|
||||
if (counter > 500) {
|
||||
// Have we exceded the maxFrameTime, if so we should wait one frame before continuing the search since we don't want the game to lag
|
||||
if (System.DateTime.UtcNow.Ticks >= targetTick) {
|
||||
if (JNTime.Time.Ticks >= targetTick) {
|
||||
// Return instead of yield'ing, a separate function handles the yield (CalculatePaths)
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user