提取RVO 寻路

This commit is contained in:
PC-20230316NUNE\Administrator
2024-02-05 18:56:55 +08:00
parent 04043cc6fc
commit 16d943ab6b
208 changed files with 42246 additions and 37182 deletions

View File

@@ -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;
}

View File

@@ -1,5 +1,6 @@
using UnityEngine;
using System.Collections.Generic;
using Plugins.JNGame.Sync.Frame.Entity;
namespace Pathfinding {
/// <summary>
@@ -598,7 +599,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;
}

View File

@@ -1,3 +1,4 @@
using Plugins.JNGame.Sync.Frame.Entity;
using UnityEngine;
namespace Pathfinding {
@@ -260,7 +261,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;
}

View File

@@ -1,3 +1,4 @@
using Plugins.JNGame.Sync.Frame.Entity;
using UnityEngine;
namespace Pathfinding {
@@ -102,7 +103,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;
}