diff --git a/assets/shaders/ReplacePalette.cs b/assets/shaders/ReplacePalette.cs index f33796d..f182cc7 100644 --- a/assets/shaders/ReplacePalette.cs +++ b/assets/shaders/ReplacePalette.cs @@ -7,7 +7,7 @@ public partial class ReplacePalette : Node3D } static Shader _paletteShader; - static System.Collections.Generic.Dictionary _textureCache = []; + static Dictionary _textureCache = []; [Export] public Texture2D Palette { get; set; } diff --git a/player/PickupController.cs b/player/PickupController.cs index ee03618..8c4fae7 100644 --- a/player/PickupController.cs +++ b/player/PickupController.cs @@ -141,6 +141,7 @@ public partial class PickupController : Node3D } } + record class RayResult(CollisionObject3D Collider, Vector3 Position, Vector3 Normal); RayResult RayToMouseCursor(PhysicsLayer collisionMask) { var camera = _player.Camera.Camera; @@ -155,14 +156,11 @@ public partial class PickupController : Node3D query.Exclude = HasItemsHeld ? [ CurrentItem.GetRid() ] : []; var result = GetWorld3D().DirectSpaceState.IntersectRay(query); - return (result.Count > 0) ? new(result) : null; - } - - class RayResult(Dictionary dict) - { - public CollisionObject3D Collider { get; } = dict["collider"].As(); - public Vector3 Position { get; } = (Vector3)dict["position"]; - public Vector3 Normal { get; } = (Vector3)dict["normal"]; + return (result.Count > 0) ? new( + result["collider"].As(), + (Vector3)result["position"], + (Vector3)result["normal"] + ) : null; } enum OutlineMode { Disable, Enable, Exclusive } diff --git a/scripts/globals/GlobalUsings.cs b/scripts/globals/GlobalUsings.cs index e276fe3..37b3d1d 100644 --- a/scripts/globals/GlobalUsings.cs +++ b/scripts/globals/GlobalUsings.cs @@ -1,6 +1,11 @@ +// These usings are included by default in every source file. +// See: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive#global-modifier + global using System; +global using System.Collections.Generic; global using System.Linq; + global using Godot; -global using Godot.Collections; + global using static Godot.GD; global using static Godot.Mathf;