Beispiel #1
0
 private void CollisionEnterOrStay(Collision other)
 {
     if (other.gameObject.CompareTag("wall"))
     {
         if (Agent != null)
         {
             // Debug.Log("Cargo hit wall");
             Agent.EndingEp(-1f);
         }
     }
     if (other.gameObject.CompareTag("cargo0"))
     {
         if (Agent != null)             // && other.gameObject != transform.gameObject
         {
             // Debug.Log("Cargo hit cargo");
             Agent.EndingEp(-1f);
         }
     }
 }
Beispiel #2
0
 void Update()
 {
     if (freeToLoad)
     {
         foreach (GameObject CargoArea in CargoAreas)
         {
             CargoSpawnController cargoSpawnController = CargoArea.GetComponent <CargoSpawnController>();
             if (spawnedCargoes.Count < simultaneousCargo)
             {
                 cargoSpawnController.spawnCargo(nextId);
                 nextId++;
             }
         }
     }
     if (AllGoalAreasFilled())
     {
         agent.finishCount++;
         // Debug.Log("EndEpisode - AllCargoAreasFilled");
         agent.EndingEp(10f);
     }
 }