예제 #1
0
 public static void Update(this TileStruct tile, Type item)
 {
     if (item.BaseType == typeof(BaseEnvironment))
     {
         tile.UpdateEnvironment(item);
     }
     else if (item.BaseType == typeof(BaseFloor))
     {
         tile.UpdateFloor(item);
     }
     else
     {
         tile.UpdateObject(item);
     }
 }
예제 #2
0
 private void RemoveObjectFromTile(TileStruct tile)
 {
     if (tile.gameObject.GetType() != Blocks.EMPTY)
     {
         tile.Update(Blocks.EMPTY);
     }
     else if (tile.environmentObject.GetType() != Blocks.EMPTY)
     {
         tile.UpdateEnvironment(Blocks.EMPTY);
     }
     else if (tile.gameObject.GetType() != Floors.EMPTY_FLOOR)
     {
         tile.Update(Floors.EMPTY_FLOOR);
     }
 }