increase navmesh PathfindingIterationsPerFrame to 1000

This commit is contained in:
in0finite 2022-03-14 08:40:32 +01:00
parent feb0b6e74a
commit bae1f0694e
2 changed files with 6 additions and 0 deletions

View file

@ -549,3 +549,4 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_maxTimePerFrameMs: 0
m_navMeshPathfindingIterationsPerFrame: 1000

View file

@ -6,6 +6,7 @@ using System.Diagnostics;
using System.Linq;
using System.Reflection;
using UnityEngine;
using UnityEngine.AI;
namespace SanAndreasUnity.Behaviours
{
@ -78,11 +79,15 @@ namespace SanAndreasUnity.Behaviours
private static readonly FieldInfo s_leftNodeField = s_nodeType.GetField("<Left>k__BackingField", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
private static readonly FieldInfo s_itemNodeField = s_nodeType.GetField("<Item>k__BackingField", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
[SerializeField] private int m_navMeshPathfindingIterationsPerFrame = 100;
protected override void OnSingletonStart()
{
this.BackgroundJobRunner.EnsureBackgroundThreadStarted();
NavMesh.pathfindingIterationsPerFrame = m_navMeshPathfindingIterationsPerFrame;
}
protected override void OnSingletonDisable()