0 votes

Hey there,

When scripting in C#, what is the correct syntax to accessing enum values, e.g. ACCESS_USERDATA, ACCESS_FILESYSTEM, etc... ( http://docs.godotengine.org/en/latest/classes/class_filedialog.html#enums )?

asked Apr 12 in Engine by Adam Cigánek (16 points)

1 Answer

0 votes

Nevermind, figured it out myself. It's FileDialog.AccessEnum.Filesystem. There is a gotcha here, because that enum in GDScript is called just Access, but in C# it's AccessEnum. This is because the name Access is already taken by a field in FileDialog. If it weren't taken, the enum would be called just Access. For example in Control, the size flags are accessed as Control.SizeFlag.Fill, etc..., and not Control.SizeFlagEnum.Fill.

This should probably be mentioned in the docs.

answered Apr 12 by Adam Cigánek (16 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.