Hello!
I was able to define an enum in a separate file, and then access it on the code like this:
var Inputs = cc.Enum(
{
Up: ‘up’,
Down: ‘down’,
Left: ‘left’,
Right: ‘right’,
A: ‘a’,
B: ‘b’,
Start: ‘start’,
Select: ‘select’
});
module.exports = Inputs;
//Elsewhere
var Inputs = require(“Inputs”);
but for some reason, trying to use the enum in a property, like this:
input : {
default: null,
type: Inputs
},
gives an error on the editor:
Anyone know why?Am I exporting it the wrong way?
Thanks!