diff --git a/Game/Root/Root.cs b/Game/Game/Game.cs similarity index 91% rename from Game/Root/Root.cs rename to Game/Game/Game.cs index 6748a80..92519dc 100644 --- a/Game/Root/Root.cs +++ b/Game/Game/Game.cs @@ -3,9 +3,9 @@ using GodotHostTest.AetherBind; using GodotHostTest.Interfaces; using OwofGames.AetherBind; -namespace GodotHostTest.Game.Root; +namespace GodotHostTest.Game.Game; -public partial class Root : Node2D +public partial class Game : Node2D { [Inject] private ICurrentLevel _currentLevel = null!; [Inject] private ILevelDataProvider _levelDataProvider = null!; diff --git a/Game/Root/Root.cs.uid b/Game/Game/Game.cs.uid similarity index 100% rename from Game/Root/Root.cs.uid rename to Game/Game/Game.cs.uid diff --git a/Game/Root/GameServiceSource.cs b/Game/Game/GameServiceSource.cs similarity index 96% rename from Game/Root/GameServiceSource.cs rename to Game/Game/GameServiceSource.cs index 2b6fea1..2fa4cd3 100644 --- a/Game/Root/GameServiceSource.cs +++ b/Game/Game/GameServiceSource.cs @@ -8,7 +8,7 @@ using OwofGames.GodotHost.Observability; using OwofGames.GodotLume; using RootServiceSource = GodotHostTest.AetherBind.RootServiceSource; -namespace GodotHostTest.Game.Root; +namespace GodotHostTest.Game.Game; public partial class GameServiceSource : RootServiceSource { diff --git a/Game/Root/GameServiceSource.cs.uid b/Game/Game/GameServiceSource.cs.uid similarity index 100% rename from Game/Root/GameServiceSource.cs.uid rename to Game/Game/GameServiceSource.cs.uid diff --git a/root_scene.tscn b/Game/Game/game.tscn similarity index 83% rename from root_scene.tscn rename to Game/Game/game.tscn index 6faf007..7b6eea7 100644 --- a/root_scene.tscn +++ b/Game/Game/game.tscn @@ -1,14 +1,14 @@ [gd_scene format=3 uid="uid://vsburk37p4u"] -[ext_resource type="Script" uid="uid://bvjvojer872c8" path="res://Game/Root/Root.cs" id="1_iqet6"] -[ext_resource type="PackedScene" uid="uid://xfd48ep5qi1k" path="res://Game/Level/level.tscn" id="3_bbjqm"] -[ext_resource type="Script" uid="uid://bpes6mnv21f2v" path="res://Game/Root/GameServiceSource.cs" id="3_iqet6"] +[ext_resource type="Script" uid="uid://bvjvojer872c8" path="res://Game/Game/Game.cs" id="1_iqet6"] +[ext_resource type="PackedScene" uid="uid://xfd48ep5qi1k" path="res://Game/Level/level.tscn" id="2_ft4gu"] +[ext_resource type="Script" uid="uid://bpes6mnv21f2v" path="res://Game/Game/GameServiceSource.cs" id="3_iqet6"] [ext_resource type="Resource" uid="uid://c4ym7vrpgk4e6" path="res://Game/levels_data.tres" id="4_t2jh2"] [ext_resource type="PackedScene" uid="uid://cvwvwv55n00ce" path="res://Game/Background/background.tscn" id="5_bbjqm"] [node name="Root" type="Node2D" unique_id=920849082] script = ExtResource("1_iqet6") -_levelScene = ExtResource("3_bbjqm") +_levelScene = ExtResource("2_ft4gu") [node name="Scope" type="Node" parent="." unique_id=597932533 node_paths=PackedStringArray("InjectedNodes")] script = ExtResource("3_iqet6") diff --git a/Game/levels_data.tres b/Game/levels_data.tres index 02a99f5..51017ef 100644 --- a/Game/levels_data.tres +++ b/Game/levels_data.tres @@ -5,8 +5,8 @@ [sub_resource type="Resource" id="Resource_bbjqm"] script = ExtResource("1_bkfnq") -TimeBetweenSpawns = 1.0 SpawnDuration = 4.0 +TimeBetweenSpawns = 1.0 metadata/_custom_type_script = "uid://ywe7vkywrdvk" [resource] diff --git a/addons/AetherBind/Editor/GodotScriptPathCache.cs b/addons/AetherBind/Editor/GodotScriptPathCache.cs index 5722ff6..10c3aae 100644 --- a/addons/AetherBind/Editor/GodotScriptPathCache.cs +++ b/addons/AetherBind/Editor/GodotScriptPathCache.cs @@ -14,7 +14,7 @@ namespace GodotHostTest.AetherBind.Editor; /// public static class GodotScriptPathCache { - private static readonly ConcurrentDictionary TypeToPath = new(); + // private static readonly ConcurrentDictionary TypeToPath = new(); private static readonly ConcurrentDictionary PathToType = new(); private static readonly Type GodotObject = typeof(GodotObject); private static readonly Type ScriptPathAttribute = typeof(ScriptPathAttribute); @@ -32,9 +32,9 @@ public static class GodotScriptPathCache private static void Initialize() { GD.Print($"Initializing {nameof(GodotScriptPathCache)}"); - TypeToPath.Clear(); + // TypeToPath.Clear(); PathToType.Clear(); - _assemblyLoadEventHandler = (sender, args) => CacheScriptsInAssembly(args.LoadedAssembly); + _assemblyLoadEventHandler = (_, args) => CacheScriptsInAssembly(args.LoadedAssembly); AppDomain.CurrentDomain.AssemblyLoad += _assemblyLoadEventHandler; foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) CacheScriptsInAssembly(assembly); @@ -49,7 +49,7 @@ public static class GodotScriptPathCache if (type.GetCustomAttributes(ScriptPathAttribute, false).FirstOrDefault() is ScriptPathAttribute scriptPath) { - TypeToPath[type] = scriptPath.Path; + // TypeToPath[type] = scriptPath.Path; PathToType[scriptPath.Path] = type; } } @@ -60,31 +60,31 @@ public static class GodotScriptPathCache GD.Print($"Deinitializing {nameof(GodotScriptPathCache)}"); AppDomain.CurrentDomain.AssemblyLoad -= _assemblyLoadEventHandler; _assemblyLoadEventHandler = null; - TypeToPath.Clear(); + // TypeToPath.Clear(); PathToType.Clear(); } - public static bool TryGetScriptPath(Type type, [MaybeNullWhen(false)] out string path) - { - InitializeIfNeeded(); - return TypeToPath.TryGetValue(type, out path); - } + // public static bool TryGetScriptPath(Type type, [MaybeNullWhen(false)] out string path) + // { + // InitializeIfNeeded(); + // return TypeToPath.TryGetValue(type, out path); + // } - public static Script GetScriptFromType(Type type) - { - InitializeIfNeeded(); - return TryGetScriptPath(type, out string path) - ? GD.Load