public void BuildCorridorNavMesh(NavMesh navMesh)
 {
     if (direction == Direction.North || direction == Direction.South)
     {
         navMeshComponent = new NavMeshComponent(new Vector2(xPos + 1, yPos + corridorLength), new Vector2(xPos + 3, yPos + corridorLength),
                                                 new Vector2(xPos + 1, yPos - 1), new Vector2(xPos + 3, yPos - 1));
         navMesh.AddNavMeshComponent(navMeshComponent);
     }
     else
     {
         navMeshComponent = new NavMeshComponent(new Vector2(xPos - 1, yPos + 3), new Vector2(xPos + corridorLength, yPos + 3),
                                                 new Vector2(xPos - 1, yPos + 1), new Vector2(xPos + corridorLength, yPos + 1));
         navMesh.AddNavMeshComponent(navMeshComponent);
     }
 }
示例#2
0
 public void BuildRoomNavMesh(NavMesh navMesh)
 {
     navMeshComponent = new NavMeshComponent(new Vector2(xPos + 1, yPos + roomHeight - 2), new Vector2(xPos + roomWidth - 2, yPos + roomHeight - 2),
                                             new Vector2(xPos + 1, yPos + 1), new Vector2(xPos + roomWidth - 2, yPos + 1));
     navMesh.AddNavMeshComponent(navMeshComponent);
 }