예제 #1
0
 private MeshCombineUtility.HiddenFaces CalculateHiddenFaces(MapDataStore.Tile tile, RotationType rotation)
 {
     MeshCombineUtility.HiddenFaces hiddenFaces = MeshCombineUtility.HiddenFaces.None;
     if (rotation == RotationType.None)
     {
         if (tile.North != null && (tile.North.isWall || tile.North.Hidden))
         {
             hiddenFaces |= MeshCombineUtility.HiddenFaces.North;
         }
         if (tile.South != null && (tile.South.isWall || tile.South.Hidden))
         {
             hiddenFaces |= MeshCombineUtility.HiddenFaces.South;
         }
         if (tile.East != null && (tile.East.isWall || tile.East.Hidden))
         {
             hiddenFaces |= MeshCombineUtility.HiddenFaces.East;
         }
         if (tile.West != null && (tile.West.isWall || tile.West.Hidden))
         {
             hiddenFaces |= MeshCombineUtility.HiddenFaces.West;
         }
     }
     if (rotation != RotationType.TreeRound && rotation != RotationType.TreeRoundTall)//these two rotations don't give a flat rotation.
     {
         if (tile.Up != null && (tile.Up.isSolidBase || tile.Up.Hidden))
         {
             hiddenFaces |= MeshCombineUtility.HiddenFaces.Up;
         }
         if (tile.Down != null && (tile.Down.isWall || tile.Down.Hidden))
         {
             hiddenFaces |= MeshCombineUtility.HiddenFaces.Down;
         }
     }
     return(hiddenFaces);
 }
예제 #2
0
 private MeshCombineUtility.HiddenFaces CalculateHiddenFaces(MapDataStore.Tile tile)
 {
     MeshCombineUtility.HiddenFaces hiddenFaces = MeshCombineUtility.HiddenFaces.None;
     if (tile.North != null && (tile.North.isWall || tile.North.hidden))
     {
         hiddenFaces |= MeshCombineUtility.HiddenFaces.North;
     }
     if (tile.South != null && (tile.South.isWall || tile.South.hidden))
     {
         hiddenFaces |= MeshCombineUtility.HiddenFaces.South;
     }
     if (tile.East != null && (tile.East.isWall || tile.East.hidden))
     {
         hiddenFaces |= MeshCombineUtility.HiddenFaces.East;
     }
     if (tile.West != null && (tile.West.isWall || tile.West.hidden))
     {
         hiddenFaces |= MeshCombineUtility.HiddenFaces.West;
     }
     if (tile.Up != null && (tile.Up.isSolidBase || tile.Up.hidden))
     {
         hiddenFaces |= MeshCombineUtility.HiddenFaces.Up;
     }
     if (tile.Down != null && (tile.Down.isWall || tile.Down.hidden))
     {
         hiddenFaces |= MeshCombineUtility.HiddenFaces.Down;
     }
     return(hiddenFaces);
 }