Пример гоночки

This commit is contained in:
ThomasCharester committed 2026-01-28 16:30:32 +03:00
1 parent 0f46c63b5d
commit 1f8e14d078
77 files changed
+10246 -90

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 28672941a49242ad95c4a99705410c30
timeCreated: 1769522077
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: db04851257b24d4698e8101ef2d54b2d
timeCreated: 1769522144
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 391fdca5d5c94a86bcbd0f7cda609ee7
timeCreated: 1769522152
@@ -0,0 +1,25 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
namespace Code.Example.Race.Racer.AI
{
public class AIDebugRacer : MonoBehaviour
{
[SerializeField] private NavMeshAgent navMeshAgent;
[SerializeField] private List<Transform> waypoints;
private int _currentWaypointIndex;
private void Awake()
{
navMeshAgent.destination = waypoints[_currentWaypointIndex].position;
_currentWaypointIndex++;
}
public void NextWaypoint()
{
if(_currentWaypointIndex >= waypoints.Count) _currentWaypointIndex = 0;
navMeshAgent.destination = waypoints[_currentWaypointIndex++].position;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6644b39029d14164961d83a37749e6cc
timeCreated: 1769522190
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: dbcf0e0163844255817cec8c81839eb1
timeCreated: 1769522093
@@ -0,0 +1,14 @@
using Code.Example.Race.Racer.AI;
using UnityEngine;
namespace Code.Example.Race.Track
{
public class CheckPoint : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
var racer = other.GetComponent<AIDebugRacer>();
racer.NextWaypoint();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e4e29d6d9b0342db9cd6bce229fa358d
timeCreated: 1769522101