From 3da0a75562c7d50a494cf689901759839abce482 Mon Sep 17 00:00:00 2001 From: in0finite Date: Sat, 16 Apr 2022 23:00:41 +0200 Subject: [PATCH] use double for time measuring --- Assets/Scripts/Utilities/MovementAgent.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/Utilities/MovementAgent.cs b/Assets/Scripts/Utilities/MovementAgent.cs index a97c7c04..c99ce8e1 100644 --- a/Assets/Scripts/Utilities/MovementAgent.cs +++ b/Assets/Scripts/Utilities/MovementAgent.cs @@ -8,14 +8,14 @@ namespace SanAndreasUnity.Utilities { public NavMeshAgent NavMeshAgent { get; private set; } - private float m_lastTimeWhenSearchedForPath = 0f; + private double m_lastTimeWhenSearchedForPath = 0f; public Vector3? Destination { get; set; } = null; private Vector3? m_lastAssignedDestination = null; private Vector3? m_lastPositionWhenAssignedDestination = null; - private float m_lastTimeWhenWarped = 0f; - private float m_timeWhenSampledOffNavMesh = 0f; + private double m_lastTimeWhenWarped = 0f; + private double m_timeWhenSampledOffNavMesh = 0f; public float warpSampleDistance = 4.5f; @@ -94,7 +94,7 @@ namespace SanAndreasUnity.Utilities return; } - float currentTime = Time.time; + double currentTime = Time.timeAsDouble; Vector3 myPosition = agent.transform.position; agent.nextPosition = myPosition; @@ -275,7 +275,7 @@ namespace SanAndreasUnity.Utilities { NavMeshAgent navMeshAgent = this.NavMeshAgent; - m_lastTimeWhenSearchedForPath = Time.time; + m_lastTimeWhenSearchedForPath = Time.timeAsDouble; m_lastAssignedDestination = this.Destination.Value; m_lastPositionWhenAssignedDestination = navMeshAgent.transform.position;