Added tree grwoth camera animation, fixed combat camera state, fixed many errors in the console

This commit is contained in:
2024-12-28 10:28:50 +01:00
parent e75b093317
commit f59a127a4e
10 changed files with 872 additions and 831 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
@@ -262,15 +263,21 @@ namespace Invector.vCharacterController.AI
protected override void OnAnimatorMove()
{
if (Time.deltaTime == 0) return;
if (!customAction && useNavMeshAgent && navMeshAgent && navMeshAgent.enabled)
{
navMeshAgent.velocity = ((animator.deltaPosition) / Time.deltaTime) * Mathf.Clamp(remainingDistanceWithoutAgent - stopingDistance, 0, 1f);
//navMeshAgent.speed = Mathf.Clamp((float)System.Math.Round((double)(animator.deltaPosition / Time.deltaTime).magnitude , 2), 0.5f, maxSpeed);
navMeshAgent.speed = Mathf.Lerp(navMeshAgent.speed, maxSpeed, aceleration * Time.deltaTime);
navMeshAgent.nextPosition = animator.rootPosition;
try {
if (Time.deltaTime == 0 || animator == null) return;
if (!customAction && useNavMeshAgent && navMeshAgent && navMeshAgent.enabled)
{
navMeshAgent.velocity = ((animator.deltaPosition) / Time.deltaTime) * Mathf.Clamp(remainingDistanceWithoutAgent - stopingDistance, 0, 1f);
//navMeshAgent.speed = Mathf.Clamp((float)System.Math.Round((double)(animator.deltaPosition / Time.deltaTime).magnitude , 2), 0.5f, maxSpeed);
navMeshAgent.speed = Mathf.Lerp(navMeshAgent.speed, maxSpeed, aceleration * Time.deltaTime);
navMeshAgent.nextPosition = animator.rootPosition;
}
}
catch (Exception e)
{
Debug.LogException(e, this);
}
base.OnAnimatorMove();
}
@@ -317,7 +324,7 @@ namespace Invector.vCharacterController.AI
_currentWaypoint = GetNearPointIndex();
else if (_randomWaypoint)
_currentWaypoint = Random.Range(0, waypoints.Count);
_currentWaypoint = UnityEngine.Random.Range(0, waypoints.Count);
else _currentWaypoint = 0;
}
@@ -325,7 +332,7 @@ namespace Invector.vCharacterController.AI
if (isWaypointStarted)
{
if (_randomWaypoint)
_currentWaypoint = Random.Range(0, waypoints.Count);
_currentWaypoint = UnityEngine.Random.Range(0, waypoints.Count);
else
_currentWaypoint++;
@@ -1066,7 +1073,7 @@ namespace Invector.vCharacterController.AI
{
var waypoints = value.GetValidPoints();
if (_randomStartingPoint)
_currentWaypoint = Random.Range(0, waypoints.Count);
_currentWaypoint = UnityEngine.Random.Range(0, waypoints.Count);
}
_waypointArea = value;
}