How do I reference an enum from an autoloaded script?

:bust_in_silhouette: Reply From: Inces

It is pointless to use autoload for this. You can use any form of static typing.
Option nr 1:
Keep all individual enums inside corresponding classes
Option nr 2:
Create enums class, that will only contain all constant data for other nodes to use or for autocomplecion purposes.

Either way, all You have to do is :

extends Node
class_name skillmove
enum Skill {}

Static node doesn’t even need to be loaded as singleton, it simply has to exist anywhere in your filesystem. You refer to it by its class, like var test = skillmove.Skill.Jump

2 Likes