rename class

This commit is contained in:
in0finite 2021-09-07 00:05:06 +02:00
parent 3081db59ad
commit 1db899ebba
2 changed files with 5 additions and 5 deletions

View file

@ -103,7 +103,7 @@ namespace SanAndreasUnity.Behaviours
Ped newPed = Ped.SpawnPed(Ped.RandomPedId, spawnPos + new Vector3(0, 1, 0), Quaternion.identity, true);
var ai = newPed.gameObject.GetOrAddComponent<Ped_AI>();
var ai = newPed.gameObject.GetOrAddComponent<PedAI>();
ai.CurrentNode = pedNode;
ai.TargetNode = pedNode;
@ -111,7 +111,7 @@ namespace SanAndreasUnity.Behaviours
yield return null;
}
if (Ped_AI.AllPedAIs.Count(p => Math.Abs(Vector3.Distance(p.transform.position, targetZone)) < MaxNPCDistance) > MaxNumberOfNPCAtSpawnPoint)
if (PedAI.AllPedAIs.Count(p => Math.Abs(Vector3.Distance(p.transform.position, targetZone)) < MaxNPCDistance) > MaxNumberOfNPCAtSpawnPoint)
break;
}
}

View file

@ -13,10 +13,10 @@ namespace SanAndreasUnity.Behaviours
Chasing,
Escaping
}
public class Ped_AI : MonoBehaviour
public class PedAI : MonoBehaviour
{
private static readonly List<Ped_AI> s_allPedAIs = new List<Ped_AI>();
public static IReadOnlyList<Ped_AI> AllPedAIs => s_allPedAIs;
private static readonly List<PedAI> s_allPedAIs = new List<PedAI>();
public static IReadOnlyList<PedAI> AllPedAIs => s_allPedAIs;
[SerializeField] private Vector3 currentNodePos;
[SerializeField] private Vector3 targetNodePos;