导出声明,TestDefine.js
module.exports = cc.Enum({
GameMenu: "GameMenu",
GameMain: "GameMain",
GameChoose: "GameChoose",
})
var SceneName= cc.Enum({
GameMenu: "GameMenu",
GameMain: "GameMain",
GameChoose: "GameChoose",
})
module.exports=SceneName
导入使用Test.js
var SceneName = require("TestDefine");
cc.log("SceneName.....", SceneName.GameMenu );
导出声明,TestDefine.js
module.exports.SceneName= cc.Enum({
GameMenu: "GameMenu",
GameMain: "GameMain",
GameChoose: "GameChoose",
})
module.exports.BuildType= cc.Enum({
Test: 1,
Release: 2,
})
var SceneName= cc.Enum({
GameMenu: "GameMenu",
GameMain: "GameMain",
GameChoose: "GameChoose",
})
var BuildType= cc.Enum({
Test: 1,
Release: 2,
})
module.exports.SceneName=SceneName
module.exports.BuildType=BuildType
var SceneName= cc.Enum({
GameMenu: "GameMenu",
GameMain: "GameMain",
GameChoose: "GameChoose",
})
var BuildType= cc.Enum({
Test: 1,
Release: 2,
})
module.exports={SceneName,BuildType}
导入使用Test.js
var {SceneName,BuildType} = require("TestDefine");
cc.log("SceneName.....", SceneName.GameMenu );
导出声明,TestDefine.js
export default cc.Enum({
GameMenu: "GameMenu",
GameMain: "GameMain",
GameChoose: "GameChoose",
})
var sceneName = cc.Enum({
GameMenu: "GameMenu",
GameMain: "GameMain",
GameChoose: "GameChoose",
})
export default sceneName
导入使用Test.js
import sceneName from "./data/Test/TestDefine";
cc.log("SceneName.....", SceneName.GameMenu );
导出声明,TestDefine.js
export var sceneName = cc.Enum({
GameMenu: "GameMenu",
GameMain: "GameMain",
GameChoose: "GameChoose",
})
export var BuildType=cc.Enum({
Test: 1,
Release: 2,
})
var sceneName = cc.Enum({
GameMenu: "GameMenu",
GameMain: "GameMain",
GameChoose: "GameChoose",
})
var BuildType=cc.Enum({
Test: 1,
Release: 2,
})
export {sceneName,BuildType}
导入使用Test.js
import {sceneName,BuildType} from "./data/Test/TestDefine";
cc.log("SceneName.....", SceneName.GameMenu );