void Start()
    {
        navAgent = GetComponent <NavMeshAgent>();
        detector = GetComponentInChildren <DetectionBehaviour>();

        Patrole();
    }
Beispiel #2
0
 private void OnEnable()
 {
     PhysicsSpaces = new List <BepuPhysicsUnity>(FindObjectsOfType <BepuPhysicsUnity>());
     Detection     = GetComponent <DetectionBehaviour>();
     if (PhysicsSpaces.Count > 0)
     {
         PhysicsSpaces[0].AddStaticShape(transform.position, transform.rotation, this, Detection, 0, OnShapeAdded);
         physicSpace = PhysicsSpaces[0];
     }
 }