commonui-lib-test
Version:
"#common ui lib test"
27 lines (26 loc) • 863 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**取得setting.json內的資料 */
class versionSet {
constructor(dir) {
/**版本字串 */
this.verString = "0.0.0";
/**目錄 */
this.dir = "bin"; // 專案目錄名稱
this.dir = dir || this.dir;
this.url = this.dir + "/setting.json";
Laya.loader.load(this.url, Laya.Handler.create(this, this.loadComplete), null, Laya.Loader.JSON);
}
loadComplete() {
console.log("load setting. json ok");
this.getVersion();
}
getVersion() {
let json = Laya.loader.getRes(this.url);
if (json)
this.verString = json.version;
console.log("client version : ", this.verString);
return this.verString;
}
}
exports.default = versionSet;