public void Wrap(TileCoord centerTile, TileCoord offset, TileWrappingMapper mapper) { Tile.X = mapper.GetNewX(OriginalTile.X); Tile.Y = mapper.GetNewY(OriginalTile.Y); tmpV3 = transform.position; if (Tile.X != LastTile.X) { tmpV3.x -= (WrappingWorld.Current.TileSizeX * (LastTile.X - Tile.X)); } if (Tile.Y != LastTile.Y) { tmpV3.y -= (WrappingWorld.Current.TileSizeY * (LastTile.Y - Tile.Y)); } LastTile.X = Tile.X; LastTile.Y = Tile.Y; transform.position = tmpV3; }
public void GetOriginalTile(TileWrappingMapper mapper) { LastTile.X = OriginalTile.X = mapper.GetOldX((int)Mathf.Floor(transform.position.x / WrappingWorld.Current.TileSizeX)); LastTile.Y = OriginalTile.Y = mapper.GetOldY((int)Mathf.Floor(transform.position.y / WrappingWorld.Current.TileSizeY)); }
public override void OverwriteObjectDefinition(WorldGenerator.WorldObjectDefinition obj, TileWrappingMapper mapper) { base.OverwriteObjectDefinition(obj, mapper); obj.Type = ObjectType.FuelPickup; }
public virtual void OverwriteObjectDefinition(WorldGenerator.WorldObjectDefinition obj, TileWrappingMapper mapper) { obj.Position.x = transform.position.x + (WrappingWorld.Current.TileSizeX * (OriginalTile.X - mapper.GetNewX(OriginalTile.X))); obj.Position.y = transform.position.y + (WrappingWorld.Current.TileSizeY * (OriginalTile.Y - mapper.GetNewY(OriginalTile.Y))); }
public override void OverwriteObjectDefinition(WorldGenerator.WorldObjectDefinition obj, TileWrappingMapper mapper) { base.OverwriteObjectDefinition(obj, mapper); obj.Type = ObjectType.FuelTree; obj.RemainingIntValue = Fuels; }