mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 14:44:17 +00:00
rename class
This commit is contained in:
parent
3081db59ad
commit
1db899ebba
2 changed files with 5 additions and 5 deletions
|
@ -103,7 +103,7 @@ namespace SanAndreasUnity.Behaviours
|
||||||
|
|
||||||
Ped newPed = Ped.SpawnPed(Ped.RandomPedId, spawnPos + new Vector3(0, 1, 0), Quaternion.identity, true);
|
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.CurrentNode = pedNode;
|
||||||
ai.TargetNode = pedNode;
|
ai.TargetNode = pedNode;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ namespace SanAndreasUnity.Behaviours
|
||||||
yield return null;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ namespace SanAndreasUnity.Behaviours
|
||||||
Chasing,
|
Chasing,
|
||||||
Escaping
|
Escaping
|
||||||
}
|
}
|
||||||
public class Ped_AI : MonoBehaviour
|
public class PedAI : MonoBehaviour
|
||||||
{
|
{
|
||||||
private static readonly List<Ped_AI> s_allPedAIs = new List<Ped_AI>();
|
private static readonly List<PedAI> s_allPedAIs = new List<PedAI>();
|
||||||
public static IReadOnlyList<Ped_AI> AllPedAIs => s_allPedAIs;
|
public static IReadOnlyList<PedAI> AllPedAIs => s_allPedAIs;
|
||||||
|
|
||||||
[SerializeField] private Vector3 currentNodePos;
|
[SerializeField] private Vector3 currentNodePos;
|
||||||
[SerializeField] private Vector3 targetNodePos;
|
[SerializeField] private Vector3 targetNodePos;
|
||||||
|
|
Loading…
Reference in a new issue