Ideefixze / DTerrain

Destructible terrain in Unity
MIT License
417 stars 55 forks source link

Fix offset of chunks #2

Closed Elektordi closed 3 years ago

Elektordi commented 3 years ago

When creating chunks, sprites are currently centered on their transform position, creating strange offsets between layers (if chunks count are different). This change align all sprites with their bottom-left point, so all layers are aligned without having to set custom position. And it also simplifies some formulas, by the way!

Maybe the Offset and PositionToOffset fields on PaintableLayer are not needed anymore, but I did not touch them...