Exemple #1
0
 private RoomsTypes GetRoomType(DoorOpenings firstDir, DoorOpenings secondDir)
 {
     if ((firstDir == DoorOpenings.Bottom && secondDir == DoorOpenings.Top) || (firstDir == DoorOpenings.Top && secondDir == DoorOpenings.Bottom))
     {
         return(RoomsTypes.TB);
     }
     else if ((firstDir == DoorOpenings.Left && secondDir == DoorOpenings.Right) || (firstDir == DoorOpenings.Right && secondDir == DoorOpenings.Left))
     {
         return(RoomsTypes.LR);
     }
     else if ((firstDir == DoorOpenings.Bottom && secondDir == DoorOpenings.Left) || (firstDir == DoorOpenings.Left && secondDir == DoorOpenings.Bottom))
     {
         return(RoomsTypes.BL);
     }
     else if ((firstDir == DoorOpenings.Bottom && secondDir == DoorOpenings.Right) || (firstDir == DoorOpenings.Right && secondDir == DoorOpenings.Bottom))
     {
         return(RoomsTypes.BR);
     }
     else if ((firstDir == DoorOpenings.Left && secondDir == DoorOpenings.Top) || (firstDir == DoorOpenings.Top && secondDir == DoorOpenings.Left))
     {
         return(RoomsTypes.TL);
     }
     else if ((firstDir == DoorOpenings.Right && secondDir == DoorOpenings.Top) || (firstDir == DoorOpenings.Top && secondDir == DoorOpenings.Right))
     {
         return(RoomsTypes.TR);
     }
     Debug.LogError("Get Room Type error for firstDir " + firstDir + " secondDir " + secondDir);
     return(RoomsTypes.L);
 }
Exemple #2
0
    public GameObject GetRoomTemplate(DoorOpenings firstDir, DoorOpenings secondDir)
    {
        RoomsTypes neededType = GetRoomType(firstDir, secondDir);

        GetRoomTemplate(neededType);
        Debug.LogError("Get Room Prefab error for firstDir " + firstDir + " secondDir " + secondDir);
        return(null);
    }