Ejemplo n.º 1
0
 //each cell contains a trigger collider which tells the agent that it's been entered
 //this is used to keep track of all visited cells
 void OnTriggerEnter(Collider col)
 {
     visitedCell      = col.gameObject.GetComponent <MazeCell>();
     visitedCellBound = visitedCell.GetComponent <Collider>();
     if (col == visitedCellBound && !huntAcademy.visitedCells.Contains(visitedCell))
     {
         if (huntAcademy.debug)
         {
             Debug.Log("New cell visited.");
         }
         huntAcademy.visitedCells.Add(visitedCell);
         currentCellvisited = true;
         AddReward(0.0005f * huntAcademy.visitedCells.Count);
     }
 }