You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a list of enum values that is exposed through the editor via the [Export] attribute. At runtime, the first entry in that list has an incorrect value that doesn't correspond to any member of the enum.
I've repro'd the problem in a stripped down project that only contains the following script assigned to a single Node2D.
using Godot;
using System;
using System.Collections.Generic;
public class NodeWithEnumList : Node2D
{
[Export]
public List<TestEnum> EnumVals {get; set;}
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
foreach(var enumVal in EnumVals)
{
Console.WriteLine($"You have an enumVal of {enumVal}");
}
}
public enum TestEnum
{
firstVal,
secondVal
}
}
Here's what's configured for that Node2D in the editor.
And here's what gets printed out in the console.
Steps to reproduce
Repro steps are included in the 'Issue Description' above, but here's a quick summary of how to repro with the project attached.
Start up the project and make sure that the 'Enum Vals' property on the Node2D has at least 1 entry assigned to it.
Play the project (you may want to have a debugger attached and a breakpoint in the _Ready() function in NodeWithEnumList.cs)
Look at the console output, or use the debugger to inspect the value of the EnumVals variable.
Godot version
3.3.3
System information
Windows 10
Issue description
I have a list of enum values that is exposed through the editor via the [Export] attribute. At runtime, the first entry in that list has an incorrect value that doesn't correspond to any member of the enum.
I've repro'd the problem in a stripped down project that only contains the following script assigned to a single Node2D.
Here's what's configured for that Node2D in the editor.
And here's what gets printed out in the console.
Steps to reproduce
Repro steps are included in the 'Issue Description' above, but here's a quick summary of how to repro with the project attached.
Minimal reproduction project
EnumBugTest.zip
The text was updated successfully, but these errors were encountered: