Godot is not recognizing my new C# type...
using Godot;
using System;
[GodotClassName("UIGrid")]
public partial class UIGrid : MarginContainer
{
private GridContainer Grid;
private AudioStreamPlayer Player;
[Export] public uint Columns = 0;
[Export] public AudioStream Sound;
[Signal] public delegate void ItemFocusEnteredEventHandler(Control item);
[Signal] public delegate void ItemFocusExitedEventHandler(Control item);
public UIGrid()
{
Grid = new GridContainer();
Player = new AudioStreamPlayer();
AddChild(Grid );
AddChild(Player);
ChildEnteredTree += (child) =>
{
if (child is Control control)
{
control.FocusEntered += _PlaySound;
}
};
ChildExitingTree += (child) =>
{
if (child is Control control)
{
control.FocusEntered -= _PlaySound;
}
};
}
public virtual void _PlaySound()
{
Player.Stream = Sound;
Player.Play();
}
}