Properly apply ShowHexTiles for instanced tiles.

WorldChunkRefactoring
Martin Felis 2023-08-29 12:21:35 +02:00
parent 39f20c8e01
commit 7627aa3699
1 changed files with 8 additions and 1 deletions

View File

@ -254,7 +254,14 @@ public class StreamContainer : Spatial
{
int instanceIndex = _tileToInstanceIndex[tile3D];
Transform instanceTransform = new Transform(tile3D.GlobalTransform.basis.Rotated(Vector3.Up, Mathf.Deg2Rad(30)), tile3D.GlobalTransform.origin + Vector3.Up * -2.5f);
Vector3 scale = Vector3.One;
if (ShowHexTiles)
{
scale.x *= 0.96f;
scale.z *= 0.96f;
}
Transform instanceTransform = new Transform(tile3D.GlobalTransform.basis.Rotated(Vector3.Up, Mathf.Deg2Rad(30)).Scaled(scale), tile3D.GlobalTransform.origin + Vector3.Up * -2.5f);
_tileMultiMesh.Multimesh.SetInstanceTransform(instanceIndex, instanceTransform);
}