@@ -255,78 +255,62 @@ Generates:
255255```
256256static partial class MyRes
257257{
258- private static StringName _ResPath; // -- (Res.DirPaths)
259- public static StringName ResPath => _ResPath ??= "res://";
258+ public static string ResPath => "res://"; // -- (Res.DirPaths)
260259
261- public static partial class Assets // -- (Each folder generates a nested type)
260+ public static partial class Assets // -- (Each folder generates a nested type)
262261 {
263- private static StringName _ResPath; // -- (Res.DirPaths)
264- public static StringName ResPath => _ResPath ??= "res://Assets";
262+ public static string ResPath => "res://Assets"; // -- (Res.DirPaths)
265263
266- public static partial class IconSvg // -- (Res.ResPaths | Res.Load - generates nested type)
264+ public static partial class IconSvg // -- (Res.ResPaths | Res.Load - generates nested type)
267265 {
268- private static StringName _ResPath;
269- public static StringName ResPath => _ResPath ??= "res://Assets/icon.svg";
266+ public static string ResPath => "res://Assets/icon.svg";
270267 public static CompressedTexture2D Load() => GD.Load<CompressedTexture2D>(ResPath);
271268 }
272269
273- private static StringName _HelpTxt; // -- (xtras - always generated as resource path)
274- public static StringName HelpTxt => _HelpTxt ??= "res://Assets/Help.txt";
270+ public static string HelpTxt => "res://Assets/Help.txt"; // -- (xtras - always generated as resource path)
275271
276- public static class Tr // -- (Only folders with discoverable resources are generated)
272+ public static class Tr // -- (Only folders with discoverable resources are generated)
277273 {
278- private static StringName _ResPath;
279- public static StringName ResPath => _ResPath ??= "res://Assets/tr";
274+ public static string ResPath => "res://Assets/tr"; // -- (Res.DirPaths)
280275
281- // If an importer generates files, these are provided rather than the input file as the input file will not be available when project is exported
282-
283- public static class TrEnTranslation
276+ public static class TrEnTranslation // -- (uses importer generated files instead of raw input file)
284277 {
285- private static StringName _ResPath;
286- public static StringName ResPath => _ResPath ??= "res://Assets/tr/tr.en.translation";
278+ public static string ResPath => "res://Assets/tr/tr.en.translation";
287279 public static OptimizedTranslation Load() => GD.Load<OptimizedTranslation>(ResPath);
288280 }
289281
290282 public static class TrFrTranslation
291283 {
292- private static StringName _ResPath;
293- public static StringName ResPath => _ResPath ??= "res://Assets/tr/tr.fr.translation";
284+ public static string ResPath => "res://Assets/tr/tr.fr.translation";
294285 public static OptimizedTranslation Load() => GD.Load<OptimizedTranslation>(ResPath);
295286 }
296287 }
297288 }
298289
299290 public static partial class Scenes
300291 {
301- private static StringName _ResPath;
302- public static StringName ResPath => _ResPath ??= "res://Scenes";
292+ public static string ResPath => "res://Scenes";
303293
304294 public static class MySceneTscn
305295 {
306- private static StringName _ResPath;
307- public static StringName ResPath => _ResPath ??= "res://Scenes/MyScene.tscn";
296+ public static string ResPath => "res://Scenes/MyScene.tscn";
308297 public static PackedScene Load() => GD.Load<PackedScene>(ResPath);
309298 }
310299
311300 public static class MySceneGd
312301 {
313- private static StringName _ResPath;
314- public static StringName ResPath => _ResPath ??= "res://Scenes/MyScene.gd";
302+ public static string ResPath => "res://Scenes/MyScene.gd";
315303 public static GDScript Load() => GD.Load<GDScript>(ResPath);
316304 }
317305
318306 public static class MySceneCs
319307 {
320- private static StringName _ResPath;
321- public static StringName ResPath => _ResPath ??= "res://Scenes/MyScene.cs";
308+ public static string ResPath => "res://Scenes/MyScene.cs";
322309 public static CSharpScript Load() => GD.Load<CSharpScript>(ResPath);
323310 }
324311
325- private static StringName _MySceneCsUid; // -- (Res.Uid - always generated as uid)
326- public static StringName MySceneCsUid => _MySceneCsUid ??= "uid://tyjsxc2njtw2";
327-
328- private static StringName _MySceneGdUid;
329- public static StringName MySceneGdUid => _MySceneGdUid ??= "uid://sho6tst545eo";
312+ public static string MySceneCsUid => "uid://tyjsxc2njtw2"; // -- (Res.Uid - always generated as uid)
313+ public static string MySceneGdUid => "uid://sho6tst545eo";
330314 }
331315}
332316```
@@ -341,16 +325,12 @@ static partial class MyRes
341325{
342326 public static partial class Assets
343327 {
344- public static CompressedTexture2D IconSvg
345- => GD.Load<CompressedTexture2D>("res://Assets/icon.svg");
328+ public static CompressedTexture2D IconSvg => GD.Load<CompressedTexture2D>("res://Assets/icon.svg");
346329
347330 public static class Tr
348331 {
349- public static OptimizedTranslation TrEnTranslation
350- => GD.Load<OptimizedTranslation>("res://Assets/tr/tr.en.translation");
351-
352- public static OptimizedTranslation TrFrTranslation
353- => GD.Load<OptimizedTranslation>("res://Assets/tr/tr.fr.translation");
332+ public static OptimizedTranslation TrEnTranslation => GD.Load<OptimizedTranslation>("res://Assets/tr/tr.en.translation");
333+ public static OptimizedTranslation TrFrTranslation => GD.Load<OptimizedTranslation>("res://Assets/tr/tr.fr.translation");
354334 }
355335 }
356336}
@@ -366,16 +346,12 @@ static partial class MyRes
366346{
367347 public static partial class Assets
368348 {
369- private static StringName _IconSvg;
370- public static StringName IconSvg => _IconSvg ??= "res://Assets/icon.svg";
349+ public static string IconSvg => "res://Assets/icon.svg";
371350
372351 public static class Tr
373352 {
374- private static StringName _TrEnTranslation;
375- public static StringName TrEnTranslation => _TrEnTranslation ??= "res://Assets/tr/tr.en.translation";
376-
377- private static StringName _TrFrTranslation;
378- public static StringName TrFrTranslation => _TrFrTranslation ??= "res://Assets/tr/tr.fr.translation";
353+ public static string TrEnTranslation => "res://Assets/tr/tr.en.translation";
354+ public static string TrFrTranslation => "res://Assets/tr/tr.fr.translation";
379355 }
380356 }
381357}
0 commit comments