Tile Highlight cleanup.

WorldChunkRefactoring
Martin Felis 2023-06-11 20:03:55 +02:00
parent 3dba6d87e3
commit eaf2d4824c
2 changed files with 3 additions and 5 deletions

View File

@ -251,10 +251,8 @@ public class Game : Spatial
public void OnTileHovered(HexTile3D tile) public void OnTileHovered(HexTile3D tile)
{ {
Transform highlightTransform = _tileHighlight.GlobalTransform; Transform highlightTransform = tile.GlobalTransform;
highlightTransform.origin.x = tile.GlobalTranslation.x; highlightTransform.origin.y += 0.1f;
highlightTransform.origin.z = tile.GlobalTranslation.z;
highlightTransform.origin.y = 0.1f;
_mouseTileHighlight.Transform = highlightTransform; _mouseTileHighlight.Transform = highlightTransform;
_mouseWorldLabel.Text = tile.GlobalTranslation.ToString(); _mouseWorldLabel.Text = tile.GlobalTranslation.ToString();
_mouseTileLabel.Text = tile.OffsetCoords.ToString(); _mouseTileLabel.Text = tile.OffsetCoords.ToString();

View File

@ -19,7 +19,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0096302, 0, 0 )
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="Mesh" type="MeshInstance" parent="."] [node name="Mesh" type="MeshInstance" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.0325004, -5, -0.0786072 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, -5, 0 )
mesh = SubResource( 6 ) mesh = SubResource( 6 )
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )