Skip to content

Releases: Cat-Lips/GodotSharp.SourceGenerators

GodotSharp.SourceGenerators.1.1.2

31 Mar 12:23

Choose a tag to compare

FIXED: [SceneTree] Instanced scene with same name as containing namespace fails to compile

GodotSharp.SourceGenerators.1.1.1

19 Mar 10:49

Choose a tag to compare

FIXED: [SceneTree] Instanced scene from different namespace fails to compile

GodotSharp.SourceGenerators.1.1.0

30 Jan 02:03

Choose a tag to compare

GodotSharp.SourceGenerators

C# Source Generators for use with the Godot Game Engine (available via Nuget):

  • SceneTree class attribute: Provides strongly typed access to the scene hierarchy (via _ operator)
  • GodotOverride method attribute: Allows use of On*, instead of virtual _* overrides
  • NEW: Base classes/helpers to create project specific source generators

(See tests for example usage patterns)

NB: Project reload or vs restart may be required to initialise Intellisense...

GodotSharp.SourceGenerators.1.0.0

29 Jan 06:51

Choose a tag to compare

GodotSharp.SourceGenerators

Some C# Source Generators for use with the Godot Game Engine:

  • SceneTree class attribute: Provides strongly typed access to a scene's hierarchy via the _ operator (ie, an effective equivalent to GDScript's $ operator)
  • GodotOverride method attribute: Allows any virtual _* overide to be replaced with On*

Basic Usage

using Godot;

namespace MyGame
{
    [SceneTree]
    public partial class MyControl : Control
    {
        [Export]
        public string PlayerName
        {
            get => _.VBox.Label1.Text;
            set => _.VBox.Label1.Text = value;
        }

        [GodotOverride]
        private void OnEnterTree()
            => PlayerName = "Player 1";
    }
}

For more advanced usage scenarios, see Godot.Tests...