Commit e5476b7d authored by 任建锋's avatar 任建锋

first commit

parents
# 所有空行或者以注释符号 # 开头的行都会被 Git 忽略。
# 可以使用标准的 glob 模式匹配。
# 匹配模式最后跟反斜杠(/)说明要忽略的是目录。
# 要忽略指定模式以外的文件或目录,可以在模式前加上惊叹号(! )取反。
# 所谓的 glob 模式是指 shell 所使用的简化了的正则表达式。星号(*)匹配零个或多个任
# 意字符; [abc] 匹配任何一个列在方括号中的字符(这个例子要么匹配一个 a,要么匹配一
# 个 b,要么匹配一个 c);问号(?)只匹配一个任意字符;如果在方括号中使用短划线分
# 隔两个字符,表示所有在这两个字符范围内的都可以匹配(比如 [0-9] 表示匹配所有 0 到
# 9 的数字)。
# 书上的一个例子
# #此为注释 – 将被 Git 忽略
# *.a
# 忽略所有 .a 结尾的文件
# !lib.a
# 但 lib.a 除外
# /TODO
# 仅仅忽略项目根目录下的 TODO 文件,不包括 subdir/TODO
# build/
# 忽略 build/ 目录下的所有文件
# doc/*.txt
# 会忽略 doc/notes.txt 但不包括 doc/server/arch.txt
node_modules/
released/
.idea
.wing
bin-debug/
bin-release/
*.swf
.vscode
.DS_Store
coverage
\ No newline at end of file
{
"name": "wx",
"version": "1.0.7",
"description": "基于annieJs的兑吧活动组件库",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"scripts": {
},
"author": "",
"license": "ISC",
"dependencies": {
"tl": "git+ssh://git@gitlab2.dui88.com:clq/tl.git#1.0",
"tw": "git+ssh://git@gitlab2.dui88.com:clq/tw.git#1.0"
}
}
\ No newline at end of file
{
"name": "yt",
"version": "1.0.0",
"description": "基于Babylonjs的兑吧活动组件库",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"scripts": {
},
"author": "",
"license": "ISC",
"dependencies": {
"tc": "git+ssh://git@gitlab2.dui88.com:clq/tc.git#1.0"
}
}
\ No newline at end of file
import { IMsgData } from './../../ls.1/interface/IMsgData';
import {AnimationGui} from "../others/AnimationGui";
import {SceneManager} from "../manager/SceneManager";
import { ABModule, IModuleData, ModuleType, GConsole } from 'tc'
import { YtLang } from '../util/YtLang';
/**
*Created by cuiliqiang on 2018/3/1
* 组件基类
*/
import {GuiManager} from "../manager/GuiManager";
export class Module {
private timeoutId;
protected view:any;
protected parent:any;
//事件
protected doEvents=[];
//面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI)
//规则元素
protected section: any;
/**
* 显示对象(皮肤)
*/
protected display: any;
/**
* 是否初始化完成
*/
protected isInit: boolean;
/**
* 点击事件回调池
*/
private clickCallbackBindPool: any;
constructor() {
this.initModel();
this.clickCallbackBindPool = {};
// var skinClass: any = eval(this.module.skinName);
// this.display = new skinClass();
// this.clickCallbackPool = {};
}
/**
* 初始化数据
*/
protected initModel(): void {
}
/**
* 初始化UI
*/
protected initUI(): void {
}
/**
* 显示
*/
protected show(...args): void {
this.removeEvent();
this.updateData(...args)
this.addEvent();
GuiManager.ins.changeGui(this.parent);
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
GuiManager.ins.removeGui(this.parent);
}
/**
* 添加事件
*/
protected addEvent(): void {
}
/**
* 移除事件
*/
protected removeEvent(): void {
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
}
/**
* 添加点击事件
* @param display
*
* @param callback
*/
protected addClick(display: any, callback: Function) {
this.doEvents[display.name] = display.onPointerUpObservable.add(callback);
}
/**
* 移除点击事件
* @param display
* @param callback
*/
protected removeClick(display: any): void {
display.onPointerUpObservable.remove(this.doEvents[display.name]);
}
/**
* 延时启用点击事件
* @param display 显示对象
* @param {number} delay 延时事件
*/
protected delayEnable(display: any, delay?: number): void {
display.mouseEnable = display.mouseChildren = false;
//如果已经禁用事件重新计算
if (this.timeoutId) {
clearTimeout(this.timeoutId);
}
this.timeoutId = setTimeout(function () {
this.timeoutId = 0;
display.mouseEnable = display.mouseChildren = true;
}, delay ? delay : 500);
}
public dispose(): void {
}
/**
* 鼠标事件
* @param enable
*/
protected enableMouseEvt(enable: boolean): void {
let viewList
for(viewList in this.view){
// console.log(viewList)
if(this.view[viewList]["mouseEnable"]==1||this.view[viewList]["mouseEnable"]==undefined){
this.view[viewList].isHitTestVisible=enable;
}
}
}
/**
* 单个元件鼠标事件
* @param enable
*/
protected enableMouseEvtView(view:BABYLON.GUI.Control,enable: boolean): void {
view.isHitTestVisible=enable;
if(enable==true){
view["mouseEnable"]=1;
}else{
view["mouseEnable"]=2;
}
}
}
\ No newline at end of file
import {AnimationGui} from "../others/AnimationGui";
import {SceneManager} from "../manager/SceneManager";
import { YtLang } from '../util/YtLang';
/**
*Created by cuiliqiang on 2018/3/1
* 组件基类
*/
import {GuiManager} from "../manager/GuiManager";
export class Module {
private timeoutId;
protected view:any;
protected parent:any;
//事件
protected doEvents=[];
//面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI)
//规则元素
protected section: any;
/**
* 显示对象(皮肤)
*/
protected display: any;
/**
* 是否初始化完成
*/
protected isInit: boolean;
/**
* 点击事件回调池
*/
private clickCallbackBindPool: any;
constructor() {
this.initModel();
this.clickCallbackBindPool = {};
// var skinClass: any = eval(this.module.skinName);
// this.display = new skinClass();
// this.clickCallbackPool = {};
}
/**
* 初始化数据
*/
protected initModel(): void {
}
/**
* 初始化UI
*/
protected initUI(): void {
}
/**
* 显示
*/
protected show(...args): void {
this.removeEvent();
this.updateData(...args)
this.addEvent();
GuiManager.ins.changeGui(this.parent);
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
GuiManager.ins.removeGui(this.parent);
}
/**
* 添加事件
*/
protected addEvent(): void {
}
/**
* 移除事件
*/
protected removeEvent(): void {
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
}
/**
* 添加点击事件
* @param display
*
* @param callback
*/
protected addClick(display: any, callback: Function) {
this.doEvents[display.name] = display.onPointerUpObservable.add(callback);
}
/**
* 移除点击事件
* @param display
* @param callback
*/
protected removeClick(display: any): void {
display.onPointerUpObservable.remove(this.doEvents[display.name]);
}
/**
* 延时启用点击事件
* @param display 显示对象
* @param {number} delay 延时事件
*/
protected delayEnable(display: any, delay?: number): void {
display.mouseEnable = display.mouseChildren = false;
//如果已经禁用事件重新计算
if (this.timeoutId) {
clearTimeout(this.timeoutId);
}
this.timeoutId = setTimeout(function () {
this.timeoutId = 0;
display.mouseEnable = display.mouseChildren = true;
}, delay ? delay : 500);
}
public dispose(): void {
}
/**
* 鼠标事件
* @param enable
*/
protected enableMouseEvt(enable: boolean): void {
let viewList
for(viewList in this.view){
// console.log(viewList)
if(this.view[viewList]["mouseEnable"]==1||this.view[viewList]["mouseEnable"]==undefined){
this.view[viewList].isHitTestVisible=enable;
}
}
}
/**
* 单个元件鼠标事件
* @param enable
*/
protected enableMouseEvtView(view:BABYLON.GUI.Control,enable: boolean): void {
view.isHitTestVisible=enable;
if(enable==true){
view["mouseEnable"]=1;
}else{
view["mouseEnable"]=2;
}
}
}
\ No newline at end of file
import {Module} from "./Module";
import {DisplayPool} from "../others/DisplayPool";
import {YtModuleName} from "../enum/YtModuleName";
/**
*Created by cuiliqiang on 2018/3/13
* 等待面板
*/
export class WaitingModule extends Module {
/**
* 最大进度值
*/
protected maxProgress: number;
constructor(){
super()
}
/**
* 更新页面
* @param {string} msgTxt 提示信息
*/
public updateData(msgTxt: string, ...args): void {
this.updateMsgTxt(msgTxt);
}
/**
* 更新提示文案
* @param desc
*/
protected updateMsgTxt(msgTxt: string): void {
if (this.view.msgTxt) {
this.view.msgTxt.text = msgTxt;
}
}
public init(){
DisplayPool.ins.displayPool[YtModuleName.WAITING_PANEL]=this;
}
}
\ No newline at end of file
import {Module} from "./Module";
import {DisplayPool} from "../others/DisplayPool";
import {YtModuleName} from "../enum/YtModuleName";
/**
*Created by cuiliqiang on 2018/3/13
* 等待面板
*/
export class WaitingModule extends Module {
/**
* 最大进度值
*/
protected maxProgress: number;
constructor(){
super()
}
/**
* 更新页面
* @param {string} msgTxt 提示信息
*/
public updateData(msgTxt: string, ...args): void {
this.updateMsgTxt(msgTxt);
}
/**
* 更新提示文案
* @param desc
*/
protected updateMsgTxt(msgTxt: string): void {
if (this.view.msgTxt) {
this.view.msgTxt.text = msgTxt;
}
}
public init(){
DisplayPool.ins.displayPool[YtModuleName.WAITING_PANEL]=this;
}
}
\ No newline at end of file
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"noImplicitAny": false,
"noEmitOnError": true,
"declarationDir": "./types",
"declaration": true,
"outDir": "./dist"
},
"exclude": [
"node_modules",
"dist",
"types"
]
}
\ No newline at end of file
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"noImplicitAny": false,
"noEmitOnError": true,
"declarationDir": "./types",
"declaration": true,
"outDir": "./dist",
"skipLibCheck": true
},
"exclude": [
"node_modules",
"dist",
"types"
]
}
\ No newline at end of file
兑吧业务框架
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
*Created by cuiliqiang on 2018/3/13
*/
var YtModuleName;
(function (YtModuleName) {
//加载场景
YtModuleName["LOADING_GUI"] = "LoadingScene";
//等待面板
YtModuleName["WAITING_PANEL"] = "WaitingPanel";
//提示信息面板
YtModuleName["MSG_PANEL"] = "MsgPanel";
})(YtModuleName = exports.YtModuleName || (exports.YtModuleName = {}));
//# sourceMappingURL=YtModuleName.js.map
\ No newline at end of file
{"version":3,"file":"YtModuleName.js","sourceRoot":"","sources":["../../src/enum/YtModuleName.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,IAAY,YAOX;AAPD,WAAY,YAAY;IACpB,MAAM;IACN,4CAA4B,CAAA;IAC5B,MAAM;IACN,8CAA8B,CAAA;IAC9B,QAAQ;IACR,sCAAsB,CAAA;AAC1B,CAAC,EAPW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAOvB"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var YtModuleName_1 = require("./enum/YtModuleName");
exports.YtModuleName = YtModuleName_1.YtModuleName;
var YtLang_1 = require("./util/YtLang");
exports.YtLang = YtLang_1.YtLang;
var AssetsManager_1 = require("./manager/AssetsManager");
exports.AssetsManager = AssetsManager_1.AssetsManager;
var GuiManager_1 = require("./manager/GuiManager");
exports.GuiManager = GuiManager_1.GuiManager;
var SceneManager_1 = require("./manager/SceneManager");
exports.SceneManager = SceneManager_1.SceneManager;
var ModuleManager_1 = require("./manager/ModuleManager");
exports.ModuleManager = ModuleManager_1.ModuleManager;
var AnimationCon_1 = require("./others/AnimationCon");
exports.AnimationCon = AnimationCon_1.AnimationCon;
var AnimationGui_1 = require("./others/AnimationGui");
exports.AnimationGui = AnimationGui_1.AnimationGui;
var particleCon_1 = require("./others/particleCon");
exports.particleCon = particleCon_1.particleCon;
var GuiCreate_1 = require("./others/GuiCreate");
exports.GuiCreate = GuiCreate_1.GuiCreate;
var Module_1 = require("./module/Module");
exports.Module = Module_1.Module;
var DisplayPool_1 = require("./others/DisplayPool");
exports.DisplayPool = DisplayPool_1.DisplayPool;
var MsgModule_1 = require("./module/MsgModule");
exports.MsgModule = MsgModule_1.MsgModule;
var LoadingModule_1 = require("./module/LoadingModule");
exports.LoadingModule = LoadingModule_1.LoadingModule;
var WaitingModule_1 = require("./module/WaitingModule");
exports.WaitingModule = WaitingModule_1.WaitingModule;
var PanelModule_1 = require("./module/PanelModule");
exports.PanelModule = PanelModule_1.PanelModule;
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAGA,oDAAiD;AA4B7C,uBA5BI,2BAAY,CA4BJ;AA3BhB,wCAAqC;AA8BjC,iBA9BI,eAAM,CA8BJ;AA7BV,yDAAsD;AAgClD,wBAhCI,6BAAa,CAgCJ;AA/BjB,mDAAgD;AA+B9B,qBA/BV,uBAAU,CA+BU;AA9B5B,uDAAoD;AA8BvB,uBA9BrB,2BAAY,CA8BqB;AA7BzC,yDAAsD;AA6BZ,wBA7BlC,6BAAa,CA6BkC;AA5BvD,sDAAmD;AAgB/C,uBAhBI,2BAAY,CAgBJ;AAfhB,sDAAmD;AAelC,uBAfT,2BAAY,CAeS;AAd7B,oDAAiD;AAcnB,sBAdtB,yBAAW,CAcsB;AAbzC,gDAA6C;AAaH,oBAblC,qBAAS,CAakC;AAZnD,0CAAuC;AASnC,iBATI,eAAM,CASJ;AARV,oDAAiD;AAQtC,sBARH,yBAAW,CAQG;AAPtB,gDAA4C;AAOrB,oBAPf,qBAAS,CAOe;AANhC,wDAAqD;AAMpB,wBANzB,6BAAa,CAMyB;AAL9C,wDAAqD;AAKN,wBALvC,6BAAa,CAKuC;AAJ5D,oDAAiD;AAIY,sBAJrD,yBAAW,CAIqD"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=IMsgData.js.map
\ No newline at end of file
{"version":3,"file":"IMsgData.js","sourceRoot":"","sources":["../../src/interface/IMsgData.ts"],"names":[],"mappings":""}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ResourceData.js.map
\ No newline at end of file
{"version":3,"file":"ResourceData.js","sourceRoot":"","sources":["../../src/interface/ResourceData.ts"],"names":[],"mappings":""}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=fileData.js.map
\ No newline at end of file
{"version":3,"file":"fileData.js","sourceRoot":"","sources":["../../src/interface/fileData.ts"],"names":[],"mappings":""}
\ No newline at end of file
"use strict";
//import {ResourceCon} from "../resource/resource";
Object.defineProperty(exports, "__esModule", { value: true });
var AssetsManager = /** @class */ (function () {
function AssetsManager() {
//this._resourceData=ResourceCon.ins.resource;
this._resourceObject = {
binarys: {},
images: {},
models: {},
textures: {},
cubeTextures: {}
};
}
Object.defineProperty(AssetsManager, "ins", {
get: function () {
if (!this.instance) {
this.instance = new AssetsManager();
}
return this.instance;
},
enumerable: true,
configurable: true
});
Object.defineProperty(AssetsManager.prototype, "resourceData", {
set: function (resource) {
this._resourceData = resource;
},
enumerable: true,
configurable: true
});
AssetsManager.prototype.loadFile = function (sceneNames, scene, callback, progress) {
var assetsManager = new BABYLON.AssetsManager(scene);
assetsManager.useDefaultLoadingScreen = false;
sceneNames.forEach(function (sceneName) {
//加载模型
var _thisModel = {};
this._resourceData[sceneName].models.forEach(function (model) {
var meshTask = assetsManager.addMeshTask("skull task", "", model.filePath, model.fileName);
meshTask.onSuccess = function (task) {
console.log("meshTask");
console.log(task);
task.loadedMeshes.forEach(function (mesh) {
mesh.isVisible = false;
mesh.name = "noneisVisible_" + mesh;
});
var _thisMesh = task;
_thisModel[model.name] = _thisMesh;
this._resourceObject.models[sceneName] = _thisModel;
}.bind(this);
}.bind(this));
//加载图片
var _thisImage = {};
this._resourceData[sceneName].images.forEach(function (image) {
var imageTask = assetsManager.addImageTask("image task", image.filePath + image.fileName);
imageTask.onSuccess = function (task) {
_thisImage[image.name] = task.image;
this._resourceObject.images[sceneName] = _thisImage;
}.bind(this);
}.bind(this));
//加载贴图
var _thisTexture = {};
this._resourceData[sceneName].textures.forEach(function (texture) {
var textureTask = assetsManager.addTextureTask("texture task", texture.filePath + texture.fileName);
textureTask.onSuccess = function (task) {
_thisTexture[texture.name] = task.texture;
this._resourceObject.textures[sceneName] = _thisTexture;
}.bind(this);
}.bind(this));
//加载二进制文件
var _thisBinary = {};
this._resourceData[sceneName].binarys.forEach(function (binary) {
var binaryTask = assetsManager.addBinaryFileTask("binary task", binary.filePath + binary.fileName);
binaryTask.onSuccess = function (task) {
console.log(6666677);
console.log(task.data);
_thisBinary[binary.name] = task.data;
_thisBinary[binary.name]["url"] = task.url;
this._resourceObject.binarys[sceneName] = _thisBinary;
}.bind(this);
}.bind(this));
//加载天空盒子/环境贴图
var _thisCubeTexture = {};
this._resourceData[sceneName].cubeTextures.forEach(function (cubeTexture) {
var cubeTextureTask = assetsManager.addCubeTextureTask("cubeTexture task", cubeTexture.filePath + cubeTexture.fileName);
cubeTextureTask.onSuccess = function (task) {
_thisCubeTexture[cubeTexture.name] = task.texture;
this._resourceObject.cubeTextures[sceneName] = _thisCubeTexture;
}.bind(this);
}.bind(this));
}.bind(this));
assetsManager.load();
//加载成功一个子元素调用
assetsManager.onProgress = function (task) {
var _this = {
totalTasksCount: assetsManager._totalTasksCount,
waitingTasksCount: assetsManager._waitingTasksCount,
loadCount: (assetsManager._totalTasksCount - assetsManager._waitingTasksCount) / assetsManager._totalTasksCount
};
progress(_this);
}.bind(this);
//全部加载成功调用
assetsManager.onFinish = function (task) {
callback();
}.bind(this);
};
Object.defineProperty(AssetsManager.prototype, "resourceObject", {
get: function () {
return this._resourceObject;
},
enumerable: true,
configurable: true
});
return AssetsManager;
}());
exports.AssetsManager = AssetsManager;
//# sourceMappingURL=AssetsManager.js.map
\ No newline at end of file
{"version":3,"file":"AssetsManager.js","sourceRoot":"","sources":["../../src/manager/AssetsManager.ts"],"names":[],"mappings":";AAAA,mDAAmD;;AAEnD;IAcI;QACI,8CAA8C;QAC9C,IAAI,CAAC,eAAe,GAAC;YACjB,OAAO,EAAC,EAAE;YACV,MAAM,EAAC,EAAE;YACT,MAAM,EAAC,EAAE;YACT,QAAQ,EAAC,EAAE;YACX,YAAY,EAAC,EAAE;SAClB,CAAA;IACL,CAAC;IAhBD,sBAAkB,oBAAG;aAArB;YACI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;aACvC;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IAaD,sBAAW,uCAAY;aAAvB,UAAwB,QAAQ;YAC5B,IAAI,CAAC,aAAa,GAAC,QAAQ,CAAC;QAChC,CAAC;;;OAAA;IAEM,gCAAQ,GAAf,UAAgB,UAAwB,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ;QAE5D,IAA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,GAAC,aAAa,CAAC,kBAAkB,CAAC,GAAC,aAAa,CAAC,gBAAgB;aAC7G,CAAA;YACD,QAAQ,CAAC,KAAK,CAAC,CAAA;QAEnB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,UAAU;QACV,aAAa,CAAC,QAAQ,GAAC,UAAS,IAAI;YAChC,QAAQ,EAAE,CAAA;QACd,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjB,CAAC;IAED,sBAAW,yCAAc;aAAzB;YACI,OAAO,IAAI,CAAC,eAAe,CAAC;QAChC,CAAC;;;OAAA;IAEL,oBAAC;AAAD,CAAC,AAlJD,IAkJC;AAlJY,sCAAa"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// GUI
var GuiManager = /** @class */ (function () {
function GuiManager() {
this.guiPoll = {};
this._lastGui = null;
this._fullscreenUI = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("GUI");
this._fullscreenUI.idealWidth = 750;
}
Object.defineProperty(GuiManager, "ins", {
get: function () {
if (!this.instance) {
this.instance = new GuiManager();
}
return this.instance;
},
enumerable: true,
configurable: true
});
GuiManager.prototype.changeGui = function (gui) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
var _length = this._fullscreenUI.rootContainer.children.length;
for (var i = 0; i < _length; i++) {
this._fullscreenUI.removeControl(this._fullscreenUI.rootContainer.children[0]);
}
this._fullscreenUI.addControl(gui);
this._lastGui = gui;
};
GuiManager.prototype.appendGui = function (gui) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
this._fullscreenUI.addControl(gui);
this._lastGui = gui;
};
GuiManager.prototype.removeGui = function (gui) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
this._fullscreenUI.removeControl(this._lastGui);
};
GuiManager.prototype.removeAll = function (gui) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
var _length = this._fullscreenUI.rootContainer.children.length;
for (var i = 0; i < _length; i++) {
this._fullscreenUI.removeControl(this._fullscreenUI.rootContainer.children[0]);
}
};
GuiManager.prototype.openPanel = function (gui) {
};
GuiManager.prototype.closePanel = function (gui) {
};
Object.defineProperty(GuiManager.prototype, "fullscreenUI", {
get: function () {
return this._fullscreenUI;
},
enumerable: true,
configurable: true
});
Object.defineProperty(GuiManager.prototype, "lastGui", {
get: function () {
return this._lastGui;
},
enumerable: true,
configurable: true
});
return GuiManager;
}());
exports.GuiManager = GuiManager;
//# sourceMappingURL=GuiManager.js.map
\ No newline at end of file
{"version":3,"file":"GuiManager.js","sourceRoot":"","sources":["../../src/manager/GuiManager.ts"],"names":[],"mappings":";;AAAA,MAAM;AACN;IAkBI;QAXQ,YAAO,GAAK,EAAE,CAAC;QAYnB,IAAI,CAAC,QAAQ,GAAC,IAAI,CAAC;QACnB,IAAI,CAAC,aAAa,GAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAChF,IAAI,CAAC,aAAa,CAAC,UAAU,GAAC,GAAG,CAAC;IACtC,CAAC;IAZD,sBAAkB,iBAAG;aAArB;YACI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;aACpC;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IASM,8BAAS,GAAhB,UAAiB,GAAG;QAAC,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;QACxB,IAAI,OAAO,GAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAA;QAC5D,KAAI,IAAI,CAAC,GAAC,CAAC,EAAC,CAAC,GAAC,OAAO,EAAC,CAAC,EAAE,EAAC;YACtB,IAAI,CAAC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I,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IACL,iBAAC;AAAD,CAAC,AAlED,IAkEC;AAlEY,gCAAU"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
*Created by renjianfeng on 2018/2/28
*/
var DisplayPool_1 = require("../others/DisplayPool");
var YtLang_1 = require("../util/YtLang");
var tc_1 = require("tc");
var YtModuleName_1 = require("../enum/YtModuleName");
var ModuleManager = /** @class */ (function () {
function ModuleManager() {
/**
* 模块列表
*/
this.moduleList = [];
}
Object.defineProperty(ModuleManager, "ins", {
get: function () {
if (!this.instance) {
this.instance = new ModuleManager();
}
return this.instance;
},
enumerable: true,
configurable: true
});
/**
* 打开一个模块
* @param {ModuleName} moduleName
*/
ModuleManager.prototype.openModule = function (moduleName) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
console.log(moduleName);
console.log(DisplayPool_1.DisplayPool.ins.displayPool[moduleName]);
(_a = DisplayPool_1.DisplayPool.ins.displayPool[moduleName]).show.apply(_a, args);
var _a;
};
/**
* 按模块名获取模块数据
* @param {string} moduleName 模块名
* @returns {ModuleData}
*/
ModuleManager.prototype.getModule = function (moduleName) {
if (DisplayPool_1.DisplayPool.ins.displayPool[moduleName]) {
return moduleName;
}
else {
return false;
}
//return this.moduleList[moduleName];
};
/**
* 关闭一个模块
* @param {ModuleName} moduleName
*/
ModuleManager.prototype.closeModule = function (moduleName) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
console.log(moduleName);
console.log(DisplayPool_1.DisplayPool.ins.displayPool[moduleName]);
(_a = DisplayPool_1.DisplayPool.ins.displayPool[moduleName]).hide.apply(_a, args);
var _a;
};
/**
* 初始化
*/
ModuleManager.prototype.init = function () {
var _this = this;
tc_1.GDispatcher.addEvent(tc_1.ABNetManager.ERROR, function (msg) {
// alert()
console.log("msg");
var msgData = {
msg: msg,
sureBtnTxt: YtLang_1.YtLang.lang_011,
cancelBtnTxt: YtLang_1.YtLang.lang_012
};
console.log(msgData);
_this.openMsgModule(msgData);
}, this);
};
/**
* 打开提示模块
* @param msgData
*/
ModuleManager.prototype.openMsgModule = function (msgData) {
this.openModule(YtModuleName_1.YtModuleName.MSG_PANEL, msgData);
};
return ModuleManager;
}());
exports.ModuleManager = ModuleManager;
//# sourceMappingURL=ModuleManager.js.map
\ No newline at end of file
{"version":3,"file":"ModuleManager.js","sourceRoot":"","sources":["../../src/manager/ModuleManager.ts"],"names":[],"mappings":";;AACA;;GAEG;AACH,qDAAkD;AAClD,yCAAsC;AAEtC,yBAAwF;AACxF,qDAAkD;AAElD;IAAA;QAYI;;WAEG;QACK,eAAU,GAAkB,EAAE,CAAC;IAoE3C,CAAC;IA9EG,sBAAkB,oBAAG;aAArB;YACI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;aACvC;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IAOD;;;OAGG;IACI,kCAAU,GAAjB,UAAkB,UAAiB;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;QACxC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;QACvB,OAAO,CAAC,GAAG,CAAE,yBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;QACrD,CAAA,KAAA,yBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA,CAAC,IAAI,WAAI,IAAI,EAAC;;IACzD,CAAC;IAGD;;;;OAIG;IACI,iCAAS,GAAhB,UAAiB,UAAkB;QAC/B,IAAG,yBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,EAAC;YACvC,OAAO,UAAU,CAAA;SACpB;aAAI;YACD,OAAO,KAAK,CAAC;SAChB;QACD,qCAAqC;IACzC,CAAC;IAEA;;;MAGE;IACI,mCAAW,GAAlB,UAAmB,UAAiB;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;QACzC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;QACvB,OAAO,CAAC,GAAG,CAAE,yBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;QACrD,CAAA,KAAA,yBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA,CAAC,IAAI,WAAI,IAAI,EAAC;;IACzD,CAAC;IASD;;OAEG;IACI,4BAAI,GAAX;QAAA,iBAYC;QAXG,gBAAW,CAAC,QAAQ,CAAC,iBAAY,CAAC,KAAK,EAAE,UAAC,GAAW;YAClD,UAAU;YACV,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YACjB,IAAM,OAAO,GAAa;gBACtB,GAAG,EAAE,GAAG;gBACR,UAAU,EAAE,eAAM,CAAC,QAAQ;gBAC3B,YAAY,EAAE,eAAM,CAAC,QAAQ;aAChC,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACpB,KAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC,EAAE,IAAI,CAAC,CAAC;IACb,CAAC;IAEA;;;MAGE;IACI,qCAAa,GAApB,UAAqB,OAAiB;QAClC,IAAI,CAAC,UAAU,CAAC,2BAAY,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IACL,oBAAC;AAAD,CAAC,AAnFD,IAmFC;AAnFY,sCAAa"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SceneManager = /** @class */ (function () {
function SceneManager() {
this._canvas = document.querySelector("#renderCanvas");
this._engine = new BABYLON.Engine(this._canvas, true);
var createScene = function () {
{
var scene = new BABYLON.Scene(this._engine);
//下面的代码是为了设置微信上面的touch事件兼容
var n = scene._onPointerUp, o = scene._onPointerDown, r = scene._onPointerMove, a = BABYLON.Tools.GetPointerPrefix();
this._canvas.removeEventListener(a + "move", r),
this._canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = function (e) {
void 0 !== e.pointerId && n(e);
}
,
scene._onPointerDown = function (e) {
void 0 !== e.pointerId && o(e);
}
,
scene._onPointerMove = function (e) {
void 0 !== e.pointerId && r(e);
}
,
this._canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this._canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
this._engine.setHardwareScalingLevel(0.6);
return scene;
}
}.bind(this);
this._scene = createScene();
this._engine.runRenderLoop(function () {
this._scene.render();
TWEEN.update();
}.bind(this));
window.addEventListener("resize", function () {
this._engine.resize();
}.bind(this));
}
Object.defineProperty(SceneManager, "ins", {
get: function () {
if (!this.instance) {
this.instance = new SceneManager();
}
return this.instance;
},
enumerable: true,
configurable: true
});
Object.defineProperty(SceneManager.prototype, "scene", {
/* public get stage(): any {
return this._stage;
}*/
get: function () {
return this._scene;
},
enumerable: true,
configurable: true
});
Object.defineProperty(SceneManager.prototype, "canvas", {
get: function () {
return this._canvas;
},
enumerable: true,
configurable: true
});
Object.defineProperty(SceneManager.prototype, "engine", {
get: function () {
return this._engine;
},
enumerable: true,
configurable: true
});
SceneManager.prototype.change = function (display) {
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
for (var _i = 0, _a = SceneManager.ins.scene.meshes; _i < _a.length; _i++) {
var l = _a[_i];
l.dispose();
}
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
SceneManager.ins.stage = display;
};
return SceneManager;
}());
exports.SceneManager = SceneManager;
//# sourceMappingURL=SceneManager.js.map
\ No newline at end of file
{"version":3,"file":"SceneManager.js","sourceRoot":"","sources":["../../src/manager/SceneManager.ts"],"names":[],"mappings":";;AACA;IAgBI;QAEA,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QACvD,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,WAAW,GAAC;YACZ;gBAGI,IAAI,KAAK,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAE5C,0BAA0B;gBAE1B,IAAI,CAAC,GAAG,KAAK,CAAC,YAAY,EACpB,CAAC,GAAG,KAAK,CAAC,cAAc,EACxB,CAAC,GAAG,KAAK,CAAC,cAAc,EACxB,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;gBACvC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC;oBAC/C,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC;oBAC/C,MAAM,CAAC,mBAAmB,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;oBACvC,KAAK,CAAC,YAAY,GAAG,UAAS,CAAC;wBAC3B,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;oBAClC,CAAC;;wBAED,KAAK,CAAC,cAAc,GAAG,UAAS,CAAC;4BAC7B,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;wBAClC,CAAC;;wBAED,KAA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,EAAE;gBAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;aACtC;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IA8DD,sBAAW,+BAAK;QAJjB;;YAEI;aAEH;YACI,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,CAAC;;;OAAA;IAED,sBAAW,gCAAM;aAAjB;YACI,OAAO,IAAI,CAAC,OAAO,CAAC;QACxB,CAAC;;;OAAA;IAED,sBAAW,gCAAM;aAAjB;YACI,OAAO,IAAI,CAAC,OAAO,CAAC;QACxB,CAAC;;;OAAA;IAEM,6BAAM,GAAb,UAAc,OAAO;QAClB;;;;YAII;QAEH,KAAa,UAA6B,EAA7B,KAAA,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAA7B,cAA6B,EAA7B,IAA6B;YAAtC,IAAI,CAAC,SAAA;YACL,CAAC,CAAC,OAAO,EAAE,CAAA;SACd;QAED;;;;;;;;;;;;;WAaG;QACH,YAAY,CAAC,GAAG,CAAC,KAAK,GAAC,OAAO,CAAC;IACnC,CAAC;IAaL,mBAAC;AAAD,CAAC,AA/HD,IA+HC;AA/HY,oCAAY"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Module_1 = require("./Module");
var DisplayPool_1 = require("../others/DisplayPool");
var YtModuleName_1 = require("../enum/YtModuleName");
var LoadingModule = /** @class */ (function (_super) {
__extends(LoadingModule, _super);
function LoadingModule() {
return _super.call(this) || this;
}
LoadingModule.prototype.init = function () {
DisplayPool_1.DisplayPool.ins.displayPool[YtModuleName_1.YtModuleName.LOADING_GUI] = this;
};
/**
* 更新页面
* @param {number} max 最大进度值
*/
LoadingModule.prototype.updateData = function (max) {
this.maxProgress = max;
};
LoadingModule.prototype.onProgress = function (curr) {
var pre = parseInt((curr * 100).toString());
if (this.view.progressTxt) {
this.view.progressTxt.text = pre + '%';
}
};
return LoadingModule;
}(Module_1.Module));
exports.LoadingModule = LoadingModule;
//# sourceMappingURL=LoadingModule.js.map
\ No newline at end of file
{"version":3,"file":"LoadingModule.js","sourceRoot":"","sources":["../../src/module/LoadingModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mCAAgC;AAChC,qDAAkD;AAClD,qDAAkD;AAGlD;IAAmC,iCAAM;IAOrC;eACI,iBAAO;IACX,CAAC;IAEM,4BAAI,GAAX;QACI,yBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC,WAAW,CAAC,GAAC,IAAI,CAAC;IAC/D,CAAC;IAGD;;;OAGG;IACI,kCAAU,GAAjB,UAAkB,GAAW;QACzB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IAC3B,CAAC;IAEM,kCAAU,GAAjB,UAAkB,IAAY;QAC1B,IAAM,GAAG,GAAW,QAAQ,CAAC,CAAC,IAAI,GAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAE;QACrD,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACvB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;SAC1C;IACL,CAAC;IACL,oBAAC;AAAD,CAAC,AA9BD,CAAmC,eAAM,GA8BxC;AA9BY,sCAAa"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var AnimationGui_1 = require("../others/AnimationGui");
var SceneManager_1 = require("../manager/SceneManager");
/**
*Created by cuiliqiang on 2018/3/1
* 组件基类
*/
var GuiManager_1 = require("../manager/GuiManager");
var Module = /** @class */ (function () {
function Module() {
//事件
this.doEvents = [];
//面板隐藏显示实例
this.panelsAn = new AnimationGui_1.AnimationGui(SceneManager_1.SceneManager.ins.scene, GuiManager_1.GuiManager.ins.fullscreenUI);
this.initModel();
this.clickCallbackBindPool = {};
// var skinClass: any = eval(this.module.skinName);
// this.display = new skinClass();
// this.clickCallbackPool = {};
}
/**
* 初始化数据
*/
Module.prototype.initModel = function () {
};
/**
* 初始化UI
*/
Module.prototype.initUI = function () {
};
/**
* 显示
*/
Module.prototype.show = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.removeEvent();
this.updateData.apply(this, args);
this.addEvent();
GuiManager_1.GuiManager.ins.changeGui(this.parent);
};
/**
* 隐藏
*/
Module.prototype.hide = function () {
this.removeEvent();
GuiManager_1.GuiManager.ins.removeGui(this.parent);
};
/**
* 添加事件
*/
Module.prototype.addEvent = function () {
};
/**
* 移除事件
*/
Module.prototype.removeEvent = function () {
};
/**
* 更新页面
* @param args
*/
Module.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
};
/**
* 添加点击事件
* @param display
*
* @param callback
*/
Module.prototype.addClick = function (display, callback) {
this.doEvents[display.name] = display.onPointerUpObservable.add(callback);
};
/**
* 移除点击事件
* @param display
* @param callback
*/
Module.prototype.removeClick = function (display) {
display.onPointerUpObservable.remove(this.doEvents[display.name]);
};
/**
* 延时启用点击事件
* @param display 显示对象
* @param {number} delay 延时事件
*/
Module.prototype.delayEnable = function (display, delay) {
display.mouseEnable = display.mouseChildren = false;
//如果已经禁用事件重新计算
if (this.timeoutId) {
clearTimeout(this.timeoutId);
}
this.timeoutId = setTimeout(function () {
this.timeoutId = 0;
display.mouseEnable = display.mouseChildren = true;
}, delay ? delay : 500);
};
Module.prototype.dispose = function () {
};
/**
* 鼠标事件
* @param enable
*/
Module.prototype.enableMouseEvt = function (enable) {
var viewList;
for (viewList in this.view) {
// console.log(viewList)
if (this.view[viewList]["mouseEnable"] == 1 || this.view[viewList]["mouseEnable"] == undefined) {
this.view[viewList].isHitTestVisible = enable;
}
}
};
/**
* 单个元件鼠标事件
* @param enable
*/
Module.prototype.enableMouseEvtView = function (view, enable) {
view.isHitTestVisible = enable;
if (enable == true) {
view["mouseEnable"] = 1;
}
else {
view["mouseEnable"] = 2;
}
};
return Module;
}());
exports.Module = Module;
//# sourceMappingURL=Module.js.map
\ No newline at end of file
{"version":3,"file":"Module.js","sourceRoot":"","sources":["../../src/module/Module.ts"],"names":[],"mappings":";;AACA,uDAAoD;AACpD,wDAAqD;AAErD;;;GAGG;AACH,oDAAiD;AAEjD;IAgCI;QAtBC,IAAI;QACM,aAAQ,GAAC,EAAE,CAAC;QAEpB,UAAU;QACH,aAAQ,GAAC,IAAI,2BAAY,CAAC,2BAAY,CAAC,GAAG,CAAC,KAAK,EAAC,uBAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAmBnF,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;QAClC,oDAAoD;QACnD,kCAAkC;QAClC,+BAA+B;IAClC,CAAC;IAEC;;KAEC;IACO,0BAAS,GAAnB;IAEA,CAAC;IAED;;OAEG;IACO,uBAAM,GAAhB;IAEA,CAAC;IAEJ;;aAES;IACI,qBAAI,GAAd;QAAe,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QAClB,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,OAAf,IAAI,EAAe,IAAI,EAAC;QACxB,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,uBAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEF;;OAEG;IACO,qBAAI,GAAd;QACI,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,uBAAU,CAAC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AO,GAAd;IAEA,CAAC;IAEC;;;KAGC;IACO,+BAAc,GAAxB,UAAyB,MAAe;QACpC,IAAI,QAAQ,CAAA;QACZ,KAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAC;YACvB,wBAAwB;YACxB,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,IAAE,CAAC,IAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,IAAE,SAAS,EAAC;gBACrF,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,gBAAgB,GAAC,MAAM,CAAC;aAC9C;SACH;IACL,CAAC;IAGC;;;KAGC;IACO,mCAAkB,GAA5B,UAA6B,IAAwB,EAAC,MAAe;QACjE,IAAI,CAAC,gBAAgB,GAAC,MAAM,CAAC;QAC7B,IAAG,MAAM,IAAE,IAAI,EAAC;YACZ,IAAI,CAAC,aAAa,CAAC,GAAC,CAAC,CAAC;SACzB;aAAI;YACD,IAAI,CAAC,aAAa,CAAC,GAAC,CAAC,CAAC;SACzB;IACL,CAAC;IACL,aAAC;AAAD,CAAC,AAtKD,IAsKC;AAtKY,wBAAM"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var PanelModule_1 = require("./PanelModule");
var DisplayPool_1 = require("../others/DisplayPool");
var YtModuleName_1 = require("../enum/YtModuleName");
var MsgModule = /** @class */ (function (_super) {
__extends(MsgModule, _super);
function MsgModule() {
return _super.call(this) || this;
}
MsgModule.prototype.init = function () {
DisplayPool_1.DisplayPool.ins.displayPool[YtModuleName_1.YtModuleName.MSG_PANEL] = this;
};
/**
* 添加事件
* */
MsgModule.prototype.addEvent = function () {
if (this.view.closeBtn) {
this.doEvents["closeBtn"] = this.addClick(this.view.closeBtn, this.onClick_closeBtn.bind(this));
}
};
MsgModule.prototype.onClick_closeBtn = function () {
this.enableMouseEvt(false);
this.hide();
};
MsgModule.prototype.removeEvent = function () {
this.enableMouseEvt(true);
if (this.view.closeBtn) {
this.view.closeBtn.onPointerUpObservable.remove(this.doEvents["closeBtn"]);
}
};
/**
* 更新提示文案
*/
MsgModule.prototype.updateMsgTxt = function (msgTxt) {
if (this.view.msgTxt) {
this.view.msgTxt.text = msgTxt;
}
};
/**
* 更新确定按钮文案
*/
MsgModule.prototype.updateSureBtnTxt = function (btnTxt) {
if (this.view.sureBtn) {
this.view.sureBtn.children[0].text = btnTxt;
}
};
/**
* 更新取消按钮文案
*/
MsgModule.prototype.updateCancelBtnTxt = function (btnTxt) {
if (this.view.cancelBtn) {
this.view.cancelBtn.children[0].text = btnTxt;
}
};
/**
* 更新页面
* @param args
*/
MsgModule.prototype.updateData = function (msgData) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
if (msgData.msg) {
this.updateMsgTxt(msgData.msg);
}
if (msgData.sureBtnTxt) {
this.updateSureBtnTxt(msgData.sureBtnTxt);
}
if (msgData.cancelBtnTxt) {
this.updateCancelBtnTxt(msgData.cancelBtnTxt);
}
};
return MsgModule;
}(PanelModule_1.PanelModule));
exports.MsgModule = MsgModule;
//# sourceMappingURL=MsgModule.js.map
\ No newline at end of file
{"version":3,"file":"MsgModule.js","sourceRoot":"","sources":["../../src/module/MsgModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA0C;AAC1C,qDAAkD;AAClD,qDAAkD;AAGlD;IAA+B,6BAAW;IAEtC;eACI,iBAAO;IACX,CAAC;IAEM,wBAAI,GAAX;QACI,yBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC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AC,CAAC,IAAI,GAAG,MAAM,CAAC;SACjD;IACL,CAAC;IAED;;;OAGG;IACI,8BAAU,GAAjB,UAAkB,OAAiB;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;QACxC,IAAG,OAAO,CAAC,GAAG,EAAC;YACX,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SAClC;QACD,IAAG,OAAO,CAAC,UAAU,EAAC;YAClB,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SAC7C;QACD,IAAG,OAAO,CAAC,YAAY,EAAC;YACpB,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;SACjD;IACL,CAAC;IACL,gBAAC;AAAD,CAAC,AA5ED,CAA+B,yBAAW,GA4EzC;AA5EY,8BAAS"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var tc_1 = require("tc");
var Module_1 = require("./Module");
var GuiManager_1 = require("../manager/GuiManager");
var PanelModule = /** @class */ (function (_super) {
__extends(PanelModule, _super);
function PanelModule() {
return _super !== null && _super.apply(this, arguments) || this;
}
PanelModule.prototype.updateData = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
};
PanelModule.prototype.addEvent = function () {
_super.prototype.addEvent.call(this);
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn);
}
};
/**
* 显示
*/
PanelModule.prototype.show = function () {
var _this = this;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
this.addEvent();
this.updateData.apply(this, args);
this.panelsAn.show(this.view.view, function () {
_this.onOpen();
}, function () {
_this.onOpened();
});
};
/**
* 隐藏
*/
PanelModule.prototype.hide = function () {
var _this = this;
this.removeEvent();
this.panelsAn.hide(this.view.view, function () {
_this.onClose();
}, function () {
_this.onClosed();
});
};
/**
* 打开前
* */
PanelModule.prototype.onOpen = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
GuiManager_1.GuiManager.ins.appendGui(this.parent);
};
/**
* 打开后
* */
PanelModule.prototype.onOpened = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
};
/**
* 关闭前
* */
PanelModule.prototype.onClose = function () {
};
/**
* 关闭后
* */
PanelModule.prototype.onClosed = function () {
this.removeEvent();
GuiManager_1.GuiManager.ins.removeGui(this.parent);
};
PanelModule.prototype.onClick_closeBtn = function (e) {
tc_1.GDispatcher.dispatchEvent(PanelModule.CLOSE_BTN_CLICK, "closeBtn");
this.removeEvent();
GuiManager_1.GuiManager.ins.removeGui(this.parent);
};
PanelModule.prototype.removeEvent = function () {
_super.prototype.removeEvent.call(this);
if (this.view.closeBtn) {
// this.removeClick(this.view.closeBtn);
}
};
/**
* 点击关闭按钮
*/
PanelModule.CLOSE_BTN_CLICK = 'closeBtnClick';
/**
* 点击确定按钮
*/
PanelModule.SURE_BTN_CLICK = 'sureBtnClick';
/**
* 点击取消按钮
*/
PanelModule.CANCEL_BTN_CLICK = 'cancelBtnClick';
return PanelModule;
}(Module_1.Module));
exports.PanelModule = PanelModule;
//# sourceMappingURL=PanelModule.js.map
\ No newline at end of file
{"version":3,"file":"PanelModule.js","sourceRoot":"","sources":["../../src/module/PanelModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAAiC;AACjC,mCAAkC;AAClC,oDAAiD;AAEjD;IAAiC,+BAAM;IAAvC;;IA+FA,CAAC;IA/EU,gCAA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,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;IAE1B,CAAC;IAGD;;SAEK;IACK,6BAAO,GAAjB;IAEA,CAAC;IAED;;SAEK;IACK,8BAAQ,GAAlB;QACI,IAAI,CAAC,WAAW,EAAE,CAAA;QAClB,uBAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAES,sCAAgB,GAA1B,UAA2B,CAAC;QACxB,gBAAW,CAAC,aAAa,CAAC,WAAW,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QACnE,IAAI,CAAC,WAAW,EAAE,CAAA;QAClB,uBAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAES,iCAAW,GAArB;QACI,iBAAM,WAAW,WAAE,CAAC;QACpB,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACrB,wCAAwC;SAC1C;IACL,CAAC;IA7FD;;OAEG;IACW,2BAAe,GAAG,eAAe,CAAC;IAEhD;;OAEG;IACW,0BAAc,GAAG,cAAc,CAAC;IAE9C;;OAEG;IACW,4BAAgB,GAAG,gBAAgB,CAAC;IAiFtD,kBAAC;CAAA,AA/FD,CAAiC,eAAM,GA+FtC;AA/FY,kCAAW"}
\ No newline at end of file
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Module_1 = require("./Module");
var DisplayPool_1 = require("../others/DisplayPool");
var YtModuleName_1 = require("../enum/YtModuleName");
/**
*Created by cuiliqiang on 2018/3/13
* 等待面板
*/
var WaitingModule = /** @class */ (function (_super) {
__extends(WaitingModule, _super);
function WaitingModule() {
return _super.call(this) || this;
}
/**
* 更新页面
* @param {string} msgTxt 提示信息
*/
WaitingModule.prototype.updateData = function (msgTxt) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
this.updateMsgTxt(msgTxt);
};
/**
* 更新提示文案
* @param desc
*/
WaitingModule.prototype.updateMsgTxt = function (msgTxt) {
if (this.view.msgTxt) {
this.view.msgTxt.text = msgTxt;
}
};
WaitingModule.prototype.init = function () {
DisplayPool_1.DisplayPool.ins.displayPool[YtModuleName_1.YtModuleName.WAITING_PANEL] = this;
};
return WaitingModule;
}(Module_1.Module));
exports.WaitingModule = WaitingModule;
//# sourceMappingURL=WaitingModule.js.map
\ No newline at end of file
{"version":3,"file":"WaitingModule.js","sourceRoot":"","sources":["../../src/module/WaitingModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAgC;AAChC,qDAAkD;AAClD,qDAAkD;AAClD;;;GAGG;AACH;IAAmC,iCAAM;IAMlC;eACI,iBAAO;IACX,CAAC;IAEA;;;OAGG;IACI,kCAAU,GAAjB,UAAkB,MAAc;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;QACrC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACO,oCAAY,GAAtB,UAAuB,MAAc;QACjC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;SAClC;IACL,CAAC;IAGK,4BAAI,GAAX;QACI,yBAAW,CAAC,GAAG,CAAC,WAAW,CAAC,2BAAY,CAAC,aAAa,CAAC,GAAC,IAAI,CAAC;IACjE,CAAC;IACR,oBAAC;AAAD,CAAC,AAhCD,CAAmC,eAAM,GAgCxC;AAhCY,sCAAa"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Created by clq on 2017/10/10.
*动画控制器
*/
var AnimationCon = /** @class */ (function () {
function AnimationCon() {
}
Object.defineProperty(AnimationCon, "ins", {
get: function () {
if (!this.instance) {
this.instance = new AnimationCon();
}
return this.instance;
},
enumerable: true,
configurable: true
});
AnimationCon.prototype.animationBody = function (object, scene) {
//动画模式
var _endattr;
//动画对象
var _mesh;
//动画属性
var _attr;
//动画速度
var _speed;
//动画帧
var _keys;
//动画结束回调函数
var _endCall;
//动画数据类型
var _typeData;
//动画数据类型
var _loop;
if (object.endattr != null) {
_endattr = object.endattr;
}
else {
_endattr = BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE;
}
if (object.mesh != null) {
_mesh = object.mesh;
}
else {
_mesh = null;
console.error("动画对象不能为空!");
}
if (object.attr != null) {
_attr = object.attr;
}
else {
_attr = null;
console.error("动画对象属性不能为空!");
}
if (object.speed != null) {
_speed = object.speed;
}
else {
_speed = 10;
}
if (object.keys != null) {
_keys = object.keys;
}
else {
_keys = [];
}
if (object.endCall != null) {
_endCall = object.endCall;
}
else {
_endCall = function () { };
}
if (object.typeData != null) {
_typeData = object.typedata;
}
else {
_typeData = BABYLON.Animation.ANIMATIONTYPE_FLOAT;
}
if (object.loop != null) {
_loop = object.loop;
}
else {
_loop = false;
}
var animationBox = new BABYLON.Animation("myAnimation", _attr, _speed, _typeData, _endattr);
var keys = [];
keys = _keys;
animationBox.setKeys(keys);
_mesh.animations.push(animationBox);
this.setbeginAnimation = scene.beginAnimation(_mesh, 0, _keys[_keys.length - 1].frame, _loop);
this.setbeginAnimation.onAnimationEnd = function () {
_endCall();
};
};
AnimationCon.prototype.Pause = function () {
this.setbeginAnimation.pause();
};
AnimationCon.prototype.Reset = function () {
this.setbeginAnimation.reset();
};
AnimationCon.prototype.Speed = function (i) {
this.setbeginAnimation.speedRatio = i;
};
return AnimationCon;
}());
exports.AnimationCon = AnimationCon;
//# sourceMappingURL=AnimationCon.js.map
\ No newline at end of file
{"version":3,"file":"AnimationCon.js","sourceRoot":"","sources":["../../src/others/AnimationCon.ts"],"names":[],"mappings":";;AAEA;;;GAGG;AACH;IAWI;IAAc,CAAC;IAPf,sBAAoB,mBAAG;aAAvB;YACI,IAAG,CAAC,IAAI,CAAC,QAAQ,EAAC;gBACd,IAAI,CAAC,QAAQ,GAAC,IAAI,YAAY,EAAE,CAAA;aACnC;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IAIM,oCAAa,GAApB,UAAqB,MAAM,EAAC,KAAK;QAC7B,MAAM;QACN,IAAI,QAAQ,CAAC;QAEb,MAAM;QACN,IAAI,KAAK,CAAC;QAEV,MAAM;QACN,IAAI,KAAK,CAAC;QAEV,MAAM;QACN,IAAI,MAAM,CAAC;QAEX,KAAK;QACL,IAAI,KAAK,CAAC;QAEV,UAAU;QACV,IAAI,QAAQ,CAAC;QAEb,QAAQ;QACR,IAAI,SAAS,CAAA;QAEb,QAAQ;QACR,IAAI,KAAK,CAAC;QAEV,IAAG,MAAM,CAAC,OAAO,IAAE,IAAI,EAAC;YACpB,QAAQ,GAAC,MAAM,CAAC,OAAO,CAAC;SAC3B;aAAI;YACD,QAAQ,GAAC,OAAO,CAAC,SAAS,CAAC,uBAAuB,CAAC;SACtD;QAED,IAAG,MAAM,CAAC,IAAI,IAAE,IAAI,EAAC;YACjB,KAAK,GAAC,MAAM,CAAC,IAAI,CAAC;SACrB;aAAK;YACF,KAAK,GAAC,IAAI,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;SAC7B;QAED,IAAG,MAAM,CAAC,IAAI,IAAE,IAAI,EAAC;YACjB,KAAK,GAAC,MAAM,CAAC,IAAI,CAAC;SACrB;aAAK;YACF,KAAK,GAAC,IAAI,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;SAC/B;QAED,IAAG,MAAM,CAAC,KAAK,IAAE,IAAI,EAAC;YAClB,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BAAK,GAAZ;QACI,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAA;IAClC,CAAC;IACM,4BAAK,GAAZ;QACI,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAA;IAClC,CAAC;IACM,4BAAK,GAAZ,UAAa,CAAC;QACV,IAAI,CAAC,iBAAiB,CAAC,UAAU,GAAC,CAAC,CAAA;IACvC,CAAC;IAEL,mBAAC;AAAD,CAAC,AA/GD,IA+GC;AA/GY,oCAAY"}
\ No newline at end of file
"use strict";
/**
* Created by clq on 2017/10/10.
* 弹框动画UI控制器
*/
Object.defineProperty(exports, "__esModule", { value: true });
var AnimationGui = /** @class */ (function () {
function AnimationGui(scene, advancedTexture) {
this.show = function (gui, open, opened) {
var keys = [];
keys.push({
frame: 0,
value: 0.1
});
keys.push({
frame: 10,
value: 1
});
var animationX = new BABYLON.Animation("", "scaleX", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
animationX.setKeys(keys);
var animationY = new BABYLON.Animation("", "scaleY", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
animationY.setKeys(keys);
gui.animations = [];
gui.animations.push(animationX, animationY);
this.advancedTexture.addControl(gui);
if (open) {
open();
}
this.scene.beginAnimation(gui, 0, 10, false, 2, function () {
if (opened) {
opened();
}
});
};
this.hide = function (gui, close, closed) {
var _this = this;
var keys = [];
keys.push({
frame: 0,
value: 1
});
keys.push({
frame: 10,
value: 0.1
});
var animationX = new BABYLON.Animation("", "scaleX", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
animationX.setKeys(keys);
var animationY = new BABYLON.Animation("", "scaleY", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
animationY.setKeys(keys);
gui.animations = [];
gui.animations.push(animationX, animationY);
if (close) {
close();
}
this.scene.beginAnimation(gui, 0, 10, false, 2, function () {
_this.advancedTexture.removeControl(gui);
//this.advancedTexture.dispose();
if (closed) {
closed();
}
});
};
this.scene = scene;
this.advancedTexture = advancedTexture;
}
return AnimationGui;
}());
exports.AnimationGui = AnimationGui;
//# sourceMappingURL=AnimationGui.js.map
\ No newline at end of file
{"version":3,"file":"AnimationGui.js","sourceRoot":"","sources":["../../src/others/AnimationGui.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH;IAMI,sBAAY,KAAK,EAAC,eAAe;QAK1B,SAAI,GAAG,UAAU,GAAG,EAAC,IAAK,EAAC,MAAO;YACrC,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,IAAI,CAAC,IAAI,CAAC;gBACN,KAAK,EAAE,CAAC;gBACR,KAAK,EAAE,GAAG;aACb,CAAC,CAAC;YACH,IAAI,CAAC,IAAI,CAAC;gBACN,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,CAAC;aACX,CAAC,CAAC;YACH,IAAI,UAAU,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC,mBAAmB,EAAE,OAAO,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;YAC3I,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,UAAU,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC,mBAAmB,EAAE,OAAO,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;YAC3I,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACzB,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC;YACpB,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAC,UAAU,CAAC,CAAC;YAC3C,IAAI,CAAC,eAAe,CAAC,UAAU,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,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAC,CAAC,EAAC;gBAC1C,KAAI,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;gBACxC,iCAAiC;gBACjC,IAAG,MAAM,EAAC;oBACN,MAAM,EAAE,CAAA;iBACX;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QAzDE,IAAI,CAAC,KAAK,GAAC,KAAK,CAAC;QACjB,IAAI,CAAC,eAAe,GAAC,eAAe,CAAA;IACxC,CAAC;IAyDL,mBAAC;AAAD,CAAC,AAlED,IAkEC;AAlEY,oCAAY"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var DisplayPool = /** @class */ (function () {
function DisplayPool() {
//场景名称
this.displayPool = {};
}
Object.defineProperty(DisplayPool, "ins", {
get: function () {
if (!this.instance) {
this.instance = new DisplayPool();
}
return this.instance;
},
enumerable: true,
configurable: true
});
return DisplayPool;
}());
exports.DisplayPool = DisplayPool;
//# sourceMappingURL=DisplayPool.js.map
\ No newline at end of file
{"version":3,"file":"DisplayPool.js","sourceRoot":"","sources":["../../src/others/DisplayPool.ts"],"names":[],"mappings":";;AAAA;IAAA;QASI,MAAM;QACC,gBAAW,GAAQ,EAAE,CAAC;IACjC,CAAC;IARG,sBAAkB,kBAAG;aAArB;YACI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;aACrC;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IAGL,kBAAC;AAAD,CAAC,AAXD,IAWC;AAXY,kCAAW"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* GUI控制器
* */
var GuiManager_1 = require("../manager/GuiManager");
var GuiCreate = /** @class */ (function () {
function GuiCreate() {
this.panelOut = new BABYLON.GUI.StackPanel();
}
Object.defineProperty(GuiCreate, "ins", {
get: function () {
if (!this.instance) {
this.instance = new GuiCreate();
}
return this.instance;
},
enumerable: true,
configurable: true
});
GuiCreate.prototype.createList = function (name, options, scaleUi) {
var _this = this;
var rectOut = new BABYLON.GUI.Rectangle();
rectOut.thickness = 0;
rectOut.isPointerBlocker = true;
rectOut.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
rectOut.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
for (var key in options) {
if (rectOut[key]) {
rectOut[key] = options[key];
}
}
// panelOut.height=1;
if (options && options.isVertical) {
this.panelOut.horizontalAlignment = 2;
this.panelOut.verticalAlignment = 0;
this.panelOut.isVertical = true;
var mouse = {
up: 0,
down: 0,
};
mouse.up = parseInt(this.panelOut.top.toString());
rectOut.onPointerDownObservable.add(function (e) {
mouse.down = e.y;
});
rectOut.onPointerUpObservable.add(function (e) {
var topY = parseInt(_this.panelOut.top.toString());
mouse.up = topY;
if (topY > 0) {
_this.panelOut.top = "0px";
mouse.up = 0;
}
else if (parseInt(_this.panelOut.top.toString()) < parseInt(rectOut.height.toString()) - parseInt(_this.panelOut.height.toString())) {
var l = (parseInt(rectOut.height.toString()) - parseInt(_this.panelOut.height.toString())) * scaleUi;
_this.panelOut.top = l.toString() + "px";
mouse.up = parseInt(_this.panelOut.top);
}
});
rectOut.onPointerMoveObservable.add(function (e) {
var m = e.y - mouse.down;
var mul = (mouse.up + m) * scaleUi;
_this.panelOut.top = mul.toString() + "px";
});
}
else {
this.panelOut.horizontalAlignment = 0;
this.panelOut.verticalAlignment = 2;
this.panelOut.isVertical = false;
var mouse = {
up: 0,
down: 0
};
mouse.up = parseInt(this.panelOut.left.toString());
rectOut.onPointerDownObservable.add(function (e) {
mouse.down = e.x;
});
rectOut.onPointerUpObservable.add(function (e) {
var leftY = parseInt(_this.panelOut.left.toString());
mouse.up = leftY;
if (leftY > 0) {
_this.panelOut.left = "0px";
mouse.up = 0;
}
else if (parseInt(_this.panelOut.left.toString()) < parseInt(rectOut.width.toString()) - parseInt(_this.panelOut.width.toString())) {
var l = (parseInt(rectOut.width.toString()) - parseInt(_this.panelOut.width.toString())) * scaleUi;
_this.panelOut.left = l.toString() + "px";
mouse.up = parseInt(_this.panelOut.left);
}
});
rectOut.onPointerMoveObservable.add(function (e) {
var m = e.x - mouse.down;
var mul = (mouse.up + m) * scaleUi;
this.panelOut.left = mul.toString() + "px";
});
}
rectOut.addControl(this.panelOut);
return rectOut;
};
GuiCreate.prototype.optionsListCon = function (config, data, listTemplate) {
var _this = this;
var scaleUi = GuiManager_1.GuiManager.ins.fullscreenUI.idealWidth / document.getElementById("renderCanvas").offsetWidth;
var prizeDatalist = this.createList("list", { width: config.bodyWidth, height: config.bodyHeight, top: config.bodyTop, left: config.bodyLeft, isVertical: config.isVertical }, scaleUi);
var _length = this.panelOut.children.length;
if (_length > 0) {
for (var i = 0; i < _length; i++) {
this.panelOut.removeControl(this.panelOut.children[0]);
}
}
data.forEach(function (_list) {
var list = listTemplate(config, _list);
_this.panelOut.addControl(list);
});
return prizeDatalist;
};
GuiCreate.prototype.preventDefault = function (Node) {
//最后一次y坐标点
var lastY;
Node.addEventListener('touchstart', function (event) {
lastY = event.touches[0].pageY;
});
Node.addEventListener('touchmove', function (event) {
var y = event.touches[0].pageY;
//滚动条高度
var st = Node.scrollTop;
console.log("st = " + st);
console.log(y);
console.log(lastY);
//如果滚动条高度小于0,可以理解为到顶了,且是下拉情况下,阻止touchmove事件。
if (y >= lastY && st <= 0) {
lastY = y;
event.preventDefault();
}
lastY = y;
});
};
return GuiCreate;
}());
exports.GuiCreate = GuiCreate;
//# sourceMappingURL=GuiCreate.js.map
\ No newline at end of file
{"version":3,"file":"GuiCreate.js","sourceRoot":"","sources":["../../src/others/GuiCreate.ts"],"names":[],"mappings":";;AAAA;;KAEK;AACL,oDAAiD;AAEjD;IAcI;QAXQ,aAAQ,GAAC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IAWhC,CAAC;I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vB,KAAK,GAAG,CAAC,CAAC;gBACV,KAAK,CAAC,cAAc,EAAE,CAAC;aAC1B;YACD,KAAK,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACR,CAAC;IAEJ,gBAAC;AAAD,CAAC,AAtID,IAsIC;AAtIY,8BAAS"}
\ No newline at end of file
"use strict";
/**
* Created by rjf on 2017/10/10.
* 粒子控制器
*/
Object.defineProperty(exports, "__esModule", { value: true });
var particleCon = /** @class */ (function () {
function particleCon(position, scene, particle) {
this.fountain = BABYLON.Mesh.CreateBox("fountain", 1.0, scene);
this.fountain.isPickable = false;
this.fountain.visibility = 0;
this.fountain.rotation.x = Math.PI * 0.9;
this.particleSystem = particle;
//定义发射器
this.particleSystem.emitter = this.fountain; // the starting object, the emitter, a box in this case.
this.particleSystem.stop();
this.fountain.position = position;
}
particleCon.prototype.start = function () {
this.particleSystem.start();
};
particleCon.prototype.stop = function () {
this.particleSystem.stop();
};
particleCon.prototype.Position = function (position) {
this.fountain.position = position;
};
particleCon.prototype.Parent = function (parent) {
this.fountain.parent = parent;
};
return particleCon;
}());
exports.particleCon = particleCon;
//# sourceMappingURL=particleCon.js.map
\ No newline at end of file
{"version":3,"file":"particleCon.js","sourceRoot":"","sources":["../../src/others/particleCon.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH;IAEI,qBAAY,QAAQ,EAAC,KAAK,EAAC,QAAQ;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAC/D,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAC,KAAK,CAAA;QAC9B,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAC,IAAI,CAAC,EAAE,GAAC,GAAG,CAAC;QACrC,IAAI,CAAC,cAAc,GAAC,QAAQ,CAAC;QAC7B,OAAO;QACP,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,wDAAwD;QACrG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAC,QAAQ,CAAC;IACpC,CAAC;IAMM,2BAAK,GAAZ;QACI,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC;IAEM,0BAAI,GAAX;QACI,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IACM,8BAAQ,GAAf,UAAgB,QAAQ;QACpB,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAC,QAAQ,CAAC;IACpC,CAAC;IAEM,4BAAM,GAAb,UAAc,MAAM;QAChB,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAC,MAAM,CAAC;IAChC,CAAC;IACL,kBAAC;AAAD,CAAC,AAhCD,IAgCC;AAhCY,kCAAW"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var YtLang = /** @class */ (function () {
function YtLang() {
}
YtLang.lang_001 = "请勿重复对同一对象添加点击事件";
YtLang.lang_002 = "单例模式,无法重复初始化";
YtLang.lang_003 = '已经有一个正在打开的模块';
YtLang.lang_004 = '加载中';
YtLang.lang_005 = '模块{0}未注册,无法访问方法:{1}';
YtLang.lang_006 = "上一个切换场景未执行完毕";
YtLang.lang_007 = 'container 不存在';
YtLang.lang_008 = 'child 不存在';
YtLang.lang_009 = '显示对象不存在';
YtLang.lang_010 = 'parent不存在';
YtLang.lang_011 = '确定';
YtLang.lang_012 = '取消';
return YtLang;
}());
exports.YtLang = YtLang;
//# sourceMappingURL=YtLang.js.map
\ No newline at end of file
{"version":3,"file":"YtLang.js","sourceRoot":"","sources":["../../src/util/YtLang.ts"],"names":[],"mappings":";;AAAA;IAAA;IAaA,CAAC;IAZiB,eAAQ,GAAG,iBAAiB,CAAC;IAC7B,eAAQ,GAAG,cAAc,CAAC;IAC1B,eAAQ,GAAG,cAAc,CAAC;IAC1B,eAAQ,GAAG,KAAK,CAAC;IACjB,eAAQ,GAAG,qBAAqB,CAAC;IACjC,eAAQ,GAAG,cAAc,CAAC;IAC1B,eAAQ,GAAG,eAAe,CAAC;IAC3B,eAAQ,GAAG,WAAW,CAAC;IACvB,eAAQ,GAAG,SAAS,CAAC;IACrB,eAAQ,GAAG,WAAW,CAAC;IACvB,eAAQ,GAAG,IAAI,CAAC;IAChB,eAAQ,GAAG,IAAI,CAAC;IAClC,aAAC;CAAA,AAbD,IAaC;AAbY,wBAAM"}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Type definitions for tween.js r12
// Project: https://github.com/sole/tween.js/
// Definitions by: sunetos <https://github.com/sunetos>, jzarnikov <https://github.com/jzarnikov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module TWEEN {
export var REVISION: string;
export function getAll(): Tween[];
export function removeAll(): void;
export function add(tween:Tween): void;
export function remove(tween:Tween): void;
export function update(time?:number): boolean;
export class Tween {
constructor(object?:any);
to(properties:any, duration:number): Tween;
start(time?:number): Tween;
stop(): Tween;
delay(amount:number): Tween;
easing(easing: (k: number) => number): Tween;
interpolation(interpolation: (v:number[], k:number) => number): Tween;
chain(...tweens:Tween[]): Tween;
onStart(callback: (object?: any) => void): Tween;
onUpdate(callback: (object?: any) => void): Tween;
onComplete(callback: (object?: any) => void): Tween;
update(time: number): boolean;
repeat(times: number): Tween;
yoyo(enable: boolean): Tween;
}
export var Easing: TweenEasing;
export var Interpolation: TweenInterpolation;
}
interface TweenEasing {
Linear: {
None(k:number): number;
};
Quadratic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Cubic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Quartic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Quintic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Sinusoidal: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Exponential: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Circular: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Elastic: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Back: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
Bounce: {
In(k:number): number;
Out(k:number): number;
InOut(k:number): number;
};
}
interface TweenInterpolation {
Linear(v:number[], k:number): number;
Bezier(v:number[], k:number): number;
CatmullRom(v:number[], k:number): number;
Utils: {
Linear(p0:number, p1:number, t:number): number;
Bernstein(n:number, i:number): number;
Factorial(n): number;
};
}
{
"name": "yt",
"version": "1.0.0",
"description": "基于Babylonjs的兑吧活动组件库",
"main": "./dist/index.js",
"types": "./types/index.d.ts",
"scripts": {
},
"author": "",
"license": "ISC",
"dependencies": {
"tc": "git+ssh://git@gitlab2.dui88.com:clq/tc.git#1.0"
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/13
*/
export enum YtModuleName {
//加载场景
LOADING_GUI = 'LoadingScene',
//等待面板
WAITING_PANEL = 'WaitingPanel',
//提示信息面板
MSG_PANEL = 'MsgPanel',
}
import {ResourceData} from "./interface/ResourceData";
import {fileData} from "./interface/fileData";
import {YtModuleName} from "./enum/YtModuleName";
import {YtLang} from "./util/YtLang";
import {AssetsManager} from "./manager/AssetsManager";
import {GuiManager} from "./manager/GuiManager";
import {SceneManager} from "./manager/SceneManager";
import {ModuleManager} from "./manager/ModuleManager";
import {AnimationCon} from "./others/AnimationCon";
import {AnimationGui} from "./others/AnimationGui";
import {particleCon} from "./others/particleCon";
import {GuiCreate} from "./others/GuiCreate";
import {Module} from "./module/Module";
import {DisplayPool} from "./others/DisplayPool";
import {MsgModule} from "./module/MsgModule"
import {LoadingModule} from "./module/LoadingModule";
import {WaitingModule} from "./module/WaitingModule";
import {PanelModule} from "./module/PanelModule";
export {
//UI创建和scene创建
Module,DisplayPool,MsgModule,LoadingModule,WaitingModule,PanelModule,
//other
AnimationCon,AnimationGui,particleCon,GuiCreate,
//接口
ResourceData,fileData,
//枚举
YtModuleName,
//工具
YtLang,
//管理器
AssetsManager,GuiManager,SceneManager,ModuleManager,
}
\ No newline at end of file
export interface IMsgData {
/**
* 展示文案
*/
msg?: string;
/**
* 确定文案
*/
sureBtnTxt?: string;
/**
* 取消文案
*/
cancelBtnTxt?: string;
}
\ No newline at end of file
import {fileData} from "./fileData";
export interface ResourceData {
/**
* 二进制文件
*/
binarys:Array<fileData>;
/**
* 图片文件
*/
images: Array<fileData>;
/**
* 模型文件
*/
models: Array<fileData>;
/**
* 贴图文件
*/
textures: Array<fileData>;
/**
* 环境天空盒子
*/
cubeTextures: Array<fileData>;
}
\ No newline at end of file
export interface fileData {
/**
* name
*/
name:string;
/**
* 文件路径
*/
filePath: string;
/**
* 文件名
*/
fileName: string;
}
\ No newline at end of file
//import {ResourceCon} from "../resource/resource";
export class AssetsManager {
private _resourceData;
private _resourceObject:object;
private static instance: AssetsManager;
public static get ins(): AssetsManager {
if (!this.instance) {
this.instance = new AssetsManager();
}
return this.instance;
}
constructor(){
//this._resourceData=ResourceCon.ins.resource;
this._resourceObject={
binarys:{},
images:{},
models:{},
textures:{},
cubeTextures:{}
}
}
public set resourceData(resource){
this._resourceData=resource;
}
public loadFile(sceneNames:Array<string>,scene,callback,progress){
let assetsManager = new BABYLON.AssetsManager(scene);
assetsManager.useDefaultLoadingScreen = false;
sceneNames.forEach(function(sceneName){
//加载模型
var _thisModel={}
this._resourceData[sceneName].models.forEach(function(model){
let meshTask = assetsManager.addMeshTask(
"skull task",
"",
model.filePath,
model.fileName
);
meshTask.onSuccess = function (task) {
console.log("meshTask")
console.log(task)
task.loadedMeshes.forEach(function(mesh){
mesh.isVisible=false;
mesh.name="noneisVisible_"+mesh;
})
let _thisMesh=task;
_thisModel[model.name]=_thisMesh
this._resourceObject.models[sceneName]=_thisModel;
}.bind(this)
}.bind(this))
//加载图片
var _thisImage={}
this._resourceData[sceneName].images.forEach(function(image){
let imageTask = assetsManager.addImageTask(
"image task",
image.filePath+image.fileName,
);
imageTask.onSuccess = function (task) {
_thisImage[image.name]=task.image
this._resourceObject.images[sceneName]=_thisImage;
}.bind(this)
}.bind(this))
//加载贴图
var _thisTexture={}
this._resourceData[sceneName].textures.forEach(function(texture){
let textureTask = assetsManager.addTextureTask(
"texture task",
texture.filePath+texture.fileName,
);
textureTask.onSuccess = function (task) {
_thisTexture[texture.name]=task.texture
this._resourceObject.textures[sceneName]=_thisTexture;
}.bind(this)
}.bind(this))
//加载二进制文件
var _thisBinary={}
this._resourceData[sceneName].binarys.forEach(function(binary){
let binaryTask = assetsManager.addBinaryFileTask(
"binary task",
binary.filePath+binary.fileName,
);
binaryTask.onSuccess = function (task) {
console.log(6666677)
console.log(task.data)
_thisBinary[binary.name]=task.data
_thisBinary[binary.name]["url"]=task.url
this._resourceObject.binarys[sceneName]=_thisBinary;
}.bind(this)
}.bind(this))
//加载天空盒子/环境贴图
var _thisCubeTexture={}
this._resourceData[sceneName].cubeTextures.forEach(function(cubeTexture){
let cubeTextureTask = assetsManager.addCubeTextureTask(
"cubeTexture task",
cubeTexture.filePath+cubeTexture.fileName,
);
cubeTextureTask.onSuccess = function (task) {
_thisCubeTexture[cubeTexture.name]=task.texture
this._resourceObject.cubeTextures[sceneName]=_thisCubeTexture;
}.bind(this)
}.bind(this))
}.bind(this))
assetsManager.load();
//加载成功一个子元素调用
assetsManager.onProgress=function(task) {
var _this={
totalTasksCount:assetsManager._totalTasksCount,
waitingTasksCount:assetsManager._waitingTasksCount,
loadCount:(assetsManager._totalTasksCount-assetsManager._waitingTasksCount)/assetsManager._totalTasksCount
}
progress(_this)
}.bind(this);
//全部加载成功调用
assetsManager.onFinish=function(task) {
callback()
}.bind(this);
}
public get resourceObject(){
return this._resourceObject;
}
}
\ No newline at end of file
// GUI
export class GuiManager {
private _fullscreenUI:any;
private _lastGui:any;
private guiPoll:any={};
private static instance: GuiManager;
public static get ins(): GuiManager {
if (!this.instance) {
this.instance = new GuiManager();
}
return this.instance;
}
constructor(){
this._lastGui=null;
this._fullscreenUI=BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("GUI");
this._fullscreenUI.idealWidth=750;
}
public changeGui(gui,...args){
var _length=this._fullscreenUI.rootContainer.children.length
for(var i=0;i<_length;i++){
this._fullscreenUI.removeControl(this._fullscreenUI.rootContainer.children[0])
}
this._fullscreenUI.addControl(gui)
this._lastGui=gui
}
public appendGui(gui,...args){
this._fullscreenUI.addControl(gui)
this._lastGui=gui
}
public removeGui(gui,...args){
this._fullscreenUI.removeControl(this._lastGui)
}
public removeAll(gui,...args){
var _length=this._fullscreenUI.rootContainer.children.length
for(var i=0;i<_length;i++){
this._fullscreenUI.removeControl(this._fullscreenUI.rootContainer.children[0])
}
}
public openPanel(gui){
}
public closePanel(gui){
}
public get fullscreenUI(){
return this._fullscreenUI;
}
public get lastGui(){
return this._lastGui;
}
}
/**
*Created by renjianfeng on 2018/2/28
*/
import {DisplayPool} from "../others/DisplayPool";
import {YtLang} from "../util/YtLang";
import { IMsgData } from './../interface/IMsgData';
import { IModuleData, GConsole, ModuleType, GFun, GDispatcher, ABNetManager } from "tc";
import {YtModuleName} from "../enum/YtModuleName";
export class ModuleManager {
//管理器单例
private static instance: ModuleManager;
public static get ins(): ModuleManager {
if (!this.instance) {
this.instance = new ModuleManager();
}
return this.instance;
}
/**
* 模块列表
*/
private moduleList: IModuleData[] = [];
/**
* 打开一个模块
* @param {ModuleName} moduleName
*/
public openModule(moduleName:string, ...args): void {
console.log(moduleName)
console.log( DisplayPool.ins.displayPool[moduleName])
DisplayPool.ins.displayPool[moduleName].show(...args)
}
/**
* 按模块名获取模块数据
* @param {string} moduleName 模块名
* @returns {ModuleData}
*/
public getModule(moduleName: string) {
if(DisplayPool.ins.displayPool[moduleName]){
return moduleName
}else{
return false;
}
//return this.moduleList[moduleName];
}
/**
* 关闭一个模块
* @param {ModuleName} moduleName
*/
public closeModule(moduleName:string, ...args): void {
console.log(moduleName)
console.log( DisplayPool.ins.displayPool[moduleName])
DisplayPool.ins.displayPool[moduleName].hide(...args)
}
/**
* 提示模块
*/
private msgModule: IModuleData;
/**
* 初始化
*/
public init(): void {
GDispatcher.addEvent(ABNetManager.ERROR, (msg: string) => {
// alert()
console.log("msg")
const msgData: IMsgData = {
msg: msg,
sureBtnTxt: YtLang.lang_011,
cancelBtnTxt: YtLang.lang_012
};
console.log(msgData)
this.openMsgModule(msgData);
}, this);
}
/**
* 打开提示模块
* @param msgData
*/
public openMsgModule(msgData: IMsgData): void {
this.openModule(YtModuleName.MSG_PANEL,msgData);
}
}
\ No newline at end of file
export class SceneManager{
public stage;
private _scene:BABYLON.Scene;
private _canvas;
private _engine;
private static instance: SceneManager;
public static get ins(): SceneManager {
if (!this.instance) {
this.instance = new SceneManager();
}
return this.instance;
}
constructor(){
this._canvas = document.querySelector("#renderCanvas");
this._engine = new BABYLON.Engine(this._canvas, true);
var createScene=function(){
{
var scene = new BABYLON.Scene(this._engine);
//下面的代码是为了设置微信上面的touch事件兼容
var n = scene._onPointerUp
, o = scene._onPointerDown
, r = scene._onPointerMove
, a = BABYLON.Tools.GetPointerPrefix();
this._canvas.removeEventListener(a + "move", r),
this._canvas.removeEventListener(a + "down", o),
window.removeEventListener(a + "up", n),
scene._onPointerUp = function(e) {
void 0 !== e.pointerId && n(e)
}
,
scene._onPointerDown = function(e) {
void 0 !== e.pointerId && o(e)
}
,
scene._onPointerMove = function(e) {
void 0 !== e.pointerId && r(e)
}
,
this._canvas.addEventListener(a + "move", scene._onPointerMove, !1),
this._canvas.addEventListener(a + "down", scene._onPointerDown, !1),
window.addEventListener(a + "up", scene._onPointerUp, !1);
//下面的代码是为了设置微信上面的touch事件兼容
var camera = new BABYLON.FreeCamera("baseCamera", new BABYLON.Vector3(0, 0, 0), scene);
this._engine.setHardwareScalingLevel(0.6)
return scene;
}
}.bind(this)
this._scene = createScene();
this._engine.runRenderLoop(function () {
this._scene.render();
TWEEN.update();
}.bind(this));
window.addEventListener("resize", function() {
this._engine.resize();
}.bind(this));
}
/* public get stage(): any {
return this._stage;
}*/
public get scene(): BABYLON.Scene {
return this._scene;
}
public get canvas(): any {
return this._canvas;
}
public get engine(): any {
return this._engine;
}
public change(display){
/* console.log(display)
var i;
for(i in display){
console.log(display[i])
}*/
for(var l of SceneManager.ins.scene.meshes){
l.dispose()
}
/*var j;
for(j in SceneManager.ins.stage){
console.log(SceneManager.ins.stage[j])
if( SceneManager.ins.stage[j]){
if(SceneManager.ins.stage[j].getChildMeshes){
SceneManager.ins.stage[j].getChildMeshes(false,(child)=>{
child.dispose();
});
}
if( SceneManager.ins.stage[j].dispose){
SceneManager.ins.stage[j].dispose()
}
}
}*/
SceneManager.ins.stage=display;
}
/* public change(module){
// console.log(this._stage._children)
if(this.stage._children){
this.stage._children.forEach(function (child) {
this.stage.removeChild(child)
child.dispose()
}.bind(this))
}
this.stage.addChild(module)
// console.log( this._scene)
}*/
}
\ No newline at end of file
import {Module} from "./Module";
import {DisplayPool} from "../others/DisplayPool";
import {YtModuleName} from "../enum/YtModuleName";
export class LoadingModule extends Module {
/**
* 最大进度值
*/
protected maxProgress: number;
constructor(){
super()
}
public init(){
DisplayPool.ins.displayPool[YtModuleName.LOADING_GUI]=this;
}
/**
* 更新页面
* @param {number} max 最大进度值
*/
public updateData(max: number): void {
this.maxProgress = max;
}
public onProgress(curr: number): void {
const pre: number = parseInt((curr*100).toString()) ;
if (this.view.progressTxt) {
this.view.progressTxt.text = pre + '%';
}
}
}
\ No newline at end of file
import {AnimationGui} from "../others/AnimationGui";
import {SceneManager} from "../manager/SceneManager";
import { YtLang } from '../util/YtLang';
/**
*Created by cuiliqiang on 2018/3/1
* 组件基类
*/
import {GuiManager} from "../manager/GuiManager";
export class Module {
private timeoutId;
protected view:any;
protected parent:any;
//事件
protected doEvents=[];
//面板隐藏显示实例
protected panelsAn=new AnimationGui(SceneManager.ins.scene,GuiManager.ins.fullscreenUI)
//规则元素
protected section: any;
/**
* 显示对象(皮肤)
*/
protected display: any;
/**
* 是否初始化完成
*/
protected isInit: boolean;
/**
* 点击事件回调池
*/
private clickCallbackBindPool: any;
constructor() {
this.initModel();
this.clickCallbackBindPool = {};
// var skinClass: any = eval(this.module.skinName);
// this.display = new skinClass();
// this.clickCallbackPool = {};
}
/**
* 初始化数据
*/
protected initModel(): void {
}
/**
* 初始化UI
*/
protected initUI(): void {
}
/**
* 显示
*/
protected show(...args): void {
this.removeEvent();
this.updateData(...args)
this.addEvent();
GuiManager.ins.changeGui(this.parent);
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
GuiManager.ins.removeGui(this.parent);
}
/**
* 添加事件
*/
protected addEvent(): void {
}
/**
* 移除事件
*/
protected removeEvent(): void {
}
/**
* 更新页面
* @param args
*/
public updateData(...args): void {
if (!this.isInit) {
this.initUI();
this.isInit = true;
}
}
/**
* 添加点击事件
* @param display
*
* @param callback
*/
protected addClick(display: any, callback: Function) {
this.doEvents[display.name] = display.onPointerUpObservable.add(callback);
}
/**
* 移除点击事件
* @param display
* @param callback
*/
protected removeClick(display: any): void {
display.onPointerUpObservable.remove(this.doEvents[display.name]);
}
/**
* 延时启用点击事件
* @param display 显示对象
* @param {number} delay 延时事件
*/
protected delayEnable(display: any, delay?: number): void {
display.mouseEnable = display.mouseChildren = false;
//如果已经禁用事件重新计算
if (this.timeoutId) {
clearTimeout(this.timeoutId);
}
this.timeoutId = setTimeout(function () {
this.timeoutId = 0;
display.mouseEnable = display.mouseChildren = true;
}, delay ? delay : 500);
}
public dispose(): void {
}
/**
* 鼠标事件
* @param enable
*/
protected enableMouseEvt(enable: boolean): void {
let viewList
for(viewList in this.view){
// console.log(viewList)
if(this.view[viewList]["mouseEnable"]==1||this.view[viewList]["mouseEnable"]==undefined){
this.view[viewList].isHitTestVisible=enable;
}
}
}
/**
* 单个元件鼠标事件
* @param enable
*/
protected enableMouseEvtView(view:BABYLON.GUI.Control,enable: boolean): void {
view.isHitTestVisible=enable;
if(enable==true){
view["mouseEnable"]=1;
}else{
view["mouseEnable"]=2;
}
}
}
\ No newline at end of file
import {PanelModule} from "./PanelModule";
import {DisplayPool} from "../others/DisplayPool";
import {YtModuleName} from "../enum/YtModuleName";
import { IMsgData } from '../interface/IMsgData';
export class MsgModule extends PanelModule {
constructor(){
super()
}
public init(){
DisplayPool.ins.displayPool[YtModuleName.MSG_PANEL]=this;
}
/**
* 添加事件
* */
protected addEvent(){
if(this.view.closeBtn){
this.doEvents["closeBtn"]=this.addClick(this.view.closeBtn,this.onClick_closeBtn.bind(this))
}
}
protected onClick_closeBtn():void{
this.enableMouseEvt(false)
this.hide();
}
protected removeEvent(){
this.enableMouseEvt(true)
if(this.view.closeBtn){
this.view.closeBtn.onPointerUpObservable.remove(this.doEvents["closeBtn"])
}
}
/**
* 更新提示文案
*/
protected updateMsgTxt(msgTxt: string): void {
if (this.view.msgTxt) {
this.view.msgTxt.text = msgTxt;
}
}
/**
* 更新确定按钮文案
*/
protected updateSureBtnTxt(btnTxt: string): void {
if (this.view.sureBtn) {
this.view.sureBtn.children[0].text = btnTxt;
}
}
/**
* 更新取消按钮文案
*/
protected updateCancelBtnTxt(btnTxt: string): void {
if (this.view.cancelBtn) {
this.view.cancelBtn.children[0].text = btnTxt;
}
}
/**
* 更新页面
* @param args
*/
public updateData(msgData: IMsgData, ...args): void {
if(msgData.msg){
this.updateMsgTxt(msgData.msg);
}
if(msgData.sureBtnTxt){
this.updateSureBtnTxt(msgData.sureBtnTxt);
}
if(msgData.cancelBtnTxt){
this.updateCancelBtnTxt(msgData.cancelBtnTxt);
}
}
}
\ No newline at end of file
import { GDispatcher } from "tc";
import { Module } from "./Module";
import {GuiManager} from "../manager/GuiManager";
export class PanelModule extends Module {
/**
* 点击关闭按钮
*/
public static CLOSE_BTN_CLICK = 'closeBtnClick';
/**
* 点击确定按钮
*/
public static SURE_BTN_CLICK = 'sureBtnClick';
/**
* 点击取消按钮
*/
public static CANCEL_BTN_CLICK = 'cancelBtnClick';
public updateData(...args): void {
}
protected addEvent(): void {
super.addEvent();
if (this.view.closeBtn) {
this.addClick(this.view.closeBtn, this.onClick_closeBtn);
}
}
/**
* 显示
*/
protected show(...args): void {
this.addEvent();
this.updateData(...args)
this.panelsAn.show(this.view.view,()=>{
this.onOpen()
},()=>{
this.onOpened()
})
}
/**
* 隐藏
*/
protected hide(): void {
this.removeEvent();
this.panelsAn.hide(this.view.view,()=>{
this.onClose()
},()=>{
this.onClosed()
})
}
/**
* 打开前
* */
protected onOpen(...args): void{
GuiManager.ins.appendGui(this.parent);
}
/**
* 打开后
* */
protected onOpened(...args): void{
}
/**
* 关闭前
* */
protected onClose(){
}
/**
* 关闭后
* */
protected onClosed(){
this.removeEvent()
GuiManager.ins.removeGui(this.parent);
}
protected onClick_closeBtn(e): void {
GDispatcher.dispatchEvent(PanelModule.CLOSE_BTN_CLICK, "closeBtn");
this.removeEvent()
GuiManager.ins.removeGui(this.parent);
}
protected removeEvent(): void {
super.removeEvent();
if (this.view.closeBtn) {
// this.removeClick(this.view.closeBtn);
}
}
}
\ No newline at end of file
import {Module} from "./Module";
import {DisplayPool} from "../others/DisplayPool";
import {YtModuleName} from "../enum/YtModuleName";
/**
*Created by cuiliqiang on 2018/3/13
* 等待面板
*/
export class WaitingModule extends Module {
/**
* 最大进度值
*/
protected maxProgress: number;
constructor(){
super()
}
/**
* 更新页面
* @param {string} msgTxt 提示信息
*/
public updateData(msgTxt: string, ...args): void {
this.updateMsgTxt(msgTxt);
}
/**
* 更新提示文案
* @param desc
*/
protected updateMsgTxt(msgTxt: string): void {
if (this.view.msgTxt) {
this.view.msgTxt.text = msgTxt;
}
}
public init(){
DisplayPool.ins.displayPool[YtModuleName.WAITING_PANEL]=this;
}
}
\ No newline at end of file
import {GuiCreate} from "./GuiCreate";
/**
* Created by clq on 2017/10/10.
*动画控制器
*/
export class AnimationCon {
private static instance: AnimationCon;
private setbeginAnimation;
public static get ins():AnimationCon{
if(!this.instance){
this.instance=new AnimationCon()
}
return this.instance;
}
constructor(){}
public animationBody(object,scene){
//动画模式
var _endattr;
//动画对象
var _mesh;
//动画属性
var _attr;
//动画速度
var _speed;
//动画帧
var _keys;
//动画结束回调函数
var _endCall;
//动画数据类型
var _typeData
//动画数据类型
var _loop;
if(object.endattr!=null){
_endattr=object.endattr;
}else{
_endattr=BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE;
}
if(object.mesh!=null){
_mesh=object.mesh;
}else {
_mesh=null;
console.error("动画对象不能为空!")
}
if(object.attr!=null){
_attr=object.attr;
}else {
_attr=null;
console.error("动画对象属性不能为空!")
}
if(object.speed!=null){
_speed=object.speed;
}else {
_speed=10;
}
if(object.keys!=null){
_keys=object.keys;
}else {
_keys=[];
}
if(object.endCall!=null){
_endCall=object.endCall
}else{
_endCall=function(){}
}
if(object.typeData!=null){
_typeData=object.typedata
}else{
_typeData=BABYLON.Animation.ANIMATIONTYPE_FLOAT
}
if(object.loop!=null){
_loop=object.loop
}else{
_loop=false;
}
var animationBox = new BABYLON.Animation("myAnimation", _attr, _speed, _typeData, _endattr);
var keys = [];
keys=_keys
animationBox.setKeys(keys);
_mesh.animations.push(animationBox);
this.setbeginAnimation=scene.beginAnimation(_mesh, 0, _keys[_keys.length-1].frame, _loop);
this.setbeginAnimation.onAnimationEnd=function(){
_endCall()
}
}
public Pause(){
this.setbeginAnimation.pause()
}
public Reset(){
this.setbeginAnimation.reset()
}
public Speed(i){
this.setbeginAnimation.speedRatio=i
}
}
/**
* Created by clq on 2017/10/10.
* 弹框动画UI控制器
*/
export class AnimationGui {
private static instance: AnimationGui;
protected scene;
protected advancedTexture;
constructor(scene,advancedTexture){
this.scene=scene;
this.advancedTexture=advancedTexture
}
public show = function (gui,open?,opened?) {
var keys = [];
keys.push({
frame: 0,
value: 0.1
});
keys.push({
frame: 10,
value: 1
});
var animationX = new BABYLON.Animation("", "scaleX", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
animationX.setKeys(keys);
var animationY = new BABYLON.Animation("", "scaleY", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
animationY.setKeys(keys);
gui.animations = [];
gui.animations.push(animationX,animationY);
this.advancedTexture.addControl(gui);
if(open){
open()
}
this.scene.beginAnimation(gui, 0, 10, false,2,()=>{
if(opened){
opened()
}
});
};
public hide = function(gui,close?,closed?){
var keys = [];
keys.push({
frame: 0,
value: 1
});
keys.push({
frame: 10,
value: 0.1
});
var animationX = new BABYLON.Animation("", "scaleX", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
animationX.setKeys(keys);
var animationY = new BABYLON.Animation("", "scaleY", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
animationY.setKeys(keys);
gui.animations = [];
gui.animations.push(animationX,animationY);
if(close){
close()
}
this.scene.beginAnimation(gui, 0, 10, false,2,()=>{
this.advancedTexture.removeControl(gui);
//this.advancedTexture.dispose();
if(closed){
closed()
}
});
};
}
export class DisplayPool{
private static instance: DisplayPool;
public static get ins(): DisplayPool {
if (!this.instance) {
this.instance = new DisplayPool();
}
return this.instance;
}
//场景名称
public displayPool: any = {};
}
\ No newline at end of file
/**
* GUI控制器
* */
import {GuiManager} from "../manager/GuiManager";
export class GuiCreate{
private panelOut=new BABYLON.GUI.StackPanel();
private static instance: GuiCreate;
public static get ins():GuiCreate{
if(!this.instance){
this.instance=new GuiCreate()
}
return this.instance;
}
constructor(){}
public createList(name,options,scaleUi){
var rectOut=new BABYLON.GUI.Rectangle();
rectOut.thickness=0;
rectOut.isPointerBlocker=true;
rectOut.verticalAlignment=BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
rectOut.horizontalAlignment=BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
for (var key in options) {
if(rectOut[key]){
rectOut[key] = options[key];
}
}
// panelOut.height=1;
if(options&&options.isVertical){
this.panelOut.horizontalAlignment=2;
this.panelOut.verticalAlignment=0;
this.panelOut.isVertical =true;
var mouse={
up:0,
down:0,
};
mouse.up=parseInt(this.panelOut.top.toString());
rectOut.onPointerDownObservable.add(function(e){
mouse.down= e.y;
});
rectOut.onPointerUpObservable.add((e)=>{
var topY=parseInt(this.panelOut.top.toString());
mouse.up=topY;
if(topY>0){
this.panelOut.top="0px";
mouse.up= 0;
}
else if(parseInt(this.panelOut.top.toString())<parseInt(rectOut.height.toString())-parseInt(this.panelOut.height.toString())){
var l=(parseInt(rectOut.height.toString())-parseInt(this.panelOut.height.toString()))*scaleUi;
this.panelOut.top=l.toString()+"px";
mouse.up= parseInt(this.panelOut.top);
}
});
rectOut.onPointerMoveObservable.add((e)=>{
var m=e.y-mouse.down;
var mul=(mouse.up+m)*scaleUi;
this.panelOut.top= mul.toString()+"px";
});
}else {
this.panelOut.horizontalAlignment=0;
this.panelOut.verticalAlignment=2;
this.panelOut.isVertical =false;
var mouse={
up:0,
down:0
};
mouse.up=parseInt(this.panelOut.left.toString());
rectOut.onPointerDownObservable.add((e)=>{
mouse.down= e.x;
});
rectOut.onPointerUpObservable.add((e)=>{
var leftY=parseInt(this.panelOut.left.toString());
mouse.up=leftY;
if(leftY>0){
this.panelOut.left="0px";
mouse.up= 0;
}
else if(parseInt(this.panelOut.left.toString())<parseInt(rectOut.width.toString())-parseInt(this.panelOut.width.toString())){
var l=(parseInt(rectOut.width.toString())-parseInt(this.panelOut.width.toString()))*scaleUi;
this.panelOut.left=l.toString()+"px";
mouse.up= parseInt(this.panelOut.left);
}
});
rectOut.onPointerMoveObservable.add(function(e){
var m=e.x-mouse.down;
var mul=(mouse.up+m)*scaleUi;
this.panelOut.left= mul.toString()+"px";
});
}
rectOut.addControl(this.panelOut);
return rectOut
}
public optionsListCon(config,data,listTemplate){
var scaleUi=GuiManager.ins.fullscreenUI.idealWidth/document.getElementById("renderCanvas").offsetWidth;
var prizeDatalist=this.createList("list",{width:config.bodyWidth,height:config.bodyHeight,top:config.bodyTop,left:config.bodyLeft,isVertical:config.isVertical},scaleUi);
var _length=this.panelOut.children.length
if(_length>0){
for(var i=0;i<_length;i++){
this.panelOut.removeControl(this.panelOut.children[0])
}
}
data.forEach((_list)=>{
var list=listTemplate(config,_list)
this.panelOut.addControl(list)
})
return prizeDatalist
}
public preventDefault(Node){
//最后一次y坐标点
var lastY;
Node.addEventListener('touchstart', (event)=> {
lastY = event.touches[0].pageY;
});
Node.addEventListener('touchmove', (event)=> {
var y = event.touches[0].pageY;
//滚动条高度
var st = Node.scrollTop;
console.log("st = "+st);
console.log(y)
console.log(lastY)
//如果滚动条高度小于0,可以理解为到顶了,且是下拉情况下,阻止touchmove事件。
if (y >= lastY && st <= 0) {
lastY = y;
event.preventDefault();
}
lastY = y;
});
}
}
\ No newline at end of file
/**
* Created by rjf on 2017/10/10.
* 粒子控制器
*/
export class particleCon {
private static instance: particleCon;
constructor(position,scene,particle){
this.fountain = BABYLON.Mesh.CreateBox("fountain", 1.0, scene);
this.fountain.isPickable=false
this.fountain.visibility=0;
this.fountain.rotation.x=Math.PI*0.9;
this.particleSystem=particle;
//定义发射器
this.particleSystem.emitter = this.fountain; // the starting object, the emitter, a box in this case.
this.particleSystem.stop();
this.fountain.position=position;
}
private particleSystem;
private fountain;
public start(){
this.particleSystem.start();
}
public stop(){
this.particleSystem.stop();
}
public Position(position){
this.fountain.position=position;
}
public Parent(parent){
this.fountain.parent=parent;
}
}
export class YtLang {
public static lang_001 = "请勿重复对同一对象添加点击事件";
public static lang_002 = "单例模式,无法重复初始化";
public static lang_003 = '已经有一个正在打开的模块';
public static lang_004 = '加载中';
public static lang_005 = '模块{0}未注册,无法访问方法:{1}';
public static lang_006 = "上一个切换场景未执行完毕";
public static lang_007 = 'container 不存在';
public static lang_008 = 'child 不存在';
public static lang_009 = '显示对象不存在';
public static lang_010 = 'parent不存在';
public static lang_011 = '确定';
public static lang_012 = '取消';
}
\ No newline at end of file
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"noImplicitAny": false,
"noEmitOnError": true,
"declarationDir": "./types",
"declaration": true,
"outDir": "./dist",
"skipLibCheck": true
},
"exclude": [
"node_modules",
"dist",
"types"
]
}
\ No newline at end of file
exports.__esModule = true;
exports.rules = {
"only-arrow-functions": true,
"no-namespace": true,
"no-var-keyword": true,
"prefer-const": true,
"no-conditional-assignment": true,
"prefer-for-of": true,
"no-inferrable-types": true,
"cyclomatic-complexity": [true, 20],
"max-line-length": [true, 150],
"max-file-line-count": [true, 500],
"max-classes-per-file": [true, 6],
"adjacent-overload-signatures": true,
"member-access":true,
"no-non-null-assertion": true,
"no-consecutive-blank-lines": true,
"no-unused-expression": [true, "allow-fast-null-checks"],
"no-duplicate-super": true,
"no-import-side-effect": true
};
\ No newline at end of file
{
"defaultSeverity": "error",
"extends": [
// "tslint:recommended"
"./tslint-config"
],
"jsRules": {},
"rules": {},
"rulesDirectory": []
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/13
*/
export declare enum YtModuleName {
LOADING_GUI = "LoadingScene",
WAITING_PANEL = "WaitingPanel",
MSG_PANEL = "MsgPanel",
}
import { ResourceData } from "./interface/ResourceData";
import { fileData } from "./interface/fileData";
import { YtModuleName } from "./enum/YtModuleName";
import { YtLang } from "./util/YtLang";
import { AssetsManager } from "./manager/AssetsManager";
import { GuiManager } from "./manager/GuiManager";
import { SceneManager } from "./manager/SceneManager";
import { ModuleManager } from "./manager/ModuleManager";
import { AnimationCon } from "./others/AnimationCon";
import { AnimationGui } from "./others/AnimationGui";
import { particleCon } from "./others/particleCon";
import { GuiCreate } from "./others/GuiCreate";
import { Module } from "./module/Module";
import { DisplayPool } from "./others/DisplayPool";
import { MsgModule } from "./module/MsgModule";
import { LoadingModule } from "./module/LoadingModule";
import { WaitingModule } from "./module/WaitingModule";
import { PanelModule } from "./module/PanelModule";
export { Module, DisplayPool, MsgModule, LoadingModule, WaitingModule, PanelModule, AnimationCon, AnimationGui, particleCon, GuiCreate, ResourceData, fileData, YtModuleName, YtLang, AssetsManager, GuiManager, SceneManager, ModuleManager };
export interface IMsgData {
/**
* 展示文案
*/
msg?: string;
/**
* 确定文案
*/
sureBtnTxt?: string;
/**
* 取消文案
*/
cancelBtnTxt?: string;
}
import { fileData } from "./fileData";
export interface ResourceData {
/**
* 二进制文件
*/
binarys: Array<fileData>;
/**
* 图片文件
*/
images: Array<fileData>;
/**
* 模型文件
*/
models: Array<fileData>;
/**
* 贴图文件
*/
textures: Array<fileData>;
/**
* 环境天空盒子
*/
cubeTextures: Array<fileData>;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
export declare class DisplayPool {
private static instance;
static readonly ins: DisplayPool;
displayPool: any;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment