12345678 |
- {
- "code": "import MainGameView from \"./MainGameView\";\r\nimport InGameView from \"./InGameView\";\r\nexport var ViewType;\r\n(function (ViewType) {\r\n ViewType[ViewType[\"MainView\"] = 0] = \"MainView\";\r\n ViewType[ViewType[\"IngameView\"] = 1] = \"IngameView\";\r\n})(ViewType || (ViewType = {}));\r\n;\r\nexport class ViewManager {\r\n constructor() {\r\n this.showexportview = 0;\r\n this.popViewDic = [];\r\n this.ViewSprite = new Laya.Sprite();\r\n this.OtherViewSprite = new Laya.Sprite();\r\n ViewManager.ins = this;\r\n Laya.stage.addChild(this.ViewSprite);\r\n Laya.stage.addChild(this.OtherViewSprite);\r\n }\r\n static get Instance() {\r\n if (ViewManager.ins) {\r\n return ViewManager.ins;\r\n }\r\n else {\r\n return new ViewManager();\r\n }\r\n }\r\n ShowView(_viewtype, data = null) {\r\n if (this.curView != null) {\r\n this.curView.Close();\r\n this.curView.destroy();\r\n this.curView.removeSelf();\r\n }\r\n this.curView = this.CreateView(_viewtype);\r\n this.curView.name = ViewType[_viewtype];\r\n this.ViewSprite.addChild(this.curView);\r\n this.curView.Show(data);\r\n }\r\n CloseView() {\r\n if (this.curView != null) {\r\n this.curView.Close();\r\n this.curView.destroy();\r\n this.curView.removeSelf();\r\n }\r\n }\r\n OpenPopView(viewType, data = null) {\r\n var popView;\r\n if (this.popViewDic[viewType]) {\r\n popView = this.popViewDic[viewType];\r\n this.OtherViewSprite.setChildIndex(popView, this.OtherViewSprite.numChildren - 1);\r\n popView.visible = true;\r\n }\r\n else {\r\n popView = this.CreateView(viewType);\r\n this.OtherViewSprite.addChild(popView);\r\n this.popViewDic[viewType] = popView;\r\n }\r\n this.showexportview = 1;\r\n popView.OnOpen(data);\r\n }\r\n ClosePopView(viewType) {\r\n var popView = this.popViewDic[viewType];\r\n if (popView == null) {\r\n return;\r\n }\r\n popView.OnHide();\r\n popView.visible = false;\r\n this.showexportview = 0;\r\n }\r\n ClearPopViews() {\r\n }\r\n CreateView(_viewtype) {\r\n switch (_viewtype) {\r\n case ViewType.MainView:\r\n return new MainGameView();\r\n case ViewType.IngameView:\r\n return new InGameView();\r\n }\r\n return null;\r\n }\r\n}\r\n",
- "references": [
- "E:/LayaProject/ArcherWorrior/src/View/MainGameView.ts",
- "E:/LayaProject/ArcherWorrior/src/View/InGameView.ts"
- ]
- }
|