修改resource资源结构

This commit is contained in:
luying
2020-10-12 14:52:36 +08:00
parent 7047f01cbf
commit 77c2b0b35a
41 changed files with 934 additions and 14 deletions

View File

@@ -6,7 +6,7 @@ const path = require('path');
var gamedata = {};
function initData () {
fs.readdirSync(__dirname + '/../resource')
fs.readdirSync(__dirname + '/../resource/jsons')
.filter(function(file) {
return (file.indexOf(".") !== 0) && (file !== "index.js");
})
@@ -15,7 +15,7 @@ function initData () {
var name = file.split('.')[0];
try {
gamedata[name] = JSON.parse(
fs.readFileSync(path.resolve(__dirname, "../resource/" + file))
fs.readFileSync(path.resolve(__dirname, "../resource/jsons/" + file))
);
} catch(e) {
console.error('【文件缺少】:' + file);