init
This commit is contained in:
parent
9e1729ea5e
commit
ed25fa5401
51
.gitignore
vendored
Normal file
51
.gitignore
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# Fireball Projects
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/library/
|
||||
/temp/
|
||||
/local/
|
||||
/build/
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# npm files
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
npm-debug.log
|
||||
node_modules/
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# Logs and databases
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
*.log
|
||||
*.sql
|
||||
*.sqlite
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# files for debugger
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
*.sln
|
||||
*.pidb
|
||||
*.suo
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# OS generated files
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
.DS_Store
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
# WebStorm files
|
||||
#/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
.idea/
|
||||
|
||||
#//////////////////////////
|
||||
# VS Code files
|
||||
#//////////////////////////
|
||||
|
||||
.vscode/
|
||||
21
.templates/.editorconfig
Normal file
21
.templates/.editorconfig
Normal file
@ -0,0 +1,21 @@
|
||||
# @see https://editorconfig-specification.readthedocs.io/en/latest/
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
|
||||
# 4 space indentation
|
||||
[*.py]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# Tab indentation (no size specified)
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
29
.templates/.gitignore
vendored
Normal file
29
.templates/.gitignore
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
# @see https://git-scm.com/docs/gitignore
|
||||
|
||||
# `.DS_Store` is a file that stores custom attributes of its containing folder
|
||||
.DS_Store
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Dependencies
|
||||
node_modules
|
||||
bower_components
|
||||
vendor
|
||||
|
||||
# Caches
|
||||
.cache
|
||||
.npm
|
||||
.eslintcache
|
||||
|
||||
# Temporaries
|
||||
.tmp
|
||||
.temp
|
||||
|
||||
# Built
|
||||
dist
|
||||
target
|
||||
built
|
||||
output
|
||||
out
|
||||
6
.templates/Command.ts
Normal file
6
.templates/Command.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export class xxxCMD extends SimpleCommand {
|
||||
static NAME:string = "xxxCMD";
|
||||
execute(notifi:INotification) {
|
||||
|
||||
}
|
||||
}
|
||||
35
.templates/Facade.ts
Normal file
35
.templates/Facade.ts
Normal file
@ -0,0 +1,35 @@
|
||||
export default class xxxFacade extends Facade {
|
||||
static NAME:string = "xxxFacade";
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
initializeFacade() {
|
||||
super.initializeFacade();
|
||||
}
|
||||
|
||||
initializeModel() {
|
||||
super.initializeModel();
|
||||
/* this.registerProxy(new PokerModel());
|
||||
this.registerProxy(new DdzGameModel()); */
|
||||
}
|
||||
|
||||
initializeController() {
|
||||
super.initializeController();
|
||||
/* this.registerCommand(BackInGameCMD.NAME, BackInGameCMD); */
|
||||
|
||||
}
|
||||
|
||||
initializeView() {
|
||||
super.initializeView();
|
||||
/* this.registerMediator(new OutPokerListMediator(DdzFacade.sRootView.getComponent(DdzGameScene).outPokerListArr));
|
||||
this.registerMediator(new HandPokerListMediator(DdzFacade.sRootView.getComponent(DdzGameScene).handPokerList));
|
||||
this.registerMediator(new RevealPokerListMediator(DdzFacade.sRootView.getComponent(DdzGameScene).revealPokerListArr));
|
||||
this.registerMediator(new DdzGameMediator(DdzFacade.sRootView)); */
|
||||
}
|
||||
|
||||
|
||||
static init(view:cc.Node = null): xxxFacade {
|
||||
return Facade.getInstance();
|
||||
}
|
||||
}
|
||||
30
.templates/List.ts
Normal file
30
.templates/List.ts
Normal file
@ -0,0 +1,30 @@
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class ListView extends PM_UI_List<T_PM_ITEM_DATA> {
|
||||
// @property()
|
||||
|
||||
|
||||
showList(data: T_PM_ITEM_DATA[]) {
|
||||
super.showList(data);
|
||||
|
||||
this.addItemEventListener();
|
||||
|
||||
}
|
||||
|
||||
addItemEventListener(){
|
||||
for (let i = 0; i < this.itemContainer.childrenCount; i++) {
|
||||
const el = this.itemContainer.children[i];
|
||||
el.on(cc.Node.EventType.TOUCH_START,this.callBack,this);
|
||||
}
|
||||
}
|
||||
|
||||
callBack(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
19
.templates/ListItem.ts
Normal file
19
.templates/ListItem.ts
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
export type T_PM_ITEM_DATA = {
|
||||
|
||||
|
||||
}
|
||||
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class ListItemView extends PM_Abs_UI_ListItem<T_PM_ITEM_DATA> {
|
||||
|
||||
@property(cc.Label)
|
||||
NodeName: cc.Label = null;
|
||||
|
||||
|
||||
showInfo(data:T_PM_ITEM_DATA){
|
||||
|
||||
}
|
||||
}
|
||||
33
.templates/Mediator.ts
Normal file
33
.templates/Mediator.ts
Normal file
@ -0,0 +1,33 @@
|
||||
export default class xxMediator extends Mediator {
|
||||
static NAME: string = "!! Input your Mediator Name";
|
||||
constructor(view: cc.Node) {
|
||||
super(Mediator.NAME, view);
|
||||
}
|
||||
|
||||
onRegister() {
|
||||
this.addUIListener();
|
||||
}
|
||||
private addUIListener(){
|
||||
(this.getViewComponent() as cc.Node).on("_node_enable_",()=>{
|
||||
this.refershView();
|
||||
})
|
||||
}
|
||||
|
||||
private refershView(){}
|
||||
|
||||
listNotificationInterests(): string[] {
|
||||
return [
|
||||
]
|
||||
}
|
||||
|
||||
handleNotification(notification: Notification) {
|
||||
let _msgName: string = notification.name;
|
||||
let _data: string = notification.getBody();
|
||||
if (this[_msgName]) this[_msgName](_data);
|
||||
}
|
||||
|
||||
getViewClass(): ViewClass {
|
||||
return this.getViewComponent().getComponent("ViewClass") as ViewClass;
|
||||
}
|
||||
onRemove() {}
|
||||
}
|
||||
11
.templates/Proxy.ts
Normal file
11
.templates/Proxy.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export default class xxModel extends CoreProxy {
|
||||
static NAME: string = "xxModel";
|
||||
constructor() {
|
||||
super(xxModel.NAME);
|
||||
}
|
||||
|
||||
onRegister(){}
|
||||
|
||||
onRemove(){}
|
||||
|
||||
}
|
||||
36
README.en.md
Normal file
36
README.en.md
Normal file
@ -0,0 +1,36 @@
|
||||
# CCC-Project
|
||||
|
||||
#### Description1
|
||||
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
||||
|
||||
#### Software Architecture
|
||||
Software architecture description
|
||||
|
||||
#### Installation
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Contribution
|
||||
|
||||
1. Fork the repository
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
|
||||
#### Gitee Feature
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
190
README.md
190
README.md
@ -1,92 +1,154 @@
|
||||
# marineParkClient
|
||||
# 5号玩家共建分支
|
||||
|
||||
### TODO LIST
|
||||
|
||||
* [x] 网络通讯模块
|
||||
* [x] 日志模块
|
||||
* [x] BUTTON常规点击效果事件封装(btnPrefab脚本挂载)
|
||||
* [x] 层级管理
|
||||
* [x] 音频管理器
|
||||
* [x] UI管理器(prefab资源及prefab生成的组件和界面管理)
|
||||
* [x] 开发者界面(切换日志输出过滤,通过UIManager打开界面,协议流程调用,游戏逻辑功能、动画,检测牌型等)
|
||||
* [ ] 代码特效管理器
|
||||
* [ ] 活动图标组件
|
||||
* [ ] 引导系统
|
||||
* [ ] 配置管理工具
|
||||
* [ ] 资源管理器
|
||||
- 基于2.4的cc.AssetManager的加载封装
|
||||
- 更加方便的接口调用,只实现了三个接口:
|
||||
- preload 预加载
|
||||
- getAssetAsyn 异步取资源
|
||||
- getAsset 同步取资源
|
||||
- 强预加载实现(引擎的预加载接口为弱预加载),为首次呈现游戏提供无缝体验支持,且支持进度监测
|
||||
|
||||
## Getting started
|
||||
### NOTE
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
* proto_bundle 不能导入为插件
|
||||
*
|
||||
```javascript
|
||||
// var $protobuf = require("protobufjs/minimal"); <br>
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
|
||||
## Add your files
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin http://47.108.93.124:9999/jack/marineparkclient.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
var $protobuf = protobuf;
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
*
|
||||
```typescript
|
||||
// import * as $protobuf from "protobufjs"; <br>
|
||||
|
||||
- [ ] [Set up project integrations](http://47.108.93.124:9999/jack/marineparkclient/-/settings/integrations)
|
||||
import * as $protobuf from "./protobuf";
|
||||
```
|
||||
|
||||
## Collaborate with your team
|
||||
* 定义自定义数组
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
```typescript
|
||||
@property(cc.Button)
|
||||
btnArr:cc.Button[] =[];
|
||||
```
|
||||
* 定义自定义类型
|
||||
**自定义类型**
|
||||
```typescript
|
||||
enum E_POKER_SUIT {
|
||||
NONE,
|
||||
DIAMONDS,
|
||||
CLUBS,
|
||||
HEARTS,
|
||||
JOKER
|
||||
}
|
||||
|
||||
## Test and Deploy
|
||||
@ccclass
|
||||
class pokerSprFra{
|
||||
@property(cc.SpriteFrame)
|
||||
[E_POKER_SUIT.DIAMONDS]:cc.SpriteFrame = null;
|
||||
@property(cc.SpriteFrame)
|
||||
[E_POKER_SUIT.HEARTS]:cc.SpriteFrame = null;
|
||||
@property(cc.SpriteFrame)
|
||||
[E_POKER_SUIT.SPADES]:cc.SpriteFrame = null;
|
||||
constructor() {}
|
||||
}
|
||||
```
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
**使用自定义类型**
|
||||
```typescript
|
||||
@property({type:pokerSprFra})
|
||||
sprFr_Dic = {};
|
||||
```
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
|
||||
***
|
||||
* 定义getter setter
|
||||
|
||||
# Editing this README
|
||||
```typescript
|
||||
private _state: E_CONTROL_PANEL_STATE;
|
||||
@property
|
||||
get state () {
|
||||
return this._state;
|
||||
}
|
||||
set state (value: E_CONTROL_PANEL_STATE) {
|
||||
this._state = value;
|
||||
this.changeStatus(value)
|
||||
}
|
||||
```
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
---
|
||||
|
||||
## Suggestions for a good README
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
### VSCODE 快捷键
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
* Shift + Alt + Down/Up 复制光标所在行,并根据操作方向粘贴到临近位置
|
||||
* 格式化代码: Alt + Shift + F (格式化后保存提交,确保代码格式一致,提高可读性)
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
---
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
### 命名规范
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
* 语法顺序
|
||||
- 驼峰命名
|
||||
- 形容词在前,主语在后 e.g. prettyGirl
|
||||
- 下划线命名(少用)
|
||||
- 主语在前,形容词在后 e.g. girl_pretty
|
||||
- 帕斯卡命名
|
||||
- 同驼峰
|
||||
* 适用类型
|
||||
- 类名, prefab, scene 等使用[帕斯卡命名法] e.g. GameScene
|
||||
- 方法名, 变量名 等使用[驼峰命名法] e.g. getGameScene
|
||||
- 常量 使用[下划线命名法](全大写, enum以E开头,type以T开头)
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
e.g.
|
||||
``` typescript
|
||||
enum E_HAIR_STYLE
|
||||
type T_HAIR_STYLE
|
||||
```
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
- 特殊情况
|
||||
- 私有变量 e.g. mName
|
||||
- 静态私有变量 e.g. sName
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
### 框架说明
|
||||
* 解耦规范:
|
||||
+ 具体挂载UI节点的view类只关注该节点UI相关操作, 以及对事件的处理逻辑, 所有需要的非UI节点数据依赖注入(原则上“挂载UI节点的view类”仅被相应的Mediator类引用)。
|
||||
+ View 类对其他所有类无感知(主场景和强关联的组件除外 e.g. DdzGameScene; list与item), 目的是让UI组件及脚本方便移植可复用。
|
||||
* 名词解释
|
||||
+ PM:Play Moudle, 与大厅模块相对应的游戏模块
|
||||
* 列表视图
|
||||
+ 列表继承 PM_UI_List
|
||||
+ 列表项脚本继承 PM_Abs_UI_ListItem
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
### 项目代码目录结构
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
* Script
|
||||
+ command
|
||||
+ component(视图组件)
|
||||
- listitem(列表项组件)
|
||||
+ componentScript(为视图组件提供行为的脚本组件)
|
||||
+ devTool
|
||||
+ facade
|
||||
+ global
|
||||
+ manager
|
||||
+ mediator
|
||||
+ model
|
||||
+ net
|
||||
+ pb
|
||||
+ plugin(三方库)
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
### 子游戏bundle加载流程
|
||||
* 大厅loadBundle,实例化预制体
|
||||
* 预制体挂在场景脚本组件onLoad,初始化mvc框架
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
|
||||
12
assets/common.meta
Normal file
12
assets/common.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "078d1039-f2c7-4c6a-a454-de1f947bae2c",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/component.meta
Normal file
12
assets/common/component.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "05de0c6d-23fe-4158-9589-1450d5274e03",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/component/List.meta
Normal file
12
assets/common/component/List.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "d48a2a4a-acb2-42cc-9697-49c486696abb",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
59
assets/common/component/List/UI_List.ts
Normal file
59
assets/common/component/List/UI_List.ts
Normal file
@ -0,0 +1,59 @@
|
||||
import UI_ListItem from "./UI_ListItem";
|
||||
import VirtualList from "./VirtualList";
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
@ccclass
|
||||
export default class PM_UI_List<T> extends cc.Component {
|
||||
|
||||
@property(cc.Node)
|
||||
itemContainer: cc.Node = null;
|
||||
@property(cc.Node)
|
||||
copyeeItem: cc.Node = null;
|
||||
@property(cc.ScrollView)
|
||||
scroll: cc.ScrollView = null;
|
||||
mItems: cc.Node[] = [];
|
||||
|
||||
////// 虚拟列表 begin ///////
|
||||
@property
|
||||
isVirtual: boolean = false;
|
||||
@property({ type: cc.Integer, tooltip: "视口显示数量(用于虚拟列表)" })
|
||||
viewPortItemCount: number = 1;
|
||||
////// 虚拟列表 end ///////
|
||||
|
||||
private addItems(data: T[]) {
|
||||
let _len = data.length;
|
||||
for (let i = 0; i < _len; i++) {
|
||||
let _item = cc.instantiate(this.copyeeItem);
|
||||
let _dataItem = data[i];
|
||||
this.mItems.push(_item);
|
||||
let _itemCls = _item.getComponent(UI_ListItem);
|
||||
_itemCls.showInfo(_dataItem);
|
||||
_itemCls.itemData = _dataItem;
|
||||
|
||||
this.itemContainer.addChild(_item);
|
||||
}
|
||||
}
|
||||
|
||||
private mVirtualListMrg:VirtualList;
|
||||
private mListData: T[];
|
||||
showList(data: T[]) {
|
||||
this.mListData = data;
|
||||
this.initDataIdx();
|
||||
this.itemContainer.removeAllChildren();
|
||||
if (!this.isVirtual) {
|
||||
this.addItems(data);
|
||||
}
|
||||
else {
|
||||
if(!this.mVirtualListMrg){
|
||||
this.mVirtualListMrg = new VirtualList();
|
||||
}
|
||||
this.mVirtualListMrg.initVirtualList(this.viewPortItemCount,this.mListData,this.itemContainer,this.scroll,this.copyeeItem)
|
||||
}
|
||||
}
|
||||
|
||||
private initDataIdx() {
|
||||
this.mListData.forEach((item, idx) => {
|
||||
item["_list_idx_"] = idx;
|
||||
})
|
||||
}
|
||||
}
|
||||
9
assets/common/component/List/UI_List.ts.meta
Normal file
9
assets/common/component/List/UI_List.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "36e10501-085d-4188-97d7-0553918d0e00",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
5
assets/common/component/List/UI_ListItem.ts
Normal file
5
assets/common/component/List/UI_ListItem.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export default abstract class UI_ListItem<T> extends cc.Component{
|
||||
abstract showInfo(data:T);
|
||||
abstract itemData:Object;
|
||||
|
||||
}
|
||||
9
assets/common/component/List/UI_ListItem.ts.meta
Normal file
9
assets/common/component/List/UI_ListItem.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "2f3cd869-ff82-40a5-b53a-683ef62d16d1",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
91
assets/common/component/List/VirtualList.ts
Normal file
91
assets/common/component/List/VirtualList.ts
Normal file
@ -0,0 +1,91 @@
|
||||
import UI_ListItem from "./UI_ListItem";
|
||||
|
||||
export default class VirtualList{
|
||||
constructor(){}
|
||||
private scroll:cc.ScrollView;
|
||||
/**不能使用layout */
|
||||
private itemContainer:cc.Node;
|
||||
private mListData:any[];
|
||||
private viewPortItemCount:number;
|
||||
private copyeeItem:cc.Node;
|
||||
private viewPortFirstItem: cc.Node = null;
|
||||
|
||||
initVirtualList(viewCount:number,listDatas:any[],itemContainer:cc.Node,scroller:cc.ScrollView,
|
||||
copyItem:cc.Node) {
|
||||
|
||||
this.scroll = scroller;
|
||||
this.itemContainer = itemContainer;
|
||||
this.mListData = listDatas;
|
||||
this.viewPortItemCount = viewCount;
|
||||
this.copyeeItem = copyItem;
|
||||
|
||||
let _data = listDatas.slice(0, viewCount + 1);
|
||||
this.addVirtualItems(_data,copyItem,itemContainer);
|
||||
this.viewPortFirstItem = itemContainer.children[0];
|
||||
|
||||
scroller.node.on("scrolling", this.onScrolling, this);
|
||||
}
|
||||
|
||||
private addVirtualItems(data: any[],copyItem:cc.Node,itemContainer:cc.Node) {
|
||||
let _itemHeight:number = copyItem.height;
|
||||
let _len = data.length;
|
||||
for (let i = 0; i < _len; i++) {
|
||||
let _item = cc.instantiate(copyItem);
|
||||
_item.y = -_itemHeight*i;
|
||||
let _dataItem = data[i];
|
||||
let _itemCls = _item.getComponent(UI_ListItem);
|
||||
_itemCls.showInfo(_dataItem);
|
||||
_itemCls.itemData = _dataItem;
|
||||
|
||||
itemContainer.addChild(_item);
|
||||
}
|
||||
}
|
||||
|
||||
onScrolling() {
|
||||
this.calcPosAndSwapItem();
|
||||
}
|
||||
|
||||
calcPosAndSwapItem() {
|
||||
let _itemData = this.viewPortFirstItem.getComponent(UI_ListItem).itemData;
|
||||
let _offsetY = this.scroll.getScrollOffset().y;
|
||||
let _idx: number = _itemData["_list_idx_"];
|
||||
if (_offsetY > this.viewPortFirstItem.height
|
||||
) {
|
||||
let _lastItem = this.itemContainer.children[this.itemContainer.childrenCount - 1];
|
||||
let _nextDataIdx: number = _lastItem.getComponent(UI_ListItem).itemData["_list_idx_"]+1;
|
||||
if (_nextDataIdx < this.mListData.length) {
|
||||
this.swapItem(0,_nextDataIdx, true);
|
||||
}
|
||||
} else if (_offsetY < 0
|
||||
) {
|
||||
if (_idx > 0) {
|
||||
this.swapItem(this.viewPortItemCount, _idx-1,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
swapItem(deleteBeginIdx: number,dataIdx:number, isToEnd: boolean = false) {
|
||||
let _el = this.itemContainer.children[deleteBeginIdx];
|
||||
let _top: number = 0;
|
||||
if (_el) {
|
||||
let _insertIdx: number = isToEnd ? this.viewPortItemCount : 0;
|
||||
|
||||
let _itemData = this.mListData[dataIdx];
|
||||
_el.getComponent(UI_ListItem).showInfo(_itemData);
|
||||
|
||||
this.itemContainer.insertChild(_el, _insertIdx);
|
||||
|
||||
this.refreshItemsY();
|
||||
_top = isToEnd ? 0 : _el.height;
|
||||
this.scroll.setContentPosition(new cc.Vec2(0, _top));
|
||||
this.viewPortFirstItem = this.itemContainer.children[0];
|
||||
}
|
||||
}
|
||||
|
||||
refreshItemsY(){
|
||||
this.itemContainer.children.forEach((item,idx)=>{
|
||||
item.y = -idx * this.copyeeItem.height;
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
9
assets/common/component/List/VirtualList.ts.meta
Normal file
9
assets/common/component/List/VirtualList.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "3b9a3d81-98dd-434e-8da7-8a879d8f0d54",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/external.meta
Normal file
12
assets/common/external.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "8e65828c-c5ab-4a11-8810-0dd93f53261e",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
112
assets/common/external/SoundManager.ts
vendored
Normal file
112
assets/common/external/SoundManager.ts
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
import ResHelper from "../res/ResHelper";
|
||||
import { SysDefine } from "../ui/config/SysDefine";
|
||||
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class SoundManager extends cc.Component {
|
||||
|
||||
private audioCache: {[key: string]: cc.AudioClip} = cc.js.createMap();
|
||||
//test merge
|
||||
private static _inst: SoundManager = null; // 单例
|
||||
public static get inst(): SoundManager {
|
||||
if(this._inst == null) {
|
||||
this._inst = cc.find(SysDefine.SYS_UIROOT_NAME).addComponent<SoundManager>(this);
|
||||
}
|
||||
return this._inst;
|
||||
}
|
||||
|
||||
private currEffectId: number = -1;
|
||||
private currMusicId: number = -1;
|
||||
|
||||
onLoad () {
|
||||
let volume = this.getVolumeToLocal();
|
||||
if(volume) {
|
||||
this.volume = volume;
|
||||
}else {
|
||||
this.volume.musicVolume = 1;
|
||||
this.volume.effectVolume = 1;
|
||||
}
|
||||
this.setVolumeToLocal();
|
||||
|
||||
cc.game.on(cc.game.EVENT_HIDE, () => {
|
||||
cc.audioEngine.pauseAll();
|
||||
}, this);
|
||||
cc.game.on(cc.game.EVENT_SHOW, () => {
|
||||
cc.audioEngine.resumeAll();
|
||||
}, this);
|
||||
}
|
||||
/** volume */
|
||||
private volume: Volume = new Volume();
|
||||
getVolume() {
|
||||
return this.volume;
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
}
|
||||
/** */
|
||||
public setMusicVolume(musicVolume: number) {
|
||||
this.volume.musicVolume = musicVolume;
|
||||
this.setVolumeToLocal();
|
||||
}
|
||||
public setEffectVolume(effectVolume: number) {
|
||||
this.volume.effectVolume = effectVolume;
|
||||
this.setVolumeToLocal();
|
||||
}
|
||||
/** 播放背景音乐 */
|
||||
public async playMusic(url: string, loop = true) {
|
||||
if(!url || url === '') return ;
|
||||
|
||||
if(this.audioCache[url]) {
|
||||
cc.audioEngine.playMusic(this.audioCache[url], loop);
|
||||
return ;
|
||||
}
|
||||
let sound = await ResHelper.loadResAsync<cc.AudioClip>(url, cc.AudioClip);
|
||||
this.audioCache[url] = sound;
|
||||
this.currMusicId = cc.audioEngine.playMusic(sound, loop);
|
||||
}
|
||||
/** 播放音效 */
|
||||
public async playEffect(url: string, loop = false) {
|
||||
if(!url || url === '') return ;
|
||||
|
||||
if(this.audioCache[url]) {
|
||||
cc.audioEngine.playEffect(this.audioCache[url], loop);
|
||||
return ;
|
||||
}
|
||||
let sound = await ResHelper.loadResAsync<cc.AudioClip>(url, cc.AudioClip);
|
||||
this.audioCache[url] = sound;
|
||||
this.currEffectId = cc.audioEngine.playEffect(sound, loop);
|
||||
}
|
||||
|
||||
/** 从本地读取 */
|
||||
private getVolumeToLocal() {
|
||||
let objStr = cc.sys.localStorage.getItem("Volume_For_Creator");
|
||||
if(!objStr) {
|
||||
return null;
|
||||
}
|
||||
return JSON.parse(objStr);
|
||||
}
|
||||
/** 设置音量 */
|
||||
private setVolumeToLocal() {
|
||||
cc.audioEngine.setMusicVolume(this.volume.musicVolume);
|
||||
cc.audioEngine.setEffectsVolume(this.volume.effectVolume);
|
||||
|
||||
cc.sys.localStorage.setItem("Volume_For_Creator", JSON.stringify(this.volume));
|
||||
}
|
||||
|
||||
public setEffectActive(active: boolean, id: number = -1) {
|
||||
if(active) {
|
||||
cc.audioEngine.stop(id < 0 ? this.currEffectId : id);
|
||||
}else {
|
||||
cc.audioEngine.resume(id < 0 ? this.currEffectId : id);
|
||||
}
|
||||
}
|
||||
|
||||
// update (dt) {}
|
||||
}
|
||||
|
||||
class Volume {
|
||||
musicVolume: number;
|
||||
effectVolume: number;
|
||||
}
|
||||
9
assets/common/external/SoundManager.ts.meta
vendored
Normal file
9
assets/common/external/SoundManager.ts.meta
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "44474c1e-9ae4-486f-9ff8-e378644c6b84",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/framework.meta
Normal file
12
assets/common/framework.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "82729133-308d-4d64-874c-354dc421e587",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
48
assets/common/framework/GameFacade.ts
Normal file
48
assets/common/framework/GameFacade.ts
Normal file
@ -0,0 +1,48 @@
|
||||
import { Facade } from "./PureMVC";
|
||||
import { RemoveMVC_CMD } from "./RemoveMVC_CMD";
|
||||
|
||||
export default class GameFacade extends Facade {
|
||||
static NAME:string = "GameFacade";
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
initializeFacade() {
|
||||
super.initializeFacade();
|
||||
}
|
||||
|
||||
initializeModel() {
|
||||
super.initializeModel();
|
||||
/* this.registerProxy(new PokerModel());
|
||||
this.registerProxy(new DdzGameModel()); */
|
||||
}
|
||||
|
||||
initializeController() {
|
||||
super.initializeController();
|
||||
this.registerCommand(RemoveMVC_CMD.NAME, RemoveMVC_CMD);
|
||||
/* this.registerCommand(BackInGameCMD.NAME, BackInGameCMD); */
|
||||
|
||||
}
|
||||
|
||||
initializeView() {
|
||||
super.initializeView();
|
||||
/* this.registerMediator(new OutPokerListMediator(DdzFacade.sRootView.getComponent(DdzGameScene).outPokerListArr));
|
||||
this.registerMediator(new HandPokerListMediator(DdzFacade.sRootView.getComponent(DdzGameScene).handPokerList));
|
||||
this.registerMediator(new RevealPokerListMediator(DdzFacade.sRootView.getComponent(DdzGameScene).revealPokerListArr));
|
||||
this.registerMediator(new DdzGameMediator(DdzFacade.sRootView)); */
|
||||
}
|
||||
|
||||
|
||||
// static sRootView: cc.Node;
|
||||
static init(view: cc.Node = null) {
|
||||
if (!Facade.instance) {
|
||||
// this.sRootView = view;
|
||||
Facade.instance = new GameFacade();
|
||||
}
|
||||
}
|
||||
|
||||
static get ins(): GameFacade {
|
||||
return <GameFacade>GameFacade.getInstance();
|
||||
}
|
||||
|
||||
}
|
||||
9
assets/common/framework/GameFacade.ts.meta
Normal file
9
assets/common/framework/GameFacade.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "153a2371-55a8-4851-9c6a-d681afc4e86f",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
540
assets/common/framework/PureMVC.ts
Normal file
540
assets/common/framework/PureMVC.ts
Normal file
@ -0,0 +1,540 @@
|
||||
export interface ICommand
|
||||
extends INotifier {
|
||||
execute(notification: INotification): void;
|
||||
}
|
||||
|
||||
export interface IController {
|
||||
executeCommand(notification: INotification): void;
|
||||
registerCommand(notificationName: string, commandClassRef: Function): void;
|
||||
hasCommand(notificationName: string): boolean;
|
||||
removeCommand(notificationName: string): void;
|
||||
}
|
||||
|
||||
export interface IFacade
|
||||
extends INotifier {
|
||||
registerCommand(notificationName: string, commandClassRef: Function): void;
|
||||
removeCommand(notificationName: string): void;
|
||||
hasCommand(notificationName: string): boolean;
|
||||
registerProxy(proxy: IProxy): void;
|
||||
retrieveProxy(proxyName: string): IProxy;
|
||||
removeProxy(proxyName: string): IProxy;
|
||||
hasProxy(proxyName: string): boolean;
|
||||
registerMediator(mediator: IMediator): void;
|
||||
retrieveMediator(mediatorName: string): IMediator;
|
||||
removeMediator(mediatorName: string): IMediator;
|
||||
hasMediator(mediatorName: string): boolean;
|
||||
notifyObservers(notification: INotification): void;
|
||||
}
|
||||
|
||||
export interface IMediator
|
||||
extends INotifier {
|
||||
getMediatorName(): string;
|
||||
getViewComponent(): any;
|
||||
setViewComponent(viewComponent: any): void;
|
||||
listNotificationInterests(): string[];
|
||||
handleNotification(notification: INotification): void;
|
||||
onRegister(): void;
|
||||
onRemove(): void;
|
||||
}
|
||||
|
||||
export interface IModel {
|
||||
registerProxy(proxy: IProxy): void;
|
||||
removeProxy(proxyName: string): IProxy;
|
||||
retrieveProxy(proxyName: string): IProxy;
|
||||
hasProxy(proxyName: string): boolean;
|
||||
}
|
||||
|
||||
export interface INotification {
|
||||
getName(): string;
|
||||
setBody(body: any): void;
|
||||
getBody(): any;
|
||||
setType(type: string): void;
|
||||
getType(): string;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export interface INotifier {
|
||||
sendNotification(name: string, body?: any, type?: string): void;
|
||||
}
|
||||
|
||||
export interface IObserver {
|
||||
setNotifyMethod(notifyMethod: Function): void;
|
||||
setNotifyContext(notifyContext: any): void;
|
||||
notifyObserver(notification: INotification): void;
|
||||
compareNotifyContext(object: any): boolean;
|
||||
}
|
||||
|
||||
export interface IProxy
|
||||
extends INotifier {
|
||||
getProxyName(): string;
|
||||
setData(data: any): void;
|
||||
getData(): any;
|
||||
onRegister(): void;
|
||||
onRemove(): void;
|
||||
}
|
||||
|
||||
export interface IView {
|
||||
registerObserver(notificationName: string, observer: IObserver): void;
|
||||
removeObserver(notificationName: string, notifyContext: any): void;
|
||||
notifyObservers(notification: INotification): void;
|
||||
registerMediator(mediator: IMediator): void;
|
||||
retrieveMediator(mediatorName: string): IMediator;
|
||||
removeMediator(mediatorName: string): IMediator;
|
||||
hasMediator(mediatorName: string): boolean;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export class Observer
|
||||
implements IObserver {
|
||||
public notify: Function;
|
||||
public context: any;
|
||||
constructor(notifyMethod: Function, notifyContext: any) {
|
||||
this.notify = null;
|
||||
this.context = null;
|
||||
this.setNotifyMethod(notifyMethod);
|
||||
this.setNotifyContext(notifyContext);
|
||||
};
|
||||
private getNotifyMethod(): Function {
|
||||
return this.notify;
|
||||
};
|
||||
public setNotifyMethod(notifyMethod: Function): void {
|
||||
this.notify = notifyMethod;
|
||||
};
|
||||
private getNotifyContext(): any {
|
||||
return this.context;
|
||||
};
|
||||
public setNotifyContext(notifyContext: any): void {
|
||||
this.context = notifyContext;
|
||||
};
|
||||
public notifyObserver(notification: INotification): void {
|
||||
// console.log("[mvcFrame:notifyObserver] notifyMethod!=null:"+!!this.getNotifyMethod());
|
||||
this.getNotifyMethod().call(this.getNotifyContext(), notification);
|
||||
};
|
||||
public compareNotifyContext(object: any): boolean {
|
||||
return object === this.context;
|
||||
};
|
||||
}
|
||||
|
||||
export class View
|
||||
implements IView {
|
||||
public mediatorMap: Object;
|
||||
public observerMap: Object;
|
||||
constructor() {
|
||||
this.mediatorMap = null;
|
||||
this.observerMap = null;
|
||||
if (View.instance) {
|
||||
throw Error(View.SINGLETON_MSG);
|
||||
}
|
||||
View.instance = this;
|
||||
this.mediatorMap = {
|
||||
};
|
||||
this.observerMap = {
|
||||
};
|
||||
this.initializeView();
|
||||
};
|
||||
public initializeView(): void { };
|
||||
public registerObserver(notificationName: string, observer: IObserver): void {
|
||||
var observers = this.observerMap[notificationName];
|
||||
if (observers) {
|
||||
observers.push(observer);
|
||||
} else {
|
||||
this.observerMap[notificationName] = [
|
||||
observer
|
||||
];
|
||||
}
|
||||
};
|
||||
public removeObserver(notificationName: string, notifyContext: any): void {
|
||||
var observers = this.observerMap[notificationName];
|
||||
var i = observers.length;
|
||||
while (i--) {
|
||||
var observer = observers[i];
|
||||
if (observer.compareNotifyContext(notifyContext)) {
|
||||
observers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (observers.length == 0) {
|
||||
delete this.observerMap[notificationName];
|
||||
}
|
||||
};
|
||||
public notifyObservers(notification: INotification): void {
|
||||
var notificationName = notification.getName();
|
||||
// console.log("[mvcFrame:notifyObservers] notificationName:"+notificationName);
|
||||
// console.log("[mvcFrame:notifyObservers] curObserversArr:"+Object.keys(this.observerMap));
|
||||
var observersRef = this.observerMap[notificationName];
|
||||
if (observersRef) {
|
||||
var observers = observersRef.slice(0);
|
||||
// console.log("[mvcFrame:notifyObservers] observers.length:"+observers.length);
|
||||
var len = observers.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
var observer = observers[i];
|
||||
observer.notifyObserver(notification);
|
||||
}
|
||||
}
|
||||
};
|
||||
public registerMediator(mediator: IMediator): void {
|
||||
var name = mediator.getMediatorName();
|
||||
if (this.mediatorMap[name]) {
|
||||
return;
|
||||
}
|
||||
this.mediatorMap[name] = mediator;
|
||||
var interests = mediator.listNotificationInterests();
|
||||
var len = interests.length;
|
||||
if (len > 0) {
|
||||
var observer = new Observer(mediator.handleNotification, mediator);
|
||||
for (var i = 0; i < len; i++) {
|
||||
this.registerObserver(interests[i], observer);
|
||||
}
|
||||
}
|
||||
mediator.onRegister();
|
||||
};
|
||||
public retrieveMediator(mediatorName: string): IMediator {
|
||||
return this.mediatorMap[mediatorName] || null;
|
||||
};
|
||||
public removeMediator(mediatorName: string): IMediator {
|
||||
var mediator = this.mediatorMap[mediatorName];
|
||||
if (!mediator) {
|
||||
return null;
|
||||
}
|
||||
var interests = mediator.listNotificationInterests();
|
||||
var i = interests.length;
|
||||
while (i--) {
|
||||
this.removeObserver(interests[i], mediator);
|
||||
}
|
||||
delete this.mediatorMap[mediatorName];
|
||||
mediator.onRemove();
|
||||
return mediator;
|
||||
};
|
||||
public hasMediator(mediatorName: string): boolean {
|
||||
return this.mediatorMap[mediatorName] != null;
|
||||
};
|
||||
static SINGLETON_MSG: string;
|
||||
static instance: IView;
|
||||
static getInstance(): IView {
|
||||
if (!View.instance) {
|
||||
View.instance = new View();
|
||||
}
|
||||
return View.instance;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export class Controller
|
||||
implements IController {
|
||||
public view: IView;
|
||||
public commandMap: Object;
|
||||
constructor() {
|
||||
this.view = null;
|
||||
this.commandMap = null;
|
||||
if (Controller.instance) {
|
||||
throw Error(Controller.SINGLETON_MSG);
|
||||
}
|
||||
Controller.instance = this;
|
||||
this.commandMap = {
|
||||
};
|
||||
this.initializeController();
|
||||
};
|
||||
public initializeController(): void {
|
||||
this.view = View.getInstance();
|
||||
};
|
||||
public executeCommand(notification: INotification): void {
|
||||
var commandClassRef = this.commandMap[notification.getName()];
|
||||
if (commandClassRef) {
|
||||
var command = new commandClassRef();
|
||||
command.execute(notification);
|
||||
}
|
||||
};
|
||||
public registerCommand(notificationName: string, commandClassRef: Function): void {
|
||||
if (!this.commandMap[notificationName]) {
|
||||
this.view.registerObserver(notificationName, new Observer(this.executeCommand, this));
|
||||
}
|
||||
this.commandMap[notificationName] = commandClassRef;
|
||||
};
|
||||
public hasCommand(notificationName: string): boolean {
|
||||
return this.commandMap[notificationName] != null;
|
||||
};
|
||||
public removeCommand(notificationName: string): void {
|
||||
if (this.hasCommand(notificationName)) {
|
||||
this.view.removeObserver(notificationName, this);
|
||||
delete this.commandMap[notificationName];
|
||||
}
|
||||
};
|
||||
static instance: IController = null;
|
||||
static SINGLETON_MSG: string = "Controller singleton already constructed!";
|
||||
static getInstance(): IController {
|
||||
if (!Controller.instance) {
|
||||
Controller.instance = new Controller();
|
||||
}
|
||||
return Controller.instance;
|
||||
};
|
||||
}
|
||||
|
||||
export class Model
|
||||
implements IModel {
|
||||
public proxyMap: Object;
|
||||
constructor() {
|
||||
this.proxyMap = null;
|
||||
if (Model.instance) {
|
||||
throw Error(Model.SINGLETON_MSG);
|
||||
}
|
||||
Model.instance = this;
|
||||
this.proxyMap = {
|
||||
};
|
||||
this.initializeModel();
|
||||
};
|
||||
public initializeModel(): void { };
|
||||
public registerProxy(proxy: IProxy): void {
|
||||
this.proxyMap[proxy.getProxyName()] = proxy;
|
||||
proxy.onRegister();
|
||||
};
|
||||
public removeProxy(proxyName: string): IProxy {
|
||||
var proxy = this.proxyMap[proxyName];
|
||||
if (proxy) {
|
||||
delete this.proxyMap[proxyName];
|
||||
proxy.onRemove();
|
||||
}
|
||||
return proxy;
|
||||
};
|
||||
public retrieveProxy(proxyName: string): IProxy {
|
||||
return this.proxyMap[proxyName] || null;
|
||||
};
|
||||
public hasProxy(proxyName: string): boolean {
|
||||
return this.proxyMap[proxyName] != null;
|
||||
};
|
||||
static SINGLETON_MSG: string = "Model singleton already constructed!";
|
||||
static instance: IModel = null;
|
||||
static getInstance(): IModel {
|
||||
if (!Model.instance) {
|
||||
Model.instance = new Model();
|
||||
}
|
||||
return Model.instance;
|
||||
};
|
||||
}
|
||||
|
||||
export class CoreNotification
|
||||
implements INotification {
|
||||
public name: string;
|
||||
public body: any;
|
||||
public type: string;
|
||||
constructor(name: string, body?: any, type?: string) {
|
||||
if (typeof body === "undefined") { body = null; }
|
||||
if (typeof type === "undefined") { type = null; }
|
||||
this.name = null;
|
||||
this.body = null;
|
||||
this.type = null;
|
||||
this.name = name;
|
||||
this.body = body;
|
||||
this.type = type;
|
||||
};
|
||||
public getName(): string {
|
||||
return this.name;
|
||||
};
|
||||
public setBody(body: any): void {
|
||||
this.body = body;
|
||||
};
|
||||
public getBody(): any {
|
||||
return this.body;
|
||||
};
|
||||
public setType(type: string): void {
|
||||
this.type = type;
|
||||
};
|
||||
public getType(): string {
|
||||
return this.type;
|
||||
};
|
||||
public toString(): string {
|
||||
var msg = "Notification Name: " + this.getName();
|
||||
msg += "\nBody:" + ((this.getBody() == null) ? "null" : this.getBody().toString());
|
||||
msg += "\nType:" + ((this.getType() == null) ? "null" : this.getType());
|
||||
return msg;
|
||||
};
|
||||
}
|
||||
|
||||
export class Facade
|
||||
implements IFacade {
|
||||
public model: IModel;
|
||||
public view: IView;
|
||||
public controller: IController;
|
||||
constructor() {
|
||||
this.model = null;
|
||||
this.view = null;
|
||||
this.controller = null;
|
||||
if (Facade.instance) {
|
||||
throw Error(Facade.SINGLETON_MSG);
|
||||
}
|
||||
Facade.instance = this;
|
||||
this.initializeFacade();
|
||||
};
|
||||
public initializeFacade(): void {
|
||||
this.initializeModel();
|
||||
this.initializeController();
|
||||
this.initializeView();
|
||||
};
|
||||
public initializeModel(): void {
|
||||
if (!this.model) {
|
||||
this.model = Model.getInstance();
|
||||
}
|
||||
};
|
||||
public initializeController(): void {
|
||||
if (!this.controller) {
|
||||
this.controller = Controller.getInstance();
|
||||
}
|
||||
};
|
||||
public initializeView(): void {
|
||||
if (!this.view) {
|
||||
this.view = View.getInstance();
|
||||
}
|
||||
};
|
||||
public registerCommand(notificationName: string, commandClassRef: Function): void {
|
||||
this.controller.registerCommand(notificationName, commandClassRef);
|
||||
};
|
||||
public removeCommand(notificationName: string): void {
|
||||
this.controller.removeCommand(notificationName);
|
||||
};
|
||||
public hasCommand(notificationName: string): boolean {
|
||||
return this.controller.hasCommand(notificationName);
|
||||
};
|
||||
public registerProxy(proxy: IProxy): void {
|
||||
this.model.registerProxy(proxy);
|
||||
};
|
||||
public retrieveProxy(proxyName: string): IProxy {
|
||||
return this.model.retrieveProxy(proxyName);
|
||||
};
|
||||
public removeProxy(proxyName: string): IProxy {
|
||||
var proxy;
|
||||
if (this.model) {
|
||||
proxy = this.model.removeProxy(proxyName);
|
||||
}
|
||||
return proxy;
|
||||
};
|
||||
public hasProxy(proxyName: string): boolean {
|
||||
return this.model.hasProxy(proxyName);
|
||||
};
|
||||
public registerMediator(mediator: IMediator): void {
|
||||
if (this.view) {
|
||||
this.view.registerMediator(mediator);
|
||||
}
|
||||
};
|
||||
public retrieveMediator(mediatorName: string): IMediator {
|
||||
return this.view.retrieveMediator(mediatorName);
|
||||
};
|
||||
public removeMediator(mediatorName: string): IMediator {
|
||||
var mediator;
|
||||
if (this.view) {
|
||||
mediator = this.view.removeMediator(mediatorName);
|
||||
}
|
||||
return mediator;
|
||||
};
|
||||
public hasMediator(mediatorName: string): boolean {
|
||||
return this.view.hasMediator(mediatorName);
|
||||
};
|
||||
public notifyObservers(notification: INotification): void {
|
||||
// console.log("[mvcFrame::notifyObservers this.view!=null:]"+!!this.view);
|
||||
if (this.view) {
|
||||
this.view.notifyObservers(notification);
|
||||
}
|
||||
};
|
||||
public sendNotification(name: string, body?: any, type?: string): void {
|
||||
if (typeof body === "undefined") { body = null; }
|
||||
if (typeof type === "undefined") { type = null; }
|
||||
this.notifyObservers(new CoreNotification(name, body, type));
|
||||
};
|
||||
static SINGLETON_MSG: string = "Facade singleton already constructed!";
|
||||
static instance: IFacade = null;
|
||||
static getInstance(): IFacade {
|
||||
if (!Facade.instance) {
|
||||
Facade.instance = new Facade();
|
||||
}
|
||||
return Facade.instance;
|
||||
};
|
||||
}
|
||||
|
||||
export class Notifier
|
||||
implements INotifier {
|
||||
public facade: IFacade;
|
||||
constructor() {
|
||||
this.facade = null;
|
||||
this.facade = Facade.getInstance();
|
||||
};
|
||||
public sendNotification(name: string, body?: any, type?: string): void {
|
||||
if (typeof body === "undefined") { body = null; }
|
||||
if (typeof type === "undefined") { type = null; }
|
||||
this.facade.sendNotification(name, body, type);
|
||||
};
|
||||
}
|
||||
|
||||
export class SimpleCommand
|
||||
extends Notifier
|
||||
implements ICommand, INotifier {
|
||||
public execute(notification: INotification): void { };
|
||||
}
|
||||
|
||||
export class Mediator
|
||||
extends Notifier
|
||||
implements IMediator, INotifier {
|
||||
public mediatorName: string;
|
||||
public viewComponent: any;
|
||||
constructor(mediatorName?: string, viewComponent?: any) {
|
||||
super();
|
||||
if (typeof mediatorName === "undefined") { mediatorName = null; }
|
||||
if (typeof viewComponent === "undefined") { viewComponent = null; }
|
||||
// _super.call(this);
|
||||
this.mediatorName = null;
|
||||
this.viewComponent = null;
|
||||
this.mediatorName = (mediatorName != null) ? mediatorName : Mediator.NAME;
|
||||
this.viewComponent = viewComponent;
|
||||
};
|
||||
public getMediatorName(): string {
|
||||
return this.mediatorName;
|
||||
};
|
||||
public getViewComponent(): any {
|
||||
return this.viewComponent;
|
||||
};
|
||||
public setViewComponent(viewComponent: any): void {
|
||||
this.viewComponent = viewComponent;
|
||||
};
|
||||
public listNotificationInterests(): string[] {
|
||||
return new Array();
|
||||
};
|
||||
public handleNotification(notification: CoreNotification): void { };
|
||||
public onRegister(): void { };
|
||||
public onRemove(): void { };
|
||||
static NAME: string = 'Mediator';
|
||||
}
|
||||
|
||||
export class CoreProxy
|
||||
extends Notifier
|
||||
implements IProxy, INotifier {
|
||||
public proxyName: string;
|
||||
public data: any;
|
||||
constructor(proxyName?: string, data?: any) {
|
||||
super();
|
||||
if (typeof proxyName === "undefined") { proxyName = null; }
|
||||
if (typeof data === "undefined") { data = null; }
|
||||
// _super.call(this);
|
||||
this.proxyName = null;
|
||||
this.data = null;
|
||||
this.proxyName = (proxyName != null) ? proxyName : CoreProxy.NAME;
|
||||
if (data != null) {
|
||||
this.setData(data);
|
||||
}
|
||||
};
|
||||
public getProxyName(): string {
|
||||
return this.proxyName;
|
||||
};
|
||||
public setData(data: any): void {
|
||||
this.data = data;
|
||||
};
|
||||
public getData(): any {
|
||||
return this.data;
|
||||
};
|
||||
public onRegister(): void { };
|
||||
public onRemove(): void { };
|
||||
static NAME: string = "Proxy";
|
||||
}
|
||||
9
assets/common/framework/PureMVC.ts.meta
Normal file
9
assets/common/framework/PureMVC.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "dbef4031-9286-43cc-86c3-ece75d5459fd",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
25
assets/common/framework/RemoveMVC_CMD.ts
Normal file
25
assets/common/framework/RemoveMVC_CMD.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { Facade, INotification, SimpleCommand } from './PureMVC';
|
||||
|
||||
export class RemoveMVC_CMD extends SimpleCommand {
|
||||
static NAME:string = "RemoveMVC_CMD";
|
||||
execute(notifi: INotification) {
|
||||
let _facade:Facade = notifi.getBody();
|
||||
|
||||
let _mediatorMap = _facade.view["mediatorMap"];
|
||||
for (let mediatorName in _mediatorMap) {
|
||||
_facade.removeMediator(mediatorName);
|
||||
}
|
||||
|
||||
let _commandMap = _facade.controller["commandMap"];
|
||||
for (let cmdName in _commandMap) {
|
||||
_facade.removeCommand(cmdName);
|
||||
}
|
||||
|
||||
let _proxyMap = _facade.model["proxyMap"];
|
||||
for (let proxyName in _proxyMap) {
|
||||
_facade.removeProxy(proxyName);
|
||||
}
|
||||
|
||||
Facade.instance = null;
|
||||
}
|
||||
}
|
||||
9
assets/common/framework/RemoveMVC_CMD.ts.meta
Normal file
9
assets/common/framework/RemoveMVC_CMD.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "8d75053b-7f1a-4a67-9730-5001b33f7998",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
8922
assets/common/framework/protobuf.js
Normal file
8922
assets/common/framework/protobuf.js
Normal file
File diff suppressed because it is too large
Load Diff
9
assets/common/framework/protobuf.js.meta
Normal file
9
assets/common/framework/protobuf.js.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "64bba697-175d-4a84-bafb-041103af035d",
|
||||
"isPlugin": true,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": true,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/net.meta
Normal file
12
assets/common/net.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "50339c5f-8ee6-4f10-bca2-8e44d4e4bb40",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
41
assets/common/net/CovertUtil.ts
Normal file
41
assets/common/net/CovertUtil.ts
Normal file
@ -0,0 +1,41 @@
|
||||
//uint8转string
|
||||
function Uint8ArrayToString(fileData:Uint8Array){
|
||||
var dataString = "";
|
||||
for (var i = 0; i < fileData.length; i++) {
|
||||
dataString += String.fromCharCode(fileData[i]);
|
||||
}
|
||||
|
||||
return dataString
|
||||
|
||||
}
|
||||
|
||||
//string 转uint8
|
||||
function StringToUint8Array(str:string):Uint8Array{
|
||||
var arr = [];
|
||||
for (var i = 0, j = str.length; i < j; ++i) {
|
||||
arr.push(str.charCodeAt(i));
|
||||
}
|
||||
|
||||
var tmpUint8Array = new Uint8Array(arr);
|
||||
return tmpUint8Array
|
||||
}
|
||||
|
||||
function deepCopy(obj:any): any {
|
||||
const copy = Object.create(Object.getPrototypeOf(obj))
|
||||
var keys = Object.getOwnPropertyNames(obj)
|
||||
keys.forEach(key => {
|
||||
let descriptor = Object.getOwnPropertyDescriptor(obj,key)
|
||||
if(descriptor)
|
||||
{
|
||||
if(Object.prototype.toString.call(descriptor.value)=="[object Object]")
|
||||
{
|
||||
descriptor.value = deepCopy(descriptor.value)
|
||||
}
|
||||
Object.defineProperty(copy,key,descriptor)
|
||||
}
|
||||
|
||||
})
|
||||
return copy
|
||||
}
|
||||
|
||||
export {Uint8ArrayToString,StringToUint8Array,deepCopy}
|
||||
9
assets/common/net/CovertUtil.ts.meta
Normal file
9
assets/common/net/CovertUtil.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "f48550d4-8afb-4a28-a109-dc3e1226d897",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
84
assets/common/net/httpManager.ts
Normal file
84
assets/common/net/httpManager.ts
Normal file
@ -0,0 +1,84 @@
|
||||
import { StringToUint8Array, Uint8ArrayToString } from './CovertUtil';
|
||||
import pbUtile ,{MsgGameStruct} from './protobufUtil'
|
||||
|
||||
export default class httpManager{
|
||||
_name:string;
|
||||
_url:string; //
|
||||
_route:string;//url标签
|
||||
_token:string;//
|
||||
constructor(name:string){
|
||||
this._name = name
|
||||
this._token = ""
|
||||
}
|
||||
//配置服务器
|
||||
setUrlPort(url:string,route:string){
|
||||
this._url = url;
|
||||
this._route = route
|
||||
}
|
||||
setTokenStr(token:string){
|
||||
this._token = token
|
||||
}
|
||||
static getNormal(url:string,callback:Function)//普通获取http
|
||||
{
|
||||
let xhr = new XMLHttpRequest();
|
||||
let urlSave = url
|
||||
xhr.onreadystatechange = function () {
|
||||
cc.log('xhr.readyState=' + xhr.readyState + ' xhr.status=' + xhr.status);
|
||||
if (xhr.readyState === 4) {
|
||||
if(xhr.status == 200)
|
||||
{
|
||||
let respone = xhr.responseText;
|
||||
callback(respone);
|
||||
}
|
||||
else {
|
||||
callback(undefined);
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.open('GET', url, true);
|
||||
xhr.timeout = 8000;// 8 seconds for timeout
|
||||
xhr.send();
|
||||
}
|
||||
//发送消息体到服务器
|
||||
sendPostPbMessage(mainId:number,subId:number,pbBody:Uint8Array|null,callback){
|
||||
let fullUrl = "http://"+this._url+this._route;
|
||||
|
||||
let ui8Package = pbUtile.SendMsgWithToken(this._token,mainId,subId,pbBody)
|
||||
let xhr = new XMLHttpRequest();
|
||||
let _this = this;
|
||||
xhr.onreadystatechange = function () {
|
||||
cc.log('xhr.readyState=' + xhr.readyState + ' xhr.status=' + xhr.status);
|
||||
if (xhr.readyState === 4 && xhr.status == 200) {
|
||||
let respone = xhr.responseText;
|
||||
if(respone==null)
|
||||
callback({mainId:-1,subId:0,msgBody:new Uint8Array()})
|
||||
else
|
||||
{
|
||||
console.log("消息返回完成")
|
||||
let tb = pbUtile.DeCodeBodyMsg(StringToUint8Array(respone))
|
||||
if(tb.a==0)//消息体不匹配
|
||||
callback({mainId:-1,subId:0,msgBody:new Uint8Array()})
|
||||
else{
|
||||
let opt = pbUtile.GetMsgHeadBody(tb.b)
|
||||
callback(opt)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (xhr.readyState === 4)
|
||||
{
|
||||
callback({mainId:-2,subId:0,msgBody:new Uint8Array()})
|
||||
console.log("没有收到正常消息返回 readyState:"+xhr.readyState+" status:"+xhr.status)
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.withCredentials = false;
|
||||
xhr.open('POST', fullUrl, true);
|
||||
xhr.setRequestHeader("Content-Type", "application/x-protobuf");
|
||||
|
||||
xhr.timeout = 8000;// 8 seconds for timeout
|
||||
console.log("post-msg:",fullUrl,mainId,subId)
|
||||
xhr.send(Uint8ArrayToString(ui8Package));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
9
assets/common/net/httpManager.ts.meta
Normal file
9
assets/common/net/httpManager.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "ca90eee6-4eb7-41b6-9f5f-345f4f867225",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/net/pb.meta
Normal file
12
assets/common/net/pb.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "936ea61a-a1f3-4378-a70b-2129d9402b77",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
45
assets/common/net/pb/base.proto
Normal file
45
assets/common/net/pb/base.proto
Normal file
@ -0,0 +1,45 @@
|
||||
syntax = "proto3";
|
||||
package baseproto;
|
||||
|
||||
enum ENUM_MAIN_ID {
|
||||
UNUSED = 0;//无效
|
||||
TOKEN_ID = 1;//
|
||||
LOGIN_ID = 2;//登录
|
||||
HALL_ID = 3;//大厅
|
||||
GAME_ID = 4;//大厅
|
||||
}
|
||||
|
||||
enum ENUM_ERRO_ID{
|
||||
PACKAGE_ERRO = -1; //包体错误
|
||||
MAIN_SUB_ERRO = -2; //消息号错误
|
||||
BODY_ERRO = -3; //消息体错误
|
||||
DB_ERRO = -4; //数据库错误
|
||||
}
|
||||
|
||||
message Msg_Head
|
||||
{
|
||||
|
||||
uint32 wMainCmdID = 1; //主命令码
|
||||
uint32 wSubCmdID = 2; //子命令码
|
||||
bytes msgBody = 3;
|
||||
}
|
||||
|
||||
message Msg_TokenBody
|
||||
{
|
||||
string strToken = 1; //token
|
||||
bytes msgBody = 2; //消息体
|
||||
}
|
||||
//消息
|
||||
message Msg_Info
|
||||
{
|
||||
uint32 cbDataKind = 1; //数据类型
|
||||
uint32 wPacketSize = 2; //数据大小
|
||||
bytes msgBuff = 3; //可变消息体
|
||||
}
|
||||
|
||||
|
||||
message MsgBodyErro //mainId :0 subId:0
|
||||
{
|
||||
uint32 code = 1;//错误码
|
||||
string disp = 2;//错误描述
|
||||
}
|
||||
5
assets/common/net/pb/base.proto.meta
Normal file
5
assets/common/net/pb/base.proto.meta
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ver": "2.0.0",
|
||||
"uuid": "af2f01dc-f2f9-4509-8b48-15a9862d04c1",
|
||||
"subMetas": {}
|
||||
}
|
||||
417
assets/common/net/pb/pbBase.d.ts
vendored
Normal file
417
assets/common/net/pb/pbBase.d.ts
vendored
Normal file
@ -0,0 +1,417 @@
|
||||
import * as $protobuf from "protobufjs";
|
||||
/** Namespace baseproto. */
|
||||
export namespace baseproto {
|
||||
|
||||
/** ENUM_MAIN_ID enum. */
|
||||
enum ENUM_MAIN_ID {
|
||||
UNUSED = 0,
|
||||
TOKEN_ID = 1,
|
||||
LOGIN_ID = 2,
|
||||
HALL_ID = 3,
|
||||
GAME_ID = 4
|
||||
}
|
||||
|
||||
/** ENUM_ERRO_ID enum. */
|
||||
enum ENUM_ERRO_ID {
|
||||
PACKAGE_ERRO = -1,
|
||||
MAIN_SUB_ERRO = -2,
|
||||
BODY_ERRO = -3,
|
||||
DB_ERRO = -4
|
||||
}
|
||||
|
||||
/** Properties of a Msg_Head. */
|
||||
interface IMsg_Head {
|
||||
|
||||
/** Msg_Head wMainCmdID */
|
||||
wMainCmdID?: (number|null);
|
||||
|
||||
/** Msg_Head wSubCmdID */
|
||||
wSubCmdID?: (number|null);
|
||||
|
||||
/** Msg_Head msgBody */
|
||||
msgBody?: (Uint8Array|null);
|
||||
}
|
||||
|
||||
/** Represents a Msg_Head. */
|
||||
class Msg_Head implements IMsg_Head {
|
||||
|
||||
/**
|
||||
* Constructs a new Msg_Head.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: baseproto.IMsg_Head);
|
||||
|
||||
/** Msg_Head wMainCmdID. */
|
||||
public wMainCmdID: number;
|
||||
|
||||
/** Msg_Head wSubCmdID. */
|
||||
public wSubCmdID: number;
|
||||
|
||||
/** Msg_Head msgBody. */
|
||||
public msgBody: Uint8Array;
|
||||
|
||||
/**
|
||||
* Creates a new Msg_Head instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
* @returns Msg_Head instance
|
||||
*/
|
||||
public static create(properties?: baseproto.IMsg_Head): baseproto.Msg_Head;
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_Head message. Does not implicitly {@link baseproto.Msg_Head.verify|verify} messages.
|
||||
* @param message Msg_Head message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: baseproto.IMsg_Head, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_Head message, length delimited. Does not implicitly {@link baseproto.Msg_Head.verify|verify} messages.
|
||||
* @param message Msg_Head message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encodeDelimited(message: baseproto.IMsg_Head, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes a Msg_Head message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns Msg_Head
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): baseproto.Msg_Head;
|
||||
|
||||
/**
|
||||
* Decodes a Msg_Head message from the specified reader or buffer, length delimited.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @returns Msg_Head
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): baseproto.Msg_Head;
|
||||
|
||||
/**
|
||||
* Verifies a Msg_Head message.
|
||||
* @param message Plain object to verify
|
||||
* @returns `null` if valid, otherwise the reason why it is not
|
||||
*/
|
||||
public static verify(message: { [k: string]: any }): (string|null);
|
||||
|
||||
/**
|
||||
* Creates a Msg_Head message from a plain object. Also converts values to their respective internal types.
|
||||
* @param object Plain object
|
||||
* @returns Msg_Head
|
||||
*/
|
||||
public static fromObject(object: { [k: string]: any }): baseproto.Msg_Head;
|
||||
|
||||
/**
|
||||
* Creates a plain object from a Msg_Head message. Also converts values to other types if specified.
|
||||
* @param message Msg_Head
|
||||
* @param [options] Conversion options
|
||||
* @returns Plain object
|
||||
*/
|
||||
public static toObject(message: baseproto.Msg_Head, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
||||
|
||||
/**
|
||||
* Converts this Msg_Head to JSON.
|
||||
* @returns JSON object
|
||||
*/
|
||||
public toJSON(): { [k: string]: any };
|
||||
}
|
||||
|
||||
/** Properties of a Msg_TokenBody. */
|
||||
interface IMsg_TokenBody {
|
||||
|
||||
/** Msg_TokenBody strToken */
|
||||
strToken?: (string|null);
|
||||
|
||||
/** Msg_TokenBody msgBody */
|
||||
msgBody?: (Uint8Array|null);
|
||||
}
|
||||
|
||||
/** Represents a Msg_TokenBody. */
|
||||
class Msg_TokenBody implements IMsg_TokenBody {
|
||||
|
||||
/**
|
||||
* Constructs a new Msg_TokenBody.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: baseproto.IMsg_TokenBody);
|
||||
|
||||
/** Msg_TokenBody strToken. */
|
||||
public strToken: string;
|
||||
|
||||
/** Msg_TokenBody msgBody. */
|
||||
public msgBody: Uint8Array;
|
||||
|
||||
/**
|
||||
* Creates a new Msg_TokenBody instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
* @returns Msg_TokenBody instance
|
||||
*/
|
||||
public static create(properties?: baseproto.IMsg_TokenBody): baseproto.Msg_TokenBody;
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_TokenBody message. Does not implicitly {@link baseproto.Msg_TokenBody.verify|verify} messages.
|
||||
* @param message Msg_TokenBody message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: baseproto.IMsg_TokenBody, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_TokenBody message, length delimited. Does not implicitly {@link baseproto.Msg_TokenBody.verify|verify} messages.
|
||||
* @param message Msg_TokenBody message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encodeDelimited(message: baseproto.IMsg_TokenBody, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes a Msg_TokenBody message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns Msg_TokenBody
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): baseproto.Msg_TokenBody;
|
||||
|
||||
/**
|
||||
* Decodes a Msg_TokenBody message from the specified reader or buffer, length delimited.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @returns Msg_TokenBody
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): baseproto.Msg_TokenBody;
|
||||
|
||||
/**
|
||||
* Verifies a Msg_TokenBody message.
|
||||
* @param message Plain object to verify
|
||||
* @returns `null` if valid, otherwise the reason why it is not
|
||||
*/
|
||||
public static verify(message: { [k: string]: any }): (string|null);
|
||||
|
||||
/**
|
||||
* Creates a Msg_TokenBody message from a plain object. Also converts values to their respective internal types.
|
||||
* @param object Plain object
|
||||
* @returns Msg_TokenBody
|
||||
*/
|
||||
public static fromObject(object: { [k: string]: any }): baseproto.Msg_TokenBody;
|
||||
|
||||
/**
|
||||
* Creates a plain object from a Msg_TokenBody message. Also converts values to other types if specified.
|
||||
* @param message Msg_TokenBody
|
||||
* @param [options] Conversion options
|
||||
* @returns Plain object
|
||||
*/
|
||||
public static toObject(message: baseproto.Msg_TokenBody, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
||||
|
||||
/**
|
||||
* Converts this Msg_TokenBody to JSON.
|
||||
* @returns JSON object
|
||||
*/
|
||||
public toJSON(): { [k: string]: any };
|
||||
}
|
||||
|
||||
/** Properties of a Msg_Info. */
|
||||
interface IMsg_Info {
|
||||
|
||||
/** Msg_Info cbDataKind */
|
||||
cbDataKind?: (number|null);
|
||||
|
||||
/** Msg_Info wPacketSize */
|
||||
wPacketSize?: (number|null);
|
||||
|
||||
/** Msg_Info msgBuff */
|
||||
msgBuff?: (Uint8Array|null);
|
||||
}
|
||||
|
||||
/** Represents a Msg_Info. */
|
||||
class Msg_Info implements IMsg_Info {
|
||||
|
||||
/**
|
||||
* Constructs a new Msg_Info.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: baseproto.IMsg_Info);
|
||||
|
||||
/** Msg_Info cbDataKind. */
|
||||
public cbDataKind: number;
|
||||
|
||||
/** Msg_Info wPacketSize. */
|
||||
public wPacketSize: number;
|
||||
|
||||
/** Msg_Info msgBuff. */
|
||||
public msgBuff: Uint8Array;
|
||||
|
||||
/**
|
||||
* Creates a new Msg_Info instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
* @returns Msg_Info instance
|
||||
*/
|
||||
public static create(properties?: baseproto.IMsg_Info): baseproto.Msg_Info;
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_Info message. Does not implicitly {@link baseproto.Msg_Info.verify|verify} messages.
|
||||
* @param message Msg_Info message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: baseproto.IMsg_Info, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_Info message, length delimited. Does not implicitly {@link baseproto.Msg_Info.verify|verify} messages.
|
||||
* @param message Msg_Info message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encodeDelimited(message: baseproto.IMsg_Info, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes a Msg_Info message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns Msg_Info
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): baseproto.Msg_Info;
|
||||
|
||||
/**
|
||||
* Decodes a Msg_Info message from the specified reader or buffer, length delimited.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @returns Msg_Info
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): baseproto.Msg_Info;
|
||||
|
||||
/**
|
||||
* Verifies a Msg_Info message.
|
||||
* @param message Plain object to verify
|
||||
* @returns `null` if valid, otherwise the reason why it is not
|
||||
*/
|
||||
public static verify(message: { [k: string]: any }): (string|null);
|
||||
|
||||
/**
|
||||
* Creates a Msg_Info message from a plain object. Also converts values to their respective internal types.
|
||||
* @param object Plain object
|
||||
* @returns Msg_Info
|
||||
*/
|
||||
public static fromObject(object: { [k: string]: any }): baseproto.Msg_Info;
|
||||
|
||||
/**
|
||||
* Creates a plain object from a Msg_Info message. Also converts values to other types if specified.
|
||||
* @param message Msg_Info
|
||||
* @param [options] Conversion options
|
||||
* @returns Plain object
|
||||
*/
|
||||
public static toObject(message: baseproto.Msg_Info, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
||||
|
||||
/**
|
||||
* Converts this Msg_Info to JSON.
|
||||
* @returns JSON object
|
||||
*/
|
||||
public toJSON(): { [k: string]: any };
|
||||
}
|
||||
|
||||
/** Properties of a MsgBodyErro. */
|
||||
interface IMsgBodyErro {
|
||||
|
||||
/** MsgBodyErro code */
|
||||
code?: (number|null);
|
||||
|
||||
/** MsgBodyErro disp */
|
||||
disp?: (string|null);
|
||||
}
|
||||
|
||||
/** Represents a MsgBodyErro. */
|
||||
class MsgBodyErro implements IMsgBodyErro {
|
||||
|
||||
/**
|
||||
* Constructs a new MsgBodyErro.
|
||||
* @param [properties] Properties to set
|
||||
*/
|
||||
constructor(properties?: baseproto.IMsgBodyErro);
|
||||
|
||||
/** MsgBodyErro code. */
|
||||
public code: number;
|
||||
|
||||
/** MsgBodyErro disp. */
|
||||
public disp: string;
|
||||
|
||||
/**
|
||||
* Creates a new MsgBodyErro instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
* @returns MsgBodyErro instance
|
||||
*/
|
||||
public static create(properties?: baseproto.IMsgBodyErro): baseproto.MsgBodyErro;
|
||||
|
||||
/**
|
||||
* Encodes the specified MsgBodyErro message. Does not implicitly {@link baseproto.MsgBodyErro.verify|verify} messages.
|
||||
* @param message MsgBodyErro message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encode(message: baseproto.IMsgBodyErro, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Encodes the specified MsgBodyErro message, length delimited. Does not implicitly {@link baseproto.MsgBodyErro.verify|verify} messages.
|
||||
* @param message MsgBodyErro message or plain object to encode
|
||||
* @param [writer] Writer to encode to
|
||||
* @returns Writer
|
||||
*/
|
||||
public static encodeDelimited(message: baseproto.IMsgBodyErro, writer?: $protobuf.Writer): $protobuf.Writer;
|
||||
|
||||
/**
|
||||
* Decodes a MsgBodyErro message from the specified reader or buffer.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @param [length] Message length if known beforehand
|
||||
* @returns MsgBodyErro
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): baseproto.MsgBodyErro;
|
||||
|
||||
/**
|
||||
* Decodes a MsgBodyErro message from the specified reader or buffer, length delimited.
|
||||
* @param reader Reader or buffer to decode from
|
||||
* @returns MsgBodyErro
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): baseproto.MsgBodyErro;
|
||||
|
||||
/**
|
||||
* Verifies a MsgBodyErro message.
|
||||
* @param message Plain object to verify
|
||||
* @returns `null` if valid, otherwise the reason why it is not
|
||||
*/
|
||||
public static verify(message: { [k: string]: any }): (string|null);
|
||||
|
||||
/**
|
||||
* Creates a MsgBodyErro message from a plain object. Also converts values to their respective internal types.
|
||||
* @param object Plain object
|
||||
* @returns MsgBodyErro
|
||||
*/
|
||||
public static fromObject(object: { [k: string]: any }): baseproto.MsgBodyErro;
|
||||
|
||||
/**
|
||||
* Creates a plain object from a MsgBodyErro message. Also converts values to other types if specified.
|
||||
* @param message MsgBodyErro
|
||||
* @param [options] Conversion options
|
||||
* @returns Plain object
|
||||
*/
|
||||
public static toObject(message: baseproto.MsgBodyErro, options?: $protobuf.IConversionOptions): { [k: string]: any };
|
||||
|
||||
/**
|
||||
* Converts this MsgBodyErro to JSON.
|
||||
* @returns JSON object
|
||||
*/
|
||||
public toJSON(): { [k: string]: any };
|
||||
}
|
||||
}
|
||||
5
assets/common/net/pb/pbBase.d.ts.meta
Normal file
5
assets/common/net/pb/pbBase.d.ts.meta
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ver": "2.0.0",
|
||||
"uuid": "c2486089-8583-4153-80d6-0e5eb9718819",
|
||||
"subMetas": {}
|
||||
}
|
||||
973
assets/common/net/pb/pbBase.js
Normal file
973
assets/common/net/pb/pbBase.js
Normal file
@ -0,0 +1,973 @@
|
||||
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
|
||||
"use strict";
|
||||
|
||||
var $protobuf = protobuf;
|
||||
|
||||
// Common aliases
|
||||
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
||||
|
||||
// Exported root namespace
|
||||
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
|
||||
|
||||
$root.baseproto = (function() {
|
||||
|
||||
/**
|
||||
* Namespace baseproto.
|
||||
* @exports baseproto
|
||||
* @namespace
|
||||
*/
|
||||
var baseproto = {};
|
||||
|
||||
/**
|
||||
* ENUM_MAIN_ID enum.
|
||||
* @name baseproto.ENUM_MAIN_ID
|
||||
* @enum {number}
|
||||
* @property {number} UNUSED=0 UNUSED value
|
||||
* @property {number} TOKEN_ID=1 TOKEN_ID value
|
||||
* @property {number} LOGIN_ID=2 LOGIN_ID value
|
||||
* @property {number} HALL_ID=3 HALL_ID value
|
||||
* @property {number} GAME_ID=4 GAME_ID value
|
||||
*/
|
||||
baseproto.ENUM_MAIN_ID = (function() {
|
||||
var valuesById = {}, values = Object.create(valuesById);
|
||||
values[valuesById[0] = "UNUSED"] = 0;
|
||||
values[valuesById[1] = "TOKEN_ID"] = 1;
|
||||
values[valuesById[2] = "LOGIN_ID"] = 2;
|
||||
values[valuesById[3] = "HALL_ID"] = 3;
|
||||
values[valuesById[4] = "GAME_ID"] = 4;
|
||||
return values;
|
||||
})();
|
||||
|
||||
/**
|
||||
* ENUM_ERRO_ID enum.
|
||||
* @name baseproto.ENUM_ERRO_ID
|
||||
* @enum {number}
|
||||
* @property {number} PACKAGE_ERRO=-1 PACKAGE_ERRO value
|
||||
* @property {number} MAIN_SUB_ERRO=-2 MAIN_SUB_ERRO value
|
||||
* @property {number} BODY_ERRO=-3 BODY_ERRO value
|
||||
* @property {number} DB_ERRO=-4 DB_ERRO value
|
||||
*/
|
||||
baseproto.ENUM_ERRO_ID = (function() {
|
||||
var valuesById = {}, values = Object.create(valuesById);
|
||||
values[valuesById[-1] = "PACKAGE_ERRO"] = -1;
|
||||
values[valuesById[-2] = "MAIN_SUB_ERRO"] = -2;
|
||||
values[valuesById[-3] = "BODY_ERRO"] = -3;
|
||||
values[valuesById[-4] = "DB_ERRO"] = -4;
|
||||
return values;
|
||||
})();
|
||||
|
||||
baseproto.Msg_Head = (function() {
|
||||
|
||||
/**
|
||||
* Properties of a Msg_Head.
|
||||
* @memberof baseproto
|
||||
* @interface IMsg_Head
|
||||
* @property {number|null} [wMainCmdID] Msg_Head wMainCmdID
|
||||
* @property {number|null} [wSubCmdID] Msg_Head wSubCmdID
|
||||
* @property {Uint8Array|null} [msgBody] Msg_Head msgBody
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new Msg_Head.
|
||||
* @memberof baseproto
|
||||
* @classdesc Represents a Msg_Head.
|
||||
* @implements IMsg_Head
|
||||
* @constructor
|
||||
* @param {baseproto.IMsg_Head=} [properties] Properties to set
|
||||
*/
|
||||
function Msg_Head(properties) {
|
||||
if (properties)
|
||||
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Msg_Head wMainCmdID.
|
||||
* @member {number} wMainCmdID
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @instance
|
||||
*/
|
||||
Msg_Head.prototype.wMainCmdID = 0;
|
||||
|
||||
/**
|
||||
* Msg_Head wSubCmdID.
|
||||
* @member {number} wSubCmdID
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @instance
|
||||
*/
|
||||
Msg_Head.prototype.wSubCmdID = 0;
|
||||
|
||||
/**
|
||||
* Msg_Head msgBody.
|
||||
* @member {Uint8Array} msgBody
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @instance
|
||||
*/
|
||||
Msg_Head.prototype.msgBody = $util.newBuffer([]);
|
||||
|
||||
/**
|
||||
* Creates a new Msg_Head instance using the specified properties.
|
||||
* @function create
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @static
|
||||
* @param {baseproto.IMsg_Head=} [properties] Properties to set
|
||||
* @returns {baseproto.Msg_Head} Msg_Head instance
|
||||
*/
|
||||
Msg_Head.create = function create(properties) {
|
||||
return new Msg_Head(properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_Head message. Does not implicitly {@link baseproto.Msg_Head.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @static
|
||||
* @param {baseproto.IMsg_Head} message Msg_Head message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Msg_Head.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.wMainCmdID != null && Object.hasOwnProperty.call(message, "wMainCmdID"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.wMainCmdID);
|
||||
if (message.wSubCmdID != null && Object.hasOwnProperty.call(message, "wSubCmdID"))
|
||||
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.wSubCmdID);
|
||||
if (message.msgBody != null && Object.hasOwnProperty.call(message, "msgBody"))
|
||||
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.msgBody);
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_Head message, length delimited. Does not implicitly {@link baseproto.Msg_Head.verify|verify} messages.
|
||||
* @function encodeDelimited
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @static
|
||||
* @param {baseproto.IMsg_Head} message Msg_Head message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Msg_Head.encodeDelimited = function encodeDelimited(message, writer) {
|
||||
return this.encode(message, writer).ldelim();
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes a Msg_Head message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {baseproto.Msg_Head} Msg_Head
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Msg_Head.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.baseproto.Msg_Head();
|
||||
while (reader.pos < end) {
|
||||
var tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.wMainCmdID = reader.uint32();
|
||||
break;
|
||||
case 2:
|
||||
message.wSubCmdID = reader.uint32();
|
||||
break;
|
||||
case 3:
|
||||
message.msgBody = reader.bytes();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes a Msg_Head message from the specified reader or buffer, length delimited.
|
||||
* @function decodeDelimited
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @returns {baseproto.Msg_Head} Msg_Head
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Msg_Head.decodeDelimited = function decodeDelimited(reader) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = new $Reader(reader);
|
||||
return this.decode(reader, reader.uint32());
|
||||
};
|
||||
|
||||
/**
|
||||
* Verifies a Msg_Head message.
|
||||
* @function verify
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @static
|
||||
* @param {Object.<string,*>} message Plain object to verify
|
||||
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
||||
*/
|
||||
Msg_Head.verify = function verify(message) {
|
||||
if (typeof message !== "object" || message === null)
|
||||
return "object expected";
|
||||
if (message.wMainCmdID != null && message.hasOwnProperty("wMainCmdID"))
|
||||
if (!$util.isInteger(message.wMainCmdID))
|
||||
return "wMainCmdID: integer expected";
|
||||
if (message.wSubCmdID != null && message.hasOwnProperty("wSubCmdID"))
|
||||
if (!$util.isInteger(message.wSubCmdID))
|
||||
return "wSubCmdID: integer expected";
|
||||
if (message.msgBody != null && message.hasOwnProperty("msgBody"))
|
||||
if (!(message.msgBody && typeof message.msgBody.length === "number" || $util.isString(message.msgBody)))
|
||||
return "msgBody: buffer expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a Msg_Head message from a plain object. Also converts values to their respective internal types.
|
||||
* @function fromObject
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @static
|
||||
* @param {Object.<string,*>} object Plain object
|
||||
* @returns {baseproto.Msg_Head} Msg_Head
|
||||
*/
|
||||
Msg_Head.fromObject = function fromObject(object) {
|
||||
if (object instanceof $root.baseproto.Msg_Head)
|
||||
return object;
|
||||
var message = new $root.baseproto.Msg_Head();
|
||||
if (object.wMainCmdID != null)
|
||||
message.wMainCmdID = object.wMainCmdID >>> 0;
|
||||
if (object.wSubCmdID != null)
|
||||
message.wSubCmdID = object.wSubCmdID >>> 0;
|
||||
if (object.msgBody != null)
|
||||
if (typeof object.msgBody === "string")
|
||||
$util.base64.decode(object.msgBody, message.msgBody = $util.newBuffer($util.base64.length(object.msgBody)), 0);
|
||||
else if (object.msgBody.length)
|
||||
message.msgBody = object.msgBody;
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a plain object from a Msg_Head message. Also converts values to other types if specified.
|
||||
* @function toObject
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @static
|
||||
* @param {baseproto.Msg_Head} message Msg_Head
|
||||
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
||||
* @returns {Object.<string,*>} Plain object
|
||||
*/
|
||||
Msg_Head.toObject = function toObject(message, options) {
|
||||
if (!options)
|
||||
options = {};
|
||||
var object = {};
|
||||
if (options.defaults) {
|
||||
object.wMainCmdID = 0;
|
||||
object.wSubCmdID = 0;
|
||||
if (options.bytes === String)
|
||||
object.msgBody = "";
|
||||
else {
|
||||
object.msgBody = [];
|
||||
if (options.bytes !== Array)
|
||||
object.msgBody = $util.newBuffer(object.msgBody);
|
||||
}
|
||||
}
|
||||
if (message.wMainCmdID != null && message.hasOwnProperty("wMainCmdID"))
|
||||
object.wMainCmdID = message.wMainCmdID;
|
||||
if (message.wSubCmdID != null && message.hasOwnProperty("wSubCmdID"))
|
||||
object.wSubCmdID = message.wSubCmdID;
|
||||
if (message.msgBody != null && message.hasOwnProperty("msgBody"))
|
||||
object.msgBody = options.bytes === String ? $util.base64.encode(message.msgBody, 0, message.msgBody.length) : options.bytes === Array ? Array.prototype.slice.call(message.msgBody) : message.msgBody;
|
||||
return object;
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts this Msg_Head to JSON.
|
||||
* @function toJSON
|
||||
* @memberof baseproto.Msg_Head
|
||||
* @instance
|
||||
* @returns {Object.<string,*>} JSON object
|
||||
*/
|
||||
Msg_Head.prototype.toJSON = function toJSON() {
|
||||
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
||||
};
|
||||
|
||||
return Msg_Head;
|
||||
})();
|
||||
|
||||
baseproto.Msg_TokenBody = (function() {
|
||||
|
||||
/**
|
||||
* Properties of a Msg_TokenBody.
|
||||
* @memberof baseproto
|
||||
* @interface IMsg_TokenBody
|
||||
* @property {string|null} [strToken] Msg_TokenBody strToken
|
||||
* @property {Uint8Array|null} [msgBody] Msg_TokenBody msgBody
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new Msg_TokenBody.
|
||||
* @memberof baseproto
|
||||
* @classdesc Represents a Msg_TokenBody.
|
||||
* @implements IMsg_TokenBody
|
||||
* @constructor
|
||||
* @param {baseproto.IMsg_TokenBody=} [properties] Properties to set
|
||||
*/
|
||||
function Msg_TokenBody(properties) {
|
||||
if (properties)
|
||||
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Msg_TokenBody strToken.
|
||||
* @member {string} strToken
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @instance
|
||||
*/
|
||||
Msg_TokenBody.prototype.strToken = "";
|
||||
|
||||
/**
|
||||
* Msg_TokenBody msgBody.
|
||||
* @member {Uint8Array} msgBody
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @instance
|
||||
*/
|
||||
Msg_TokenBody.prototype.msgBody = $util.newBuffer([]);
|
||||
|
||||
/**
|
||||
* Creates a new Msg_TokenBody instance using the specified properties.
|
||||
* @function create
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @static
|
||||
* @param {baseproto.IMsg_TokenBody=} [properties] Properties to set
|
||||
* @returns {baseproto.Msg_TokenBody} Msg_TokenBody instance
|
||||
*/
|
||||
Msg_TokenBody.create = function create(properties) {
|
||||
return new Msg_TokenBody(properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_TokenBody message. Does not implicitly {@link baseproto.Msg_TokenBody.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @static
|
||||
* @param {baseproto.IMsg_TokenBody} message Msg_TokenBody message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Msg_TokenBody.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.strToken != null && Object.hasOwnProperty.call(message, "strToken"))
|
||||
writer.uint32(/* id 1, wireType 2 =*/10).string(message.strToken);
|
||||
if (message.msgBody != null && Object.hasOwnProperty.call(message, "msgBody"))
|
||||
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.msgBody);
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_TokenBody message, length delimited. Does not implicitly {@link baseproto.Msg_TokenBody.verify|verify} messages.
|
||||
* @function encodeDelimited
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @static
|
||||
* @param {baseproto.IMsg_TokenBody} message Msg_TokenBody message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Msg_TokenBody.encodeDelimited = function encodeDelimited(message, writer) {
|
||||
return this.encode(message, writer).ldelim();
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes a Msg_TokenBody message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {baseproto.Msg_TokenBody} Msg_TokenBody
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Msg_TokenBody.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.baseproto.Msg_TokenBody();
|
||||
while (reader.pos < end) {
|
||||
var tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.strToken = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.msgBody = reader.bytes();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes a Msg_TokenBody message from the specified reader or buffer, length delimited.
|
||||
* @function decodeDelimited
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @returns {baseproto.Msg_TokenBody} Msg_TokenBody
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Msg_TokenBody.decodeDelimited = function decodeDelimited(reader) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = new $Reader(reader);
|
||||
return this.decode(reader, reader.uint32());
|
||||
};
|
||||
|
||||
/**
|
||||
* Verifies a Msg_TokenBody message.
|
||||
* @function verify
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @static
|
||||
* @param {Object.<string,*>} message Plain object to verify
|
||||
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
||||
*/
|
||||
Msg_TokenBody.verify = function verify(message) {
|
||||
if (typeof message !== "object" || message === null)
|
||||
return "object expected";
|
||||
if (message.strToken != null && message.hasOwnProperty("strToken"))
|
||||
if (!$util.isString(message.strToken))
|
||||
return "strToken: string expected";
|
||||
if (message.msgBody != null && message.hasOwnProperty("msgBody"))
|
||||
if (!(message.msgBody && typeof message.msgBody.length === "number" || $util.isString(message.msgBody)))
|
||||
return "msgBody: buffer expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a Msg_TokenBody message from a plain object. Also converts values to their respective internal types.
|
||||
* @function fromObject
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @static
|
||||
* @param {Object.<string,*>} object Plain object
|
||||
* @returns {baseproto.Msg_TokenBody} Msg_TokenBody
|
||||
*/
|
||||
Msg_TokenBody.fromObject = function fromObject(object) {
|
||||
if (object instanceof $root.baseproto.Msg_TokenBody)
|
||||
return object;
|
||||
var message = new $root.baseproto.Msg_TokenBody();
|
||||
if (object.strToken != null)
|
||||
message.strToken = String(object.strToken);
|
||||
if (object.msgBody != null)
|
||||
if (typeof object.msgBody === "string")
|
||||
$util.base64.decode(object.msgBody, message.msgBody = $util.newBuffer($util.base64.length(object.msgBody)), 0);
|
||||
else if (object.msgBody.length)
|
||||
message.msgBody = object.msgBody;
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a plain object from a Msg_TokenBody message. Also converts values to other types if specified.
|
||||
* @function toObject
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @static
|
||||
* @param {baseproto.Msg_TokenBody} message Msg_TokenBody
|
||||
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
||||
* @returns {Object.<string,*>} Plain object
|
||||
*/
|
||||
Msg_TokenBody.toObject = function toObject(message, options) {
|
||||
if (!options)
|
||||
options = {};
|
||||
var object = {};
|
||||
if (options.defaults) {
|
||||
object.strToken = "";
|
||||
if (options.bytes === String)
|
||||
object.msgBody = "";
|
||||
else {
|
||||
object.msgBody = [];
|
||||
if (options.bytes !== Array)
|
||||
object.msgBody = $util.newBuffer(object.msgBody);
|
||||
}
|
||||
}
|
||||
if (message.strToken != null && message.hasOwnProperty("strToken"))
|
||||
object.strToken = message.strToken;
|
||||
if (message.msgBody != null && message.hasOwnProperty("msgBody"))
|
||||
object.msgBody = options.bytes === String ? $util.base64.encode(message.msgBody, 0, message.msgBody.length) : options.bytes === Array ? Array.prototype.slice.call(message.msgBody) : message.msgBody;
|
||||
return object;
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts this Msg_TokenBody to JSON.
|
||||
* @function toJSON
|
||||
* @memberof baseproto.Msg_TokenBody
|
||||
* @instance
|
||||
* @returns {Object.<string,*>} JSON object
|
||||
*/
|
||||
Msg_TokenBody.prototype.toJSON = function toJSON() {
|
||||
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
||||
};
|
||||
|
||||
return Msg_TokenBody;
|
||||
})();
|
||||
|
||||
baseproto.Msg_Info = (function() {
|
||||
|
||||
/**
|
||||
* Properties of a Msg_Info.
|
||||
* @memberof baseproto
|
||||
* @interface IMsg_Info
|
||||
* @property {number|null} [cbDataKind] Msg_Info cbDataKind
|
||||
* @property {number|null} [wPacketSize] Msg_Info wPacketSize
|
||||
* @property {Uint8Array|null} [msgBuff] Msg_Info msgBuff
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new Msg_Info.
|
||||
* @memberof baseproto
|
||||
* @classdesc Represents a Msg_Info.
|
||||
* @implements IMsg_Info
|
||||
* @constructor
|
||||
* @param {baseproto.IMsg_Info=} [properties] Properties to set
|
||||
*/
|
||||
function Msg_Info(properties) {
|
||||
if (properties)
|
||||
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Msg_Info cbDataKind.
|
||||
* @member {number} cbDataKind
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @instance
|
||||
*/
|
||||
Msg_Info.prototype.cbDataKind = 0;
|
||||
|
||||
/**
|
||||
* Msg_Info wPacketSize.
|
||||
* @member {number} wPacketSize
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @instance
|
||||
*/
|
||||
Msg_Info.prototype.wPacketSize = 0;
|
||||
|
||||
/**
|
||||
* Msg_Info msgBuff.
|
||||
* @member {Uint8Array} msgBuff
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @instance
|
||||
*/
|
||||
Msg_Info.prototype.msgBuff = $util.newBuffer([]);
|
||||
|
||||
/**
|
||||
* Creates a new Msg_Info instance using the specified properties.
|
||||
* @function create
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @static
|
||||
* @param {baseproto.IMsg_Info=} [properties] Properties to set
|
||||
* @returns {baseproto.Msg_Info} Msg_Info instance
|
||||
*/
|
||||
Msg_Info.create = function create(properties) {
|
||||
return new Msg_Info(properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_Info message. Does not implicitly {@link baseproto.Msg_Info.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @static
|
||||
* @param {baseproto.IMsg_Info} message Msg_Info message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Msg_Info.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.cbDataKind != null && Object.hasOwnProperty.call(message, "cbDataKind"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.cbDataKind);
|
||||
if (message.wPacketSize != null && Object.hasOwnProperty.call(message, "wPacketSize"))
|
||||
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.wPacketSize);
|
||||
if (message.msgBuff != null && Object.hasOwnProperty.call(message, "msgBuff"))
|
||||
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.msgBuff);
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Encodes the specified Msg_Info message, length delimited. Does not implicitly {@link baseproto.Msg_Info.verify|verify} messages.
|
||||
* @function encodeDelimited
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @static
|
||||
* @param {baseproto.IMsg_Info} message Msg_Info message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
Msg_Info.encodeDelimited = function encodeDelimited(message, writer) {
|
||||
return this.encode(message, writer).ldelim();
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes a Msg_Info message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {baseproto.Msg_Info} Msg_Info
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Msg_Info.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.baseproto.Msg_Info();
|
||||
while (reader.pos < end) {
|
||||
var tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.cbDataKind = reader.uint32();
|
||||
break;
|
||||
case 2:
|
||||
message.wPacketSize = reader.uint32();
|
||||
break;
|
||||
case 3:
|
||||
message.msgBuff = reader.bytes();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes a Msg_Info message from the specified reader or buffer, length delimited.
|
||||
* @function decodeDelimited
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @returns {baseproto.Msg_Info} Msg_Info
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
Msg_Info.decodeDelimited = function decodeDelimited(reader) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = new $Reader(reader);
|
||||
return this.decode(reader, reader.uint32());
|
||||
};
|
||||
|
||||
/**
|
||||
* Verifies a Msg_Info message.
|
||||
* @function verify
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @static
|
||||
* @param {Object.<string,*>} message Plain object to verify
|
||||
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
||||
*/
|
||||
Msg_Info.verify = function verify(message) {
|
||||
if (typeof message !== "object" || message === null)
|
||||
return "object expected";
|
||||
if (message.cbDataKind != null && message.hasOwnProperty("cbDataKind"))
|
||||
if (!$util.isInteger(message.cbDataKind))
|
||||
return "cbDataKind: integer expected";
|
||||
if (message.wPacketSize != null && message.hasOwnProperty("wPacketSize"))
|
||||
if (!$util.isInteger(message.wPacketSize))
|
||||
return "wPacketSize: integer expected";
|
||||
if (message.msgBuff != null && message.hasOwnProperty("msgBuff"))
|
||||
if (!(message.msgBuff && typeof message.msgBuff.length === "number" || $util.isString(message.msgBuff)))
|
||||
return "msgBuff: buffer expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a Msg_Info message from a plain object. Also converts values to their respective internal types.
|
||||
* @function fromObject
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @static
|
||||
* @param {Object.<string,*>} object Plain object
|
||||
* @returns {baseproto.Msg_Info} Msg_Info
|
||||
*/
|
||||
Msg_Info.fromObject = function fromObject(object) {
|
||||
if (object instanceof $root.baseproto.Msg_Info)
|
||||
return object;
|
||||
var message = new $root.baseproto.Msg_Info();
|
||||
if (object.cbDataKind != null)
|
||||
message.cbDataKind = object.cbDataKind >>> 0;
|
||||
if (object.wPacketSize != null)
|
||||
message.wPacketSize = object.wPacketSize >>> 0;
|
||||
if (object.msgBuff != null)
|
||||
if (typeof object.msgBuff === "string")
|
||||
$util.base64.decode(object.msgBuff, message.msgBuff = $util.newBuffer($util.base64.length(object.msgBuff)), 0);
|
||||
else if (object.msgBuff.length)
|
||||
message.msgBuff = object.msgBuff;
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a plain object from a Msg_Info message. Also converts values to other types if specified.
|
||||
* @function toObject
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @static
|
||||
* @param {baseproto.Msg_Info} message Msg_Info
|
||||
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
||||
* @returns {Object.<string,*>} Plain object
|
||||
*/
|
||||
Msg_Info.toObject = function toObject(message, options) {
|
||||
if (!options)
|
||||
options = {};
|
||||
var object = {};
|
||||
if (options.defaults) {
|
||||
object.cbDataKind = 0;
|
||||
object.wPacketSize = 0;
|
||||
if (options.bytes === String)
|
||||
object.msgBuff = "";
|
||||
else {
|
||||
object.msgBuff = [];
|
||||
if (options.bytes !== Array)
|
||||
object.msgBuff = $util.newBuffer(object.msgBuff);
|
||||
}
|
||||
}
|
||||
if (message.cbDataKind != null && message.hasOwnProperty("cbDataKind"))
|
||||
object.cbDataKind = message.cbDataKind;
|
||||
if (message.wPacketSize != null && message.hasOwnProperty("wPacketSize"))
|
||||
object.wPacketSize = message.wPacketSize;
|
||||
if (message.msgBuff != null && message.hasOwnProperty("msgBuff"))
|
||||
object.msgBuff = options.bytes === String ? $util.base64.encode(message.msgBuff, 0, message.msgBuff.length) : options.bytes === Array ? Array.prototype.slice.call(message.msgBuff) : message.msgBuff;
|
||||
return object;
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts this Msg_Info to JSON.
|
||||
* @function toJSON
|
||||
* @memberof baseproto.Msg_Info
|
||||
* @instance
|
||||
* @returns {Object.<string,*>} JSON object
|
||||
*/
|
||||
Msg_Info.prototype.toJSON = function toJSON() {
|
||||
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
||||
};
|
||||
|
||||
return Msg_Info;
|
||||
})();
|
||||
|
||||
baseproto.MsgBodyErro = (function() {
|
||||
|
||||
/**
|
||||
* Properties of a MsgBodyErro.
|
||||
* @memberof baseproto
|
||||
* @interface IMsgBodyErro
|
||||
* @property {number|null} [code] MsgBodyErro code
|
||||
* @property {string|null} [disp] MsgBodyErro disp
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new MsgBodyErro.
|
||||
* @memberof baseproto
|
||||
* @classdesc Represents a MsgBodyErro.
|
||||
* @implements IMsgBodyErro
|
||||
* @constructor
|
||||
* @param {baseproto.IMsgBodyErro=} [properties] Properties to set
|
||||
*/
|
||||
function MsgBodyErro(properties) {
|
||||
if (properties)
|
||||
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
||||
if (properties[keys[i]] != null)
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* MsgBodyErro code.
|
||||
* @member {number} code
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @instance
|
||||
*/
|
||||
MsgBodyErro.prototype.code = 0;
|
||||
|
||||
/**
|
||||
* MsgBodyErro disp.
|
||||
* @member {string} disp
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @instance
|
||||
*/
|
||||
MsgBodyErro.prototype.disp = "";
|
||||
|
||||
/**
|
||||
* Creates a new MsgBodyErro instance using the specified properties.
|
||||
* @function create
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @static
|
||||
* @param {baseproto.IMsgBodyErro=} [properties] Properties to set
|
||||
* @returns {baseproto.MsgBodyErro} MsgBodyErro instance
|
||||
*/
|
||||
MsgBodyErro.create = function create(properties) {
|
||||
return new MsgBodyErro(properties);
|
||||
};
|
||||
|
||||
/**
|
||||
* Encodes the specified MsgBodyErro message. Does not implicitly {@link baseproto.MsgBodyErro.verify|verify} messages.
|
||||
* @function encode
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @static
|
||||
* @param {baseproto.IMsgBodyErro} message MsgBodyErro message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
MsgBodyErro.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.code != null && Object.hasOwnProperty.call(message, "code"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code);
|
||||
if (message.disp != null && Object.hasOwnProperty.call(message, "disp"))
|
||||
writer.uint32(/* id 2, wireType 2 =*/18).string(message.disp);
|
||||
return writer;
|
||||
};
|
||||
|
||||
/**
|
||||
* Encodes the specified MsgBodyErro message, length delimited. Does not implicitly {@link baseproto.MsgBodyErro.verify|verify} messages.
|
||||
* @function encodeDelimited
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @static
|
||||
* @param {baseproto.IMsgBodyErro} message MsgBodyErro message or plain object to encode
|
||||
* @param {$protobuf.Writer} [writer] Writer to encode to
|
||||
* @returns {$protobuf.Writer} Writer
|
||||
*/
|
||||
MsgBodyErro.encodeDelimited = function encodeDelimited(message, writer) {
|
||||
return this.encode(message, writer).ldelim();
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes a MsgBodyErro message from the specified reader or buffer.
|
||||
* @function decode
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @param {number} [length] Message length if known beforehand
|
||||
* @returns {baseproto.MsgBodyErro} MsgBodyErro
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
MsgBodyErro.decode = function decode(reader, length) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = $Reader.create(reader);
|
||||
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.baseproto.MsgBodyErro();
|
||||
while (reader.pos < end) {
|
||||
var tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.code = reader.uint32();
|
||||
break;
|
||||
case 2:
|
||||
message.disp = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes a MsgBodyErro message from the specified reader or buffer, length delimited.
|
||||
* @function decodeDelimited
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @static
|
||||
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
||||
* @returns {baseproto.MsgBodyErro} MsgBodyErro
|
||||
* @throws {Error} If the payload is not a reader or valid buffer
|
||||
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
||||
*/
|
||||
MsgBodyErro.decodeDelimited = function decodeDelimited(reader) {
|
||||
if (!(reader instanceof $Reader))
|
||||
reader = new $Reader(reader);
|
||||
return this.decode(reader, reader.uint32());
|
||||
};
|
||||
|
||||
/**
|
||||
* Verifies a MsgBodyErro message.
|
||||
* @function verify
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @static
|
||||
* @param {Object.<string,*>} message Plain object to verify
|
||||
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
||||
*/
|
||||
MsgBodyErro.verify = function verify(message) {
|
||||
if (typeof message !== "object" || message === null)
|
||||
return "object expected";
|
||||
if (message.code != null && message.hasOwnProperty("code"))
|
||||
if (!$util.isInteger(message.code))
|
||||
return "code: integer expected";
|
||||
if (message.disp != null && message.hasOwnProperty("disp"))
|
||||
if (!$util.isString(message.disp))
|
||||
return "disp: string expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a MsgBodyErro message from a plain object. Also converts values to their respective internal types.
|
||||
* @function fromObject
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @static
|
||||
* @param {Object.<string,*>} object Plain object
|
||||
* @returns {baseproto.MsgBodyErro} MsgBodyErro
|
||||
*/
|
||||
MsgBodyErro.fromObject = function fromObject(object) {
|
||||
if (object instanceof $root.baseproto.MsgBodyErro)
|
||||
return object;
|
||||
var message = new $root.baseproto.MsgBodyErro();
|
||||
if (object.code != null)
|
||||
message.code = object.code >>> 0;
|
||||
if (object.disp != null)
|
||||
message.disp = String(object.disp);
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a plain object from a MsgBodyErro message. Also converts values to other types if specified.
|
||||
* @function toObject
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @static
|
||||
* @param {baseproto.MsgBodyErro} message MsgBodyErro
|
||||
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
||||
* @returns {Object.<string,*>} Plain object
|
||||
*/
|
||||
MsgBodyErro.toObject = function toObject(message, options) {
|
||||
if (!options)
|
||||
options = {};
|
||||
var object = {};
|
||||
if (options.defaults) {
|
||||
object.code = 0;
|
||||
object.disp = "";
|
||||
}
|
||||
if (message.code != null && message.hasOwnProperty("code"))
|
||||
object.code = message.code;
|
||||
if (message.disp != null && message.hasOwnProperty("disp"))
|
||||
object.disp = message.disp;
|
||||
return object;
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts this MsgBodyErro to JSON.
|
||||
* @function toJSON
|
||||
* @memberof baseproto.MsgBodyErro
|
||||
* @instance
|
||||
* @returns {Object.<string,*>} JSON object
|
||||
*/
|
||||
MsgBodyErro.prototype.toJSON = function toJSON() {
|
||||
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
||||
};
|
||||
|
||||
return MsgBodyErro;
|
||||
})();
|
||||
|
||||
return baseproto;
|
||||
})();
|
||||
|
||||
module.exports = $root;
|
||||
9
assets/common/net/pb/pbBase.js.meta
Normal file
9
assets/common/net/pb/pbBase.js.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "f5e4e0c4-a06d-4a20-9198-b17c450030db",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
136
assets/common/net/protobufUtil.ts
Normal file
136
assets/common/net/protobufUtil.ts
Normal file
@ -0,0 +1,136 @@
|
||||
import * as protobundle from './pb/pbBase'
|
||||
|
||||
const g_dwEncryptKey = 0x8F934167;
|
||||
const RandValueMax = 0x7fffffff;
|
||||
const DeEnCodeType = 0; //加解密类型
|
||||
|
||||
|
||||
// 定义选项
|
||||
export interface MsgGameStruct {
|
||||
mainId:number;
|
||||
subId:number;
|
||||
msgBody:Uint8Array;
|
||||
}
|
||||
|
||||
function RandSLocal(dwRandSeed:number):number
|
||||
{
|
||||
dwRandSeed = (dwRandSeed * 214013 + 2531011) & RandValueMax;
|
||||
return dwRandSeed;
|
||||
}
|
||||
|
||||
function EncryptBuffer(cbBuffer:Uint8Array, wDataSize:number):Uint8Array
|
||||
{
|
||||
let dwEncryptKey = g_dwEncryptKey + wDataSize;
|
||||
dwEncryptKey = RandSLocal(dwEncryptKey);
|
||||
|
||||
let utf8Array = new Uint8Array(wDataSize)
|
||||
for (let dwI = 0; dwI < wDataSize; dwI++)
|
||||
{
|
||||
utf8Array[dwI] += dwEncryptKey;
|
||||
}
|
||||
return utf8Array
|
||||
}
|
||||
|
||||
function DecryptBuffer(cbBuffer:Uint8Array, wDataSize:number):Uint8Array
|
||||
{
|
||||
let dwDecryptKey = g_dwEncryptKey + wDataSize;
|
||||
dwDecryptKey = RandSLocal(dwDecryptKey);
|
||||
|
||||
let utf8Array = new Uint8Array(wDataSize)
|
||||
for (let dwI = 0; dwI < wDataSize; dwI++)
|
||||
{
|
||||
utf8Array[dwI] += dwDecryptKey;
|
||||
}
|
||||
return utf8Array
|
||||
}
|
||||
|
||||
class ProtoBuffUtil{
|
||||
GetTokenStr(bodyBuf:Uint8Array)
|
||||
{
|
||||
let msgInfo = protobundle.baseproto.Msg_TokenBody.decode(bodyBuf)
|
||||
return msgInfo
|
||||
}
|
||||
// 解析方法
|
||||
GetMsgHeadBody(bodyBuf:Uint8Array):MsgGameStruct|null { //传入消息
|
||||
let buffHead = protobundle.baseproto.Msg_Head.decode(bodyBuf)
|
||||
if(buffHead==null)
|
||||
return null
|
||||
return {mainId:buffHead.wMainCmdID,subId:buffHead.wSubCmdID,msgBody:buffHead.msgBody} //
|
||||
};
|
||||
|
||||
//加密
|
||||
EnCodeBodyMsg(body:Uint8Array){
|
||||
if (DeEnCodeType)//加密
|
||||
{
|
||||
body = EncryptBuffer(body,body.length);//body加密
|
||||
}
|
||||
//填充消息包
|
||||
let msgPack = {cbDataKind:DeEnCodeType,wPacketSize:body.length,msgBuff:body}
|
||||
let uint8MsgPack = protobundle.baseproto.Msg_Info.encode(msgPack).finish()
|
||||
return uint8MsgPack
|
||||
}
|
||||
//解密
|
||||
DeCodeBodyMsg = function(body:Uint8Array){
|
||||
let msgInfo = protobundle.baseproto.Msg_Info.decode(body)
|
||||
let kind = msgInfo.cbDataKind;
|
||||
let bodyLen = msgInfo.wPacketSize;
|
||||
let utf8Array = msgInfo.msgBuff
|
||||
if (bodyLen == msgInfo.msgBuff.length)//数据长度一致
|
||||
{
|
||||
if (kind==DeEnCodeType)
|
||||
{
|
||||
if (kind)
|
||||
{
|
||||
utf8Array = DecryptBuffer(msgInfo.msgBuff,bodyLen);//数据解密
|
||||
return {a:1,b:utf8Array};//
|
||||
}
|
||||
else{
|
||||
return {a:1,b:utf8Array};//
|
||||
}
|
||||
}
|
||||
else
|
||||
return {a:0,b:new Uint8Array()}//-1加解密字段不匹配
|
||||
}
|
||||
else
|
||||
return {a:0,b:utf8Array};//消息长度不匹配
|
||||
}
|
||||
//填充方法
|
||||
PushPbToSendMsg(mId:number,sId:number,bodyBuf:Uint8Array):Uint8Array
|
||||
{
|
||||
let headInfo = protobundle.baseproto.Msg_Head.create({wMainCmdID:mId,wSubCmdID:sId,msgBody:bodyBuf})
|
||||
let uint8Data = protobundle.baseproto.Msg_Head.encode(headInfo).finish()
|
||||
|
||||
return uint8Data
|
||||
}
|
||||
//发送错误包体
|
||||
SendMsgErro(codeNum:number,desp:string):Uint8Array
|
||||
{
|
||||
let ErroMsgWriter = protobundle.baseproto.MsgBodyErro.create({code:codeNum,disp:desp});
|
||||
let ErroMsg = protobundle.baseproto.MsgBodyErro.encode(ErroMsgWriter).finish()
|
||||
let uint8Data = this.PushPbToSendMsg(0,codeNum,ErroMsg);
|
||||
let uint8MsgPack = this.EnCodeBodyMsg(uint8Data)
|
||||
return uint8Data
|
||||
}
|
||||
//发送到
|
||||
SendMsg(mId:number,sId:number,bodyBuf:Uint8Array):Uint8Array
|
||||
{
|
||||
let headInfo = protobundle.baseproto.Msg_Head.create({wMainCmdID:mId,wSubCmdID:sId,msgBody:bodyBuf})
|
||||
let uint8Data = protobundle.baseproto.Msg_Head.encode(headInfo).finish()
|
||||
let uint8MsgPack = this.EnCodeBodyMsg(uint8Data)
|
||||
return uint8Data
|
||||
}
|
||||
//发送
|
||||
SendMsgWithToken(token:string,mId:number,sId:number,bodyBuf:Uint8Array):Uint8Array
|
||||
{
|
||||
let headInfo = protobundle.baseproto.Msg_Head.create({wMainCmdID:mId,wSubCmdID:sId,msgBody:bodyBuf})
|
||||
let uint8Data = protobundle.baseproto.Msg_Head.encode(headInfo).finish()
|
||||
let tokenBody = protobundle.baseproto.Msg_TokenBody.create({strToken:token,msgBody:uint8Data})//填充token
|
||||
let uint8TokenData = protobundle.baseproto.Msg_TokenBody.encode(tokenBody).finish()
|
||||
|
||||
let uint8MsgPack = this.EnCodeBodyMsg(uint8TokenData)
|
||||
return uint8MsgPack
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default new ProtoBuffUtil()
|
||||
9
assets/common/net/protobufUtil.ts.meta
Normal file
9
assets/common/net/protobufUtil.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "213b1db4-1e3a-4be0-923c-af01bb6e535d",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/prefab.meta
Normal file
12
assets/common/prefab.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "b303a128-1cb1-4443-af1e-ea246a3e7147",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
617
assets/common/prefab/Scene.prefab
Normal file
617
assets/common/prefab/Scene.prefab
Normal file
@ -0,0 +1,617 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Scene",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 16
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 17
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-375,
|
||||
-667,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "UIROOT",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 3
|
||||
},
|
||||
{
|
||||
"__id__": 5
|
||||
},
|
||||
{
|
||||
"__id__": 7
|
||||
},
|
||||
{
|
||||
"__id__": 9
|
||||
},
|
||||
{
|
||||
"__id__": 11
|
||||
},
|
||||
{
|
||||
"__id__": 13
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 15
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Screen",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "6ba5f1f9-cda5-422e-9c28-1511eca9d363"
|
||||
},
|
||||
"fileId": "d5WPdrmzlPur/VjYZPDzJw",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "FixedUI",
|
||||
"_objFlags": 512,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "6ba5f1f9-cda5-422e-9c28-1511eca9d363"
|
||||
},
|
||||
"fileId": "20HeEniWBM34MPQA5Ohzpl",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "PopUp",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "6ba5f1f9-cda5-422e-9c28-1511eca9d363"
|
||||
},
|
||||
"fileId": "487RyOUj1NiY6sBKVbNOKb",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "TopTips",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "6ba5f1f9-cda5-422e-9c28-1511eca9d363"
|
||||
},
|
||||
"fileId": "b9qJ4MKuFL8oxxwvcOqhlk",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "UIMaskManager",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 12
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "6ba5f1f9-cda5-422e-9c28-1511eca9d363"
|
||||
},
|
||||
"fileId": "c1/v66c89I67akZtzM0v6i",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "UIAdapterManager",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 14
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "6ba5f1f9-cda5-422e-9c28-1511eca9d363"
|
||||
},
|
||||
"fileId": "78Qk9LTcNB1rQQbDWGFoS0",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "6ba5f1f9-cda5-422e-9c28-1511eca9d363"
|
||||
},
|
||||
"fileId": "606QIkJ6BKE4hlK4LvTiEI",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "0a0d5NIGjtB7K1qERMxWNOv",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "6ba5f1f9-cda5-422e-9c28-1511eca9d363"
|
||||
},
|
||||
"fileId": "",
|
||||
"sync": false
|
||||
}
|
||||
]
|
||||
8
assets/common/prefab/Scene.prefab.meta
Normal file
8
assets/common/prefab/Scene.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "6ba5f1f9-cda5-422e-9c28-1511eca9d363",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/res.meta
Normal file
12
assets/common/res.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "9be1d576-a5bb-4a9c-a112-3972f3fb6c58",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
51
assets/common/res/ResHelper.ts
Normal file
51
assets/common/res/ResHelper.ts
Normal file
@ -0,0 +1,51 @@
|
||||
export class LoadProgress {
|
||||
public url: string;
|
||||
public completedCount: number;
|
||||
public totalCount: number;
|
||||
public item: any;
|
||||
public cb?: Function;
|
||||
}
|
||||
|
||||
export default class ResHelper {
|
||||
/** 加载进度 */
|
||||
public static loadProgress = new LoadProgress();
|
||||
|
||||
/** 加载资源 */
|
||||
public static loadResAsync<T>(url: string, type: typeof cc.Asset, progressCallback?: (completedCount: number, totalCount: number, item: any) => void): Promise<T>{
|
||||
if (!url || !type) {
|
||||
cc.error("参数错误", url, type);
|
||||
return;
|
||||
}
|
||||
ResHelper.loadProgress.url = url;
|
||||
if(progressCallback) {
|
||||
this.loadProgress.cb = progressCallback;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
//cc.assetManager.downloader.download(url)
|
||||
cc.resources.load(url,type,this._progressCallback,function(err,prefab:any){
|
||||
if (err) {
|
||||
cc.error(`${url} [资源加载] 错误 ${err}`);
|
||||
resolve(null);
|
||||
}else {
|
||||
resolve(prefab);
|
||||
}
|
||||
// 加载完毕了,清理进度数据
|
||||
ResHelper.loadProgress.url = '';
|
||||
ResHelper.loadProgress.completedCount = 0;
|
||||
ResHelper.loadProgress.totalCount = 0;
|
||||
ResHelper.loadProgress.item = null;
|
||||
ResHelper.loadProgress.cb = null;
|
||||
})
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 加载进度
|
||||
* cb方法 其实目的是可以将loader方法的progress
|
||||
*/
|
||||
private static _progressCallback(completedCount: number, totalCount: number, item: any) {
|
||||
ResHelper.loadProgress.completedCount = completedCount;
|
||||
ResHelper.loadProgress.totalCount = totalCount;
|
||||
ResHelper.loadProgress.item = item;
|
||||
ResHelper.loadProgress.cb && ResHelper.loadProgress.cb(completedCount, totalCount, item);
|
||||
}
|
||||
}
|
||||
9
assets/common/res/ResHelper.ts.meta
Normal file
9
assets/common/res/ResHelper.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "c37384cd-30ea-4730-b0ac-c59180191991",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
85
assets/common/res/ResManager.ts
Normal file
85
assets/common/res/ResManager.ts
Normal file
@ -0,0 +1,85 @@
|
||||
import ResHelper from "./ResHelper";
|
||||
import UIBase from "../ui/base/UIBase";
|
||||
|
||||
/**
|
||||
* 资源加载, 针对的是Panel
|
||||
* 首先将资源分为两类
|
||||
* 一种是在编辑器时将其拖上去图片, 这里将其称为静态图片,
|
||||
* 一种是在代码中使用cc.loader加载的图片, 这里将其称为动态图片
|
||||
*
|
||||
* 对于静态资源
|
||||
* 1, 加载 在加载prefab时, cocos会将其依赖的图片一并加载, 所有不需要我们担心
|
||||
* 2, 释放 这里采用的引用计数的管理方法, 只需要调用destoryPanel即可
|
||||
*/
|
||||
export default class ResManager {
|
||||
private static instance: ResManager = null;
|
||||
public static get inst() {
|
||||
if(this.instance === null) {
|
||||
this.instance = new ResManager();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
/**
|
||||
* 采用计数管理的办法, 管理form所依赖的资源
|
||||
*/
|
||||
private staticDepends:{[key: string]: cc.Asset} = cc.js.createMap();
|
||||
private dynamicDepends: {[key: string]: cc.Asset} = cc.js.createMap();
|
||||
|
||||
private _addTmpStaticDepends(completedCount: number, totalCount: number, item: any) {
|
||||
}
|
||||
|
||||
/** 加载窗体 */
|
||||
public async loadPrefab(formName: string) {
|
||||
if(formName == "" || formName == null){
|
||||
return ;
|
||||
}
|
||||
let pre = await ResHelper.loadResAsync<cc.Prefab>(formName, cc.Prefab, this._addTmpStaticDepends.bind(this));
|
||||
if(!pre) {
|
||||
cc.warn(`${formName} 资源加载失败, 请确认路径是否正确`);
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
let node: cc.Node = cc.instantiate(pre);
|
||||
let baseUI = node.getComponent(UIBase);
|
||||
if(baseUI == null) {
|
||||
cc.warn(`${formName} 没有绑定UIBase的Component`);
|
||||
return ;
|
||||
}
|
||||
baseUI.uid = formName;
|
||||
this.staticDepends[formName] = pre
|
||||
if(this.staticDepends[formName])
|
||||
this.staticDepends[formName].addRef()
|
||||
return node;
|
||||
}
|
||||
/** 销毁窗体 */
|
||||
public destoryPrefab(com: UIBase) {
|
||||
if(!com) {
|
||||
cc.log("只支持销毁继承了UIBase的窗体!");
|
||||
return;
|
||||
}
|
||||
if(this.staticDepends[com.uid])
|
||||
this.staticDepends[com.uid].decRef()
|
||||
com.node.destroy();
|
||||
}
|
||||
/** 动态资源管理, 通过tag标记当前资源, 统一释放 */
|
||||
public async loadDynamicRes(url: string, type: typeof cc.Asset) {
|
||||
let sources = await ResHelper.loadResAsync<cc.Asset>(url, type);
|
||||
if(!this.dynamicDepends[url]) {
|
||||
this.dynamicDepends[url] = sources;
|
||||
}
|
||||
this.dynamicDepends[url].addRef()
|
||||
|
||||
return sources;
|
||||
}
|
||||
|
||||
/** 销毁动态资源 没有做引用计数的处理 */
|
||||
public destoryDynamicRes(url: string) {
|
||||
if(!this.dynamicDepends[url]) { // 销毁
|
||||
return false;
|
||||
}
|
||||
this.dynamicDepends[url].decRef()
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
9
assets/common/res/ResManager.ts.meta
Normal file
9
assets/common/res/ResManager.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "dcb57c5d-c86f-4a7f-8f60-f0f0a9dab1fd",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/ui.meta
Normal file
12
assets/common/ui.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "a118c662-bc17-4cbd-84f3-b128161431ff",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
94
assets/common/ui/AdapterManager.ts
Normal file
94
assets/common/ui/AdapterManager.ts
Normal file
@ -0,0 +1,94 @@
|
||||
import { SysDefine } from './config/SysDefine';
|
||||
|
||||
const {ccclass, property} = cc._decorator;
|
||||
@ccclass
|
||||
export default class AdapterManager extends cc.Component {
|
||||
|
||||
private static _instance: AdapterManager = null; // 单例
|
||||
public static get inst() {
|
||||
if(this._instance == null) {
|
||||
this._instance = cc.find(SysDefine.SYS_UIAdapter_NAME).addComponent<AdapterManager>(this);
|
||||
cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, () => {
|
||||
this._instance = null;
|
||||
});
|
||||
}
|
||||
return this._instance;
|
||||
}
|
||||
|
||||
/** 屏幕尺寸 */
|
||||
public visibleSize: cc.Size;
|
||||
|
||||
onLoad () {
|
||||
this.visibleSize = cc.view.getVisibleSize();
|
||||
cc['visibleSize'] = this.visibleSize;
|
||||
cc.log(`当前屏幕尺寸为${this.visibleSize}`);
|
||||
}
|
||||
|
||||
start () {}
|
||||
/**
|
||||
* 适配靠边的UI
|
||||
* @param type
|
||||
* @param node
|
||||
* @param distance
|
||||
*/
|
||||
adapatByType(type: AdaptaterType, node: cc.Node, distance?: number) {
|
||||
let widget = node.getComponent(cc.Widget);
|
||||
if(!widget) {
|
||||
widget = node.addComponent(cc.Widget);
|
||||
}
|
||||
switch(type) {
|
||||
case AdaptaterType.Top:
|
||||
if(cc.sys.platform === cc.sys.WECHAT_GAME) { // 微信小游戏适配刘海屏
|
||||
let menuInfo = window["wx"].getMenuButtonBoundingClientRect();
|
||||
let systemInfo = window["wx"].getSystemInfoSync();
|
||||
distance = cc.find("Canvas").height * (menuInfo.top / systemInfo.screenHeight);
|
||||
}
|
||||
widget.top = distance ? distance : 0;
|
||||
widget.isAbsoluteTop = true;
|
||||
widget.isAlignTop = true;
|
||||
break;
|
||||
case AdaptaterType.Bottom:
|
||||
widget.bottom = distance ? distance : 0;
|
||||
widget.isAbsoluteBottom = true;
|
||||
widget.isAlignBottom = true;
|
||||
break;
|
||||
case AdaptaterType.Left:
|
||||
widget.left = distance ? distance : 0;
|
||||
widget.isAbsoluteLeft = true;
|
||||
widget.isAlignLeft = true;
|
||||
break;
|
||||
case AdaptaterType.Right:
|
||||
widget.right = distance ? distance : 0;
|
||||
widget.isAbsoluteRight = true;
|
||||
widget.isAlignRight = true;
|
||||
break;
|
||||
case AdaptaterType.FullScreen:
|
||||
widget.right = 0;
|
||||
widget.left = 0;
|
||||
widget.top = 0;
|
||||
widget.bottom = 0;
|
||||
widget.isAlignLeft = true;
|
||||
widget.isAlignRight = true;
|
||||
widget.isAlignBottom = true;
|
||||
widget.isAlignTop = true;
|
||||
break;
|
||||
}
|
||||
widget.target = cc.find("Canvas");
|
||||
widget.updateAlignment();
|
||||
}
|
||||
/** 移除 */
|
||||
removeAdaptater(node: cc.Node) {
|
||||
if(node.getComponent(cc.Widget)) {
|
||||
node.removeComponent(cc.Widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
/** */
|
||||
export enum AdaptaterType {
|
||||
Center = 0,
|
||||
Top = 1,
|
||||
Bottom = 2,
|
||||
Left = 3,
|
||||
Right = 4,
|
||||
FullScreen = 5,
|
||||
}
|
||||
9
assets/common/ui/AdapterManager.ts.meta
Normal file
9
assets/common/ui/AdapterManager.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "34cef65c-5790-4f50-88ce-1bcf98d131c9",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
15
assets/common/ui/MaskType.ts
Normal file
15
assets/common/ui/MaskType.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { MaskOpacity } from "./config/SysDefine";
|
||||
|
||||
export class MaskType {
|
||||
public opacity: MaskOpacity = MaskOpacity.OpacityHalf;
|
||||
public clickMaskClose = false; // 点击阴影关闭
|
||||
public isEasing = true; // 缓动实现
|
||||
public easingTime = 0.2; // 缓动时间
|
||||
|
||||
constructor(opacity = MaskOpacity.OpacityHalf, ClickMaskClose=false, IsEasing=true, EasingTime=0.2) {
|
||||
this.opacity = opacity;
|
||||
this.clickMaskClose = ClickMaskClose;
|
||||
this.isEasing = IsEasing;
|
||||
this.easingTime = EasingTime;
|
||||
}
|
||||
}
|
||||
9
assets/common/ui/MaskType.ts.meta
Normal file
9
assets/common/ui/MaskType.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "918007eb-a65e-4fa6-b8d5-9fa15e86706b",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
42
assets/common/ui/TipsManager.ts
Normal file
42
assets/common/ui/TipsManager.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import UIManager from "./UIManager";
|
||||
//import UIToast from "../test/UIToast";
|
||||
|
||||
/***
|
||||
* 独立窗体, 独立控制, 不受其他窗体控制, 非单例
|
||||
*
|
||||
* 这里专门用于处理 提示类窗体, 例如断线提示, 加载过场等
|
||||
*/
|
||||
export default class TipsManager{
|
||||
private static _instance: TipsManager = null; // 单例
|
||||
static get inst() {
|
||||
if(this._instance == null) {
|
||||
this._instance = new TipsManager();
|
||||
}
|
||||
return this._instance;
|
||||
}
|
||||
private loadingPanelName: string;
|
||||
/** 设置加载页面 */
|
||||
public setLoadingPanel(loadingName: string) {
|
||||
this.loadingPanelName = loadingName;
|
||||
}
|
||||
public async showLoadingPanel(...params: any[]) {
|
||||
if(!this.loadingPanelName || this.loadingPanelName.length <= 0) {
|
||||
cc.warn('请先设置loading form');
|
||||
return ;
|
||||
}
|
||||
await UIManager.getInstance().openUIPanel(this.loadingPanelName, ...params);
|
||||
}
|
||||
/** 隐藏加载form */
|
||||
public async hideLoadingPanel() {
|
||||
await UIManager.getInstance().closeUIPanel(this.loadingPanelName);
|
||||
}
|
||||
|
||||
/** 提示窗体 */
|
||||
private tipsPanelName: string;
|
||||
public setTipsPanel(tipsPanelName: string) {
|
||||
this.tipsPanelName = tipsPanelName;
|
||||
}
|
||||
public async showToast() {
|
||||
//await UIToast.popUp();
|
||||
}
|
||||
}
|
||||
9
assets/common/ui/TipsManager.ts.meta
Normal file
9
assets/common/ui/TipsManager.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "b5ebef3b-7c93-43f9-9271-3e24fe4032ec",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
36
assets/common/ui/TipsPanel.ts
Normal file
36
assets/common/ui/TipsPanel.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import resHelper from "../res/ResHelper";
|
||||
import UIBase from "./base/UIBase";
|
||||
import { PanelType } from "./config/SysDefine";
|
||||
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class TipsPanel extends UIBase {
|
||||
@property(cc.Label)
|
||||
tips: cc.Label = null;
|
||||
|
||||
panelType = PanelType.TopTips;
|
||||
|
||||
|
||||
public static async popUp(url: string, params: any) {
|
||||
let prefab = await resHelper.loadResAsync<cc.Prefab>(url, cc.Prefab);
|
||||
if(!prefab) return ;
|
||||
let node = cc.instantiate(prefab);
|
||||
let com = node.getComponent(TipsPanel);
|
||||
com.tips.string = params;
|
||||
// todo...
|
||||
await com.exitAnim();
|
||||
}
|
||||
// onLoad () {}
|
||||
|
||||
start () {
|
||||
|
||||
}
|
||||
|
||||
async exitAnim() {
|
||||
this.node.removeFromParent();
|
||||
this.node.destroy();
|
||||
}
|
||||
|
||||
// update (dt) {}
|
||||
}
|
||||
9
assets/common/ui/TipsPanel.ts.meta
Normal file
9
assets/common/ui/TipsPanel.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "b3c59750-e251-49a7-818a-3a88fedea081",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
332
assets/common/ui/UIManager.ts
Normal file
332
assets/common/ui/UIManager.ts
Normal file
@ -0,0 +1,332 @@
|
||||
import UIBase from "./base/UIBase";
|
||||
import { SysDefine, PanelType } from "./config/SysDefine";
|
||||
import ResManager from "../res/ResManager";
|
||||
import UIMaskMgr from "./UIMaskMgr";
|
||||
import AdapterManager, { AdaptaterType } from "./AdapterManager";
|
||||
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class UIManager extends cc.Component {
|
||||
|
||||
private _NoNormal: cc.Node = null; // 全屏显示的UI 挂载结点
|
||||
private _NoFixed: cc.Node = null; // 固定显示的UI
|
||||
private _NoPopUp: cc.Node = null; // 弹出窗口
|
||||
private _NoTips: cc.Node = null; // 独立窗体
|
||||
|
||||
private _StaCurrentUIPanels:Array<UIBase> = []; // 存储弹出的窗体
|
||||
private _MapAllUIPanels: {[key: string]: UIBase} = cc.js.createMap(); // 所有的窗体
|
||||
private _MapCurrentShowUIPanels: {[key: string]: UIBase} = cc.js.createMap(); // 正在显示的窗体(不包括弹窗)
|
||||
private _MapIndependentPanels: {[key: string]: UIBase} = cc.js.createMap(); // 独立窗体 独立于其他窗体, 不受其他窗体的影响
|
||||
private _LoadingPanel: {[key: string]: boolean} = cc.js.createMap(); // 正在加载的Panel
|
||||
|
||||
private _currWindowId = '';
|
||||
public get currWindowId() {
|
||||
return this._currWindowId;
|
||||
}
|
||||
private _currScreenId = '';
|
||||
public get currScreenId() {
|
||||
return this._currScreenId;
|
||||
}
|
||||
|
||||
private static instance: UIManager = null; // 单例
|
||||
public static getInstance(): UIManager {
|
||||
if(this.instance == null) {
|
||||
this.instance = cc.find(SysDefine.SYS_UIROOT_NAME).addComponent<UIManager>(this);
|
||||
cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, () => {
|
||||
this.instance = null;
|
||||
});
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
|
||||
onLoad () {
|
||||
// 初始化结点
|
||||
this._NoNormal = this.node.getChildByName(SysDefine.SYS_SCREEN_NODE);
|
||||
this._NoFixed = this.node.getChildByName(SysDefine.SYS_FIXEDUI_NODE);
|
||||
this._NoPopUp = this.node.getChildByName(SysDefine.SYS_POPUP_NODE);
|
||||
this._NoTips = this.node.getChildByName(SysDefine.SYS_TOPTIPS_NODE);
|
||||
}
|
||||
|
||||
start() {
|
||||
}
|
||||
|
||||
/** */
|
||||
public getComponentByUid(uid: string) {
|
||||
return this._MapAllUIPanels[uid];
|
||||
}
|
||||
|
||||
/**
|
||||
* 重要方法 加载显示一个UIPanel
|
||||
* @param prefabPath
|
||||
* @param obj 初始化信息, 可以不要
|
||||
*/
|
||||
public async openUIPanel(prefabPath: string, ...params: any) {
|
||||
if(prefabPath === "" || prefabPath == null) return ;
|
||||
if(this.checkUIPanelIsShowing(prefabPath) || this.checkUIPanelIsLoading(prefabPath)) {
|
||||
cc.warn(`${prefabPath}窗体已经在显示,或者正在加载中!`);
|
||||
return null;
|
||||
}
|
||||
let uiBase = await this.loadPanelsToAllUIPanelsCatch(prefabPath);
|
||||
if(uiBase == null) {
|
||||
cc.warn(`${prefabPath}未加载!`);
|
||||
return null;
|
||||
}
|
||||
|
||||
switch(uiBase.panelType) {
|
||||
case PanelType.Screen:
|
||||
await this.enterUIPanelsAndHideOther(prefabPath, ...params);
|
||||
break;
|
||||
case PanelType.FixedUI:
|
||||
await this.loadUIToCurrentCache(prefabPath, ...params);
|
||||
break;
|
||||
case PanelType.PopUp:
|
||||
await this.pushUIPanelToStack(prefabPath, ...params);
|
||||
break;
|
||||
case PanelType.TopTips: // 独立显示
|
||||
await this.loadUIPanelsToIndependent(prefabPath, ...params);
|
||||
break;
|
||||
}
|
||||
|
||||
return uiBase;
|
||||
}
|
||||
/**
|
||||
* 重要方法 关闭一个UIPanel
|
||||
* @param prefabPath
|
||||
*/
|
||||
public async closeUIPanel(prefabPath: string) {
|
||||
if(prefabPath == "" || prefabPath == null) return ;
|
||||
let UIBase = this._MapAllUIPanels[prefabPath];
|
||||
|
||||
if(UIBase == null) return true;
|
||||
|
||||
switch(UIBase.panelType) {
|
||||
case PanelType.Screen:
|
||||
await this.exitUIPanelsAndDisplayOther(prefabPath);
|
||||
break;
|
||||
case PanelType.FixedUI: // 普通模式显示
|
||||
await this.exitUIPanels(prefabPath);
|
||||
break;
|
||||
case PanelType.PopUp:
|
||||
await this.popUIPanel();
|
||||
break;
|
||||
case PanelType.TopTips:
|
||||
await this.exitIndependentPanels(prefabPath);
|
||||
break;
|
||||
}
|
||||
// 判断是否销毁该窗体
|
||||
if(UIBase.canDestory) {
|
||||
this.destoryPanel(UIBase, prefabPath);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从全部的UI窗口中加载, 并挂载到结点上
|
||||
*/
|
||||
private async loadPanelsToAllUIPanelsCatch(prefabPath: string) {
|
||||
let baseUIResult = this._MapAllUIPanels[prefabPath];
|
||||
// 判断窗体不在mapAllUIPanels中, 也不再loadingPanels中
|
||||
if (baseUIResult == null && !this._LoadingPanel[prefabPath]) {
|
||||
//加载指定名称的“UI窗体
|
||||
this._LoadingPanel[prefabPath] = true;
|
||||
baseUIResult = await this.loadUIPanel(prefabPath);
|
||||
this._LoadingPanel[prefabPath] = false;
|
||||
delete this._LoadingPanel[prefabPath];
|
||||
}
|
||||
return baseUIResult;
|
||||
}
|
||||
/**
|
||||
* 从resources中加载
|
||||
* @param prefabPath
|
||||
*/
|
||||
|
||||
//加载UI,自动添加的层级
|
||||
private async loadUIPanel(PrefabPath: string,parent?:cc.Node) {
|
||||
if(PrefabPath == "" || PrefabPath == null){
|
||||
return ;
|
||||
}
|
||||
let node = await ResManager.inst.loadPrefab(PrefabPath);
|
||||
if(!node) {
|
||||
return ;
|
||||
}
|
||||
// 初始化窗体名称
|
||||
let baseUI = node.getComponent(UIBase);
|
||||
node.active = false;
|
||||
switch(baseUI.panelType) {
|
||||
case PanelType.Screen:
|
||||
UIManager.getInstance()._NoNormal.addChild(node);
|
||||
break;
|
||||
case PanelType.FixedUI:
|
||||
UIManager.getInstance()._NoFixed.addChild(node);
|
||||
break;
|
||||
case PanelType.PopUp:
|
||||
UIManager.getInstance()._NoPopUp.addChild(node);
|
||||
break;
|
||||
case PanelType.TopTips:
|
||||
UIManager.getInstance()._NoTips.addChild(node);
|
||||
break;
|
||||
default:
|
||||
ResManager.inst.destoryPrefab(baseUI)
|
||||
return;
|
||||
}
|
||||
this._MapAllUIPanels[PrefabPath] = baseUI;
|
||||
|
||||
return baseUI
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载到缓存中,
|
||||
* @param prefabPath
|
||||
*/
|
||||
private async loadUIToCurrentCache(prefabPath: string, ...params: any) {
|
||||
let UIBase: UIBase = null;
|
||||
let UIBaseFromAllCache: UIBase = null;
|
||||
|
||||
UIBase = this._MapCurrentShowUIPanels[prefabPath];
|
||||
if(UIBase != null) return ; // 要加载的窗口正在显示
|
||||
|
||||
UIBaseFromAllCache = this._MapAllUIPanels[prefabPath];
|
||||
if(UIBaseFromAllCache != null) {
|
||||
await UIBaseFromAllCache._preInit();
|
||||
this._MapCurrentShowUIPanels[prefabPath] = UIBaseFromAllCache;
|
||||
|
||||
UIBaseFromAllCache.onShow(...params);
|
||||
await this.showPanel(UIBaseFromAllCache);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 加载到栈中
|
||||
* @param prefabPath
|
||||
*/
|
||||
private async pushUIPanelToStack(prefabPath: string, ...params: any) {
|
||||
if(this._StaCurrentUIPanels.length > 0) {
|
||||
let topUIPanel = this._StaCurrentUIPanels[this._StaCurrentUIPanels.length-1];
|
||||
}
|
||||
let baseUI = this._MapAllUIPanels[prefabPath];
|
||||
if(baseUI == null) return ;
|
||||
await baseUI._preInit();
|
||||
// 加入栈中, 同时设置其zIndex 使得后进入的窗体总是显示在上面
|
||||
this._StaCurrentUIPanels.push(baseUI);
|
||||
baseUI.node.zIndex = this._StaCurrentUIPanels.length;
|
||||
|
||||
baseUI.onShow(...params);
|
||||
this._currWindowId = baseUI.uid;
|
||||
UIMaskMgr.inst.checkMaskWindow(this._StaCurrentUIPanels);
|
||||
await this.showPanel(baseUI);
|
||||
}
|
||||
/**
|
||||
* 加载时, 关闭其他窗口
|
||||
*/
|
||||
private async enterUIPanelsAndHideOther(prefabPath: string, ...params: any) {
|
||||
let UIBase = this._MapCurrentShowUIPanels[prefabPath];
|
||||
if(UIBase != null) return ;
|
||||
|
||||
// 隐藏其他窗口
|
||||
for(let key in this._MapCurrentShowUIPanels) {
|
||||
await this._MapCurrentShowUIPanels[key].closeUIPanel();
|
||||
}
|
||||
this._StaCurrentUIPanels.forEach(async uiPanel => {
|
||||
await uiPanel.closeUIPanel();
|
||||
});
|
||||
|
||||
let UIBaseFromAll = this._MapAllUIPanels[prefabPath];
|
||||
|
||||
if(UIBaseFromAll == null) return ;
|
||||
AdapterManager.inst.adapatByType(AdaptaterType.FullScreen, UIBaseFromAll.node);
|
||||
await UIBaseFromAll._preInit();
|
||||
|
||||
this._MapCurrentShowUIPanels[prefabPath] = UIBaseFromAll;
|
||||
|
||||
UIBaseFromAll.onShow(...params);
|
||||
this._currScreenId = UIBaseFromAll.uid;
|
||||
await this.showPanel(UIBaseFromAll);
|
||||
}
|
||||
|
||||
/** 加载到独立map中 */
|
||||
private async loadUIPanelsToIndependent(prefabPath: string, ...params: any) {
|
||||
let UIBase = this._MapAllUIPanels[prefabPath];
|
||||
if(UIBase == null) return ;
|
||||
await UIBase._preInit();
|
||||
this._MapIndependentPanels[prefabPath] = UIBase;
|
||||
|
||||
UIBase.onShow(...params);
|
||||
await this.showPanel(UIBase);
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------- 关闭窗口 --------------------------
|
||||
*/
|
||||
/**
|
||||
* 关闭一个UIPanel
|
||||
* @param prefabPath
|
||||
*/
|
||||
private async exitUIPanels(prefabPath: string) {
|
||||
let UIBase = this._MapAllUIPanels[prefabPath];
|
||||
if(UIBase == null) return ;
|
||||
UIBase.onHide();
|
||||
await this.hidePanel(UIBase);
|
||||
|
||||
this._MapCurrentShowUIPanels[prefabPath] = null;
|
||||
delete this._MapCurrentShowUIPanels[prefabPath];
|
||||
}
|
||||
private async popUIPanel() {
|
||||
if(this._StaCurrentUIPanels.length >= 1) {
|
||||
let topUIPanel = this._StaCurrentUIPanels.pop();
|
||||
topUIPanel.onHide();
|
||||
UIMaskMgr.inst.checkMaskWindow(this._StaCurrentUIPanels);
|
||||
await this.hidePanel(topUIPanel);
|
||||
this._currWindowId = this._StaCurrentUIPanels.length > 0 ? this._StaCurrentUIPanels[this._StaCurrentUIPanels.length-1].uid : '';
|
||||
}
|
||||
}
|
||||
private async exitUIPanelsAndDisplayOther(prefabPath: string) {
|
||||
if(prefabPath == "" || prefabPath == null) return ;
|
||||
|
||||
let UIBase = this._MapCurrentShowUIPanels[prefabPath];
|
||||
if(UIBase == null) return ;
|
||||
UIBase.onHide();
|
||||
await this.hidePanel(UIBase);
|
||||
|
||||
this._MapCurrentShowUIPanels[prefabPath] = null;
|
||||
delete this._MapCurrentShowUIPanels[prefabPath];
|
||||
}
|
||||
private async exitIndependentPanels(prefabPath: string) {
|
||||
let UIBase = this._MapAllUIPanels[prefabPath];
|
||||
if(UIBase == null) return ;
|
||||
UIBase.onHide();
|
||||
await this.hidePanel(UIBase);
|
||||
|
||||
this._MapIndependentPanels[prefabPath] = null;
|
||||
delete this._MapIndependentPanels[prefabPath];
|
||||
}
|
||||
|
||||
private async showPanel(baseUI: UIBase) {
|
||||
baseUI.node.active = true;
|
||||
await baseUI.showAnimation();
|
||||
}
|
||||
private async hidePanel(baseUI: UIBase) {
|
||||
await baseUI.hideAnimation();
|
||||
baseUI.node.active = false;
|
||||
}
|
||||
/** 销毁 */
|
||||
private destoryPanel(UIBase: UIBase, prefabPath: string) {
|
||||
UIBase.onRemove()
|
||||
ResManager.inst.destoryPrefab(UIBase)
|
||||
// 从allmap中删除
|
||||
this._MapAllUIPanels[prefabPath] = null;
|
||||
delete this._MapAllUIPanels[prefabPath];
|
||||
}
|
||||
/** 窗体是否正在显示 */
|
||||
public checkUIPanelIsShowing(prefabPath: string) {
|
||||
let UIBases = this._MapAllUIPanels[prefabPath];
|
||||
if (UIBases == null) {
|
||||
return false;
|
||||
}
|
||||
return UIBases.node.active;
|
||||
}
|
||||
/** 窗体是否正在加载 */
|
||||
public checkUIPanelIsLoading(prefabPath: string) {
|
||||
let UIBase = this._LoadingPanel[prefabPath];
|
||||
return !!UIBase;
|
||||
}
|
||||
}
|
||||
9
assets/common/ui/UIManager.ts.meta
Normal file
9
assets/common/ui/UIManager.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "419c1551-5998-454a-a0cf-a85c6a327f14",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
51
assets/common/ui/UIMaskMgr.ts
Normal file
51
assets/common/ui/UIMaskMgr.ts
Normal file
@ -0,0 +1,51 @@
|
||||
|
||||
import { SysDefine } from "./config/SysDefine";
|
||||
import UIBase from "./base/UIBase";
|
||||
import UIManager from "./UIManager";
|
||||
import { MaskOpacity } from "./config/SysDefine";
|
||||
import uiHelper from "./base/UIHelper";
|
||||
import { MaskType } from "./MaskType";
|
||||
import { UIMaskScript } from "./UIMaskScript";
|
||||
|
||||
/**
|
||||
* 遮罩管理
|
||||
*/
|
||||
const {ccclass, property} = cc._decorator;
|
||||
@ccclass
|
||||
export default class UIMaskMgr extends cc.Component {
|
||||
public static popUpRoot: cc.Node = null;
|
||||
public static _inst: UIMaskMgr = null;
|
||||
public static get inst() {
|
||||
if(this._inst == null) {
|
||||
let tempObject = cc.find(SysDefine.SYS_UIMASK_NAME);
|
||||
this._inst = cc.find(SysDefine.SYS_UIMASK_NAME).addComponent<UIMaskMgr>(this);
|
||||
UIMaskMgr.inst.uiMask = new cc.Node("UIMaskNode").addComponent(UIMaskScript);
|
||||
UIMaskMgr.inst.uiMask.init();
|
||||
this.popUpRoot = cc.find(SysDefine.SYS_UIROOT_NAME + '/' + SysDefine.SYS_POPUP_NODE);
|
||||
}
|
||||
return this._inst;
|
||||
}
|
||||
private uiMask:UIMaskScript = null;
|
||||
|
||||
/** 为mask添加颜色 */
|
||||
private async showMask(maskType: MaskType) {
|
||||
await this.uiMask.showMask(maskType.opacity, maskType.easingTime, maskType.isEasing);
|
||||
}
|
||||
|
||||
public checkMaskWindow(uiBases: UIBase[]) {
|
||||
if(this.uiMask.node.parent) {
|
||||
this.uiMask.node.removeFromParent();
|
||||
}
|
||||
for(let i=uiBases.length-1; i>=0; i--) {
|
||||
if(uiBases[i].maskType.opacity > 0) {
|
||||
UIMaskMgr.popUpRoot.addChild(this.uiMask.node, Math.max(uiBases[i].node.zIndex-1, 0));
|
||||
this.uiMask.uid = uiBases[i].uid;
|
||||
this.showMask(uiBases[i].maskType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!this.uiMask.node.parent) {
|
||||
this.uiMask.node.opacity = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
9
assets/common/ui/UIMaskMgr.ts.meta
Normal file
9
assets/common/ui/UIMaskMgr.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "72b922d1-bf52-4b19-96d5-a80a156ea952",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
87
assets/common/ui/UIMaskScript.ts
Normal file
87
assets/common/ui/UIMaskScript.ts
Normal file
@ -0,0 +1,87 @@
|
||||
import UiHelper from "./base/UIHelper";
|
||||
import { MaskOpacity } from "./config/SysDefine";
|
||||
import UIManager from "./UIManager";
|
||||
|
||||
const {ccclass, property} = cc._decorator;
|
||||
@ccclass
|
||||
export class UIMaskScript extends cc.Component {
|
||||
|
||||
public uid: string;
|
||||
/** 代码创建一个单色texture */
|
||||
private _texture: cc.Texture2D = null;
|
||||
private getSingleTexture() {
|
||||
if(this._texture) return this._texture;
|
||||
let data: any = new Uint8Array(2 * 2 * 4);
|
||||
for(let i=0; i<2; i++) {
|
||||
for(let j=0; j<2; j++) {
|
||||
data[i*2*4 + j*4+0] = 255;
|
||||
data[i*2*4 + j*4+1] = 255;
|
||||
data[i*2*4 + j*4+2] = 255;
|
||||
data[i*2*4 + j*4+3] = 255;
|
||||
}
|
||||
}
|
||||
let texture = new cc.Texture2D();
|
||||
texture.initWithData(data, cc.Texture2D.PixelFormat.RGBA8888, 2, 2);
|
||||
this._texture = texture;
|
||||
return this._texture;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
public init() {
|
||||
let maskTexture = this.getSingleTexture();
|
||||
let size = cc.view.getVisibleSize();
|
||||
this.node.height = size.height;
|
||||
this.node.width = size.width;
|
||||
this.node.x = size.width/2;
|
||||
this.node.y = size.height/2;
|
||||
this.node.addComponent(cc.Button);
|
||||
this.node.on('click', this.clickMaskWindow, this);
|
||||
|
||||
let sprite = this.node.addComponent(cc.Sprite)
|
||||
sprite.sizeMode = cc.Sprite.SizeMode.CUSTOM;
|
||||
sprite.spriteFrame = new cc.SpriteFrame(maskTexture);
|
||||
this.node.color = new cc.Color(0, 0, 0);
|
||||
this.node.opacity = 0;
|
||||
this.node.active = true;
|
||||
}
|
||||
|
||||
//
|
||||
public async showMask(lucenyType: number, time: number = 0.6, isEasing: boolean = true) {
|
||||
let o = 0;
|
||||
switch (lucenyType) {
|
||||
case MaskOpacity.None:
|
||||
this.node.active = false;
|
||||
break;
|
||||
case MaskOpacity.OpacityZero:
|
||||
o = 0;
|
||||
break;
|
||||
case MaskOpacity.OpacityLow:
|
||||
o = 63;
|
||||
break;
|
||||
case MaskOpacity.OpacityHalf:
|
||||
o = 126;
|
||||
break;
|
||||
case MaskOpacity.OpacityHigh:
|
||||
o = 189;
|
||||
break;
|
||||
case MaskOpacity.OpacityFull:
|
||||
o = 255;
|
||||
break;
|
||||
}
|
||||
if(!this.node.active) return ;
|
||||
if(isEasing) {
|
||||
await UiHelper.runTweenAsync(this.node, cc.tween().to(time, {opacity: o}));
|
||||
}else {
|
||||
this.node.opacity = o;
|
||||
}
|
||||
}
|
||||
|
||||
public async clickMaskWindow() {
|
||||
let com = UIManager.getInstance().getComponentByUid(this.uid);
|
||||
if(com && com.maskType.clickMaskClose) {
|
||||
await UIManager.getInstance().closeUIPanel(this.uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
9
assets/common/ui/UIMaskScript.ts.meta
Normal file
9
assets/common/ui/UIMaskScript.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "1f3a0e4e-1f3a-4ef5-812c-6896abcd2de7",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/ui/base.meta
Normal file
12
assets/common/ui/base.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "0f2dfb8e-3baa-4264-971f-db8e918def1a",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
69
assets/common/ui/base/Binder.ts
Normal file
69
assets/common/ui/base/Binder.ts
Normal file
@ -0,0 +1,69 @@
|
||||
import uiHelper from "./UIHelper";
|
||||
import { SysDefine } from "../config/SysDefine";
|
||||
import UIBinder from "./UIBinder";
|
||||
|
||||
/*
|
||||
* @Author: 邓朗 基于论坛中的uikiller
|
||||
* @Date: 2019-09-19 14:28:09
|
||||
* @Last Modified by: 邓朗
|
||||
* @Last Modified time: 2019-10-07 16:36:20
|
||||
*
|
||||
* 在用脚本控制UI的时候, 绑定UI是一件很烦人的事情, 尤其是将UI拖到面板上绑定, 就更加繁琐,
|
||||
* 或者在onload, start上 使用getChildByName() 或者cc.find() 查找结点, 又会显得代码冗长
|
||||
* 大部分时候, 在我创建这个结点的时候, 我就已经想好要让这个结点完成什么功能了(针对渲染结点), 所有我希望在取名字的
|
||||
* 时候,通过特殊的命名规则, 就可以在脚本中直接使用此结点, Binder就来完成此功能
|
||||
*/
|
||||
|
||||
|
||||
class Binder {
|
||||
// 绑定组件
|
||||
public bindComponent(component: UIBinder) {
|
||||
this.bindNode(component.node, component);
|
||||
}
|
||||
// 绑定node
|
||||
public bindNode(node: cc.Node, component: UIBinder) {
|
||||
if (component.$collector === node.uuid) {
|
||||
// cc.warn(`重复绑定退出.${node.name}`)
|
||||
return;
|
||||
}
|
||||
component.$collector = node.uuid;
|
||||
this._bindSubNode(node, component);
|
||||
}
|
||||
|
||||
// 绑定子节点
|
||||
private _bindSubNode(node: cc.Node, component: UIBinder) {
|
||||
// 检测前缀是否符合绑定规范
|
||||
let name = node.name;
|
||||
if(uiHelper.checkBindChildren(name)) {
|
||||
if (uiHelper.checkNodePrefix(name)) {
|
||||
// 获得这个组件的类型 和 名称
|
||||
let names = uiHelper.getPrefixNames(name);
|
||||
if(names === null || names.length !== 2 || !SysDefine.SeparatorMap[names[0]]) {
|
||||
console.log(names);
|
||||
cc.log(`${name} 命令不规范, 请使用_lab$xxx的格式!, 或者是在SysDefine中没有定义`);
|
||||
return ;
|
||||
}
|
||||
// 未定义的类型
|
||||
if(!component[`${names[0]}s`]) {
|
||||
cc.log(`${name[0]}s没有在BaseUIPanel中定义, 并不会影响运行`);
|
||||
component[`${names[0]}s`] = {};
|
||||
}
|
||||
if(component[`${names[0]}s`][names[1]]) {
|
||||
cc.log(`${name} 已经被绑定了, 请检查您是否出现了重名的情况!`);
|
||||
}
|
||||
if(SysDefine.SeparatorMap[names[0]] === 'cc.Node') {
|
||||
component[`${names[0]}s`][names[1]] = node;
|
||||
}else {
|
||||
component[`${names[0]}s`][names[1]] = node.getComponent(SysDefine.SeparatorMap[names[0]]);
|
||||
}
|
||||
|
||||
}
|
||||
// 绑定子节点
|
||||
node.children.forEach((target: cc.Node) => {
|
||||
this._bindSubNode(target, component);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
export default new Binder();
|
||||
9
assets/common/ui/base/Binder.ts.meta
Normal file
9
assets/common/ui/base/Binder.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "9eeee907-6e84-4764-88bf-559802263ef6",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
156
assets/common/ui/base/UIBase.ts
Normal file
156
assets/common/ui/base/UIBase.ts
Normal file
@ -0,0 +1,156 @@
|
||||
import UIBinder from "./UIBinder";
|
||||
import uiHelper from "./UIHelper";
|
||||
import UIManager from "../UIManager";
|
||||
import { PanelType, SysDefine } from "../config/SysDefine";
|
||||
import Binder from "./Binder";
|
||||
import AdapterManager from "../AdapterManager";
|
||||
import TipsManager from "../TipsManager";
|
||||
import { MaskType } from "../MaskType";
|
||||
import ResManager from "../../res/ResManager";
|
||||
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class UIBase extends UIBinder {
|
||||
|
||||
/** 窗体id,该窗体的唯一标示(请不要对这个值进行赋值操作, 内部已经实现了对应的赋值) */
|
||||
public uid: string;
|
||||
/** 窗体类型 */
|
||||
public panelType: PanelType = PanelType.Screen;
|
||||
/** 阴影类型, 只对PopUp类型窗体启用 */
|
||||
public maskType = new MaskType();
|
||||
/** 关闭窗口后销毁, 会将其依赖的资源一并销毁, 采用了引用计数的管理, 不用担心会影响其他窗体 */
|
||||
public canDestory = false;
|
||||
/** 自动绑定结点 */
|
||||
public autoBind = true;
|
||||
/** 回调 */
|
||||
protected _cb: (confirm: any) => void;
|
||||
/** 是否已经调用过preinit方法 */
|
||||
private _inited = false;
|
||||
|
||||
private _vecChildPerfab:Array<cc.Node> = []; //动态加载的子节点
|
||||
onLoad(){
|
||||
}
|
||||
|
||||
/** 资源路径,如果没写的话就是类名 */
|
||||
public static _prefabPath = "";
|
||||
public static set prefabPath(path: string) {
|
||||
this._prefabPath = path;
|
||||
}
|
||||
public static get prefabPath() {
|
||||
if(!this._prefabPath || this._prefabPath.length <= 0) {
|
||||
this._prefabPath = SysDefine.UI_PATH_ROOT + uiHelper.getComponentName(this);
|
||||
console.log("component name:", uiHelper.getComponentName(this))
|
||||
}
|
||||
return this._prefabPath;
|
||||
}
|
||||
|
||||
/** 打开关闭UIBase */
|
||||
public static async openView(...parmas: any): Promise<UIBase> {
|
||||
return await UIManager.getInstance().openUIPanel(this.prefabPath, ...parmas);
|
||||
}
|
||||
public static async openViewWithLoading(...parmas: any): Promise<UIBase> {
|
||||
await TipsManager.inst.showLoadingPanel(this.prefabPath);
|
||||
let uiBase = await this.openView(...parmas);
|
||||
await TipsManager.inst.hideLoadingPanel();
|
||||
return uiBase;
|
||||
}
|
||||
public static async closeView(): Promise<boolean> {
|
||||
return await UIManager.getInstance().closeUIPanel(this.prefabPath);
|
||||
}
|
||||
|
||||
/** 预先初始化 */
|
||||
public async _preInit() {
|
||||
if(this._inited) return ;
|
||||
this._inited = true;
|
||||
if(this.autoBind) {
|
||||
Binder.bindComponent(this);
|
||||
}
|
||||
// 加载这个UI依赖的其他资源,其他资源可以也是UI
|
||||
await this.load();
|
||||
}
|
||||
|
||||
/** 可以在这里进行一些资源的加载, 具体实现可以看test下的代码 */
|
||||
public async load() {}
|
||||
|
||||
public onShow(...obj: any) {}
|
||||
|
||||
public onHide() {}
|
||||
|
||||
//清空对象
|
||||
public onRemove(){
|
||||
for(let idx=0;idx<this._vecChildPerfab.length;++idx){
|
||||
let com = this._vecChildPerfab[idx].getComponent(UIBase)
|
||||
ResManager.inst.destoryPrefab(com)
|
||||
}
|
||||
}
|
||||
|
||||
/** 通过闭包,保留resolve.在合适的时间调用cb方法 */
|
||||
public waitPromise(): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this._cb = (confirm: any) => {
|
||||
resolve(confirm);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//关闭自己
|
||||
public async closeUIPanel(): Promise<boolean> {
|
||||
return await UIManager.getInstance().closeUIPanel(this.uid);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param perfabName 预制体名字
|
||||
* @param parent 当前窗体的节点
|
||||
*/
|
||||
public async addChildPerfab(perfabName: string,parent:cc.Node) {
|
||||
let nodePb = await ResManager.inst.loadPrefab(perfabName)
|
||||
if(nodePb)
|
||||
{
|
||||
parent.addChild(nodePb);
|
||||
this._vecChildPerfab.push(nodePb)
|
||||
}
|
||||
return nodePb
|
||||
}
|
||||
//需要手动删除的时候,可以调用,非必须
|
||||
public async delChildPerfab(child:cc.Node) {
|
||||
let index = this._vecChildPerfab.indexOf(child);
|
||||
if(index > -1) {
|
||||
let com = child.getComponent(UIBase)
|
||||
ResManager.inst.destoryPrefab(com)
|
||||
this._vecChildPerfab.splice(index,1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹窗动画ui
|
||||
*/
|
||||
public async showAnimation() {
|
||||
if(this.panelType === PanelType.PopUp) {
|
||||
this.node.scale = 0;
|
||||
await uiHelper.runTweenAsync(this.node, cc.tween().to(0.3, {scale: 1}, cc.easeBackOut()));
|
||||
}
|
||||
}
|
||||
public async hideAnimation() {
|
||||
if(this.panelType === PanelType.PopUp) {
|
||||
this.node.scale = 1;
|
||||
await uiHelper.runTweenAsync(this.node, cc.tween().to(0.3, {scale: 0}, cc.easeBackOut()));
|
||||
}
|
||||
}
|
||||
|
||||
/** 设置是否挡住触摸事件 */
|
||||
private _blocker: cc.BlockInputEvents = null;
|
||||
public setBlockInput(block: boolean) {
|
||||
if(block && !this._blocker) {
|
||||
let node = new cc.Node('block_input_events');
|
||||
this._blocker = node.addComponent(cc.BlockInputEvents);
|
||||
this._blocker.node.setContentSize(AdapterManager.inst.visibleSize);
|
||||
this.node.addChild(this._blocker.node, cc.macro.MAX_ZINDEX);
|
||||
}else if(!block && this._blocker) {
|
||||
this._blocker.node.destroy();
|
||||
this._blocker.node.removeFromParent();
|
||||
this._blocker = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
9
assets/common/ui/base/UIBase.ts.meta
Normal file
9
assets/common/ui/base/UIBase.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "828608f2-c2d0-4252-be98-9c77b5230481",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
26
assets/common/ui/base/UIBinder.ts
Normal file
26
assets/common/ui/base/UIBinder.ts
Normal file
@ -0,0 +1,26 @@
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class UIBinder extends cc.Component {
|
||||
|
||||
$collector: string;
|
||||
|
||||
|
||||
_Nodes : {[name: string]: cc.Node} = cc.js.createMap();
|
||||
_Labels : {[name: string]: cc.Label} = cc.js.createMap();
|
||||
_Buttons : {[name: string]: cc.Button} = cc.js.createMap();
|
||||
_Sprites : {[name: string]: cc.Sprite} = cc.js.createMap();
|
||||
_RichTexts : {[name: string]: cc.RichText} = cc.js.createMap();
|
||||
_MotionStreaks: {[name: string]: cc.MotionStreak} = cc.js.createMap();
|
||||
_Graphicss : {[name: string]: cc.Graphics} = cc.js.createMap();
|
||||
_EditBoxs : {[name: string]: cc.EditBox} = cc.js.createMap();
|
||||
_ScrollViews : {[name: string]: cc.ScrollView} = cc.js.createMap();
|
||||
_ProgressBars : {[name: string]: cc.ProgressBar} = cc.js.createMap();
|
||||
_Sliders : {[name: string]: cc.Slider} = cc.js.createMap();
|
||||
_PageViews : {[name: string]: cc.PageView} = cc.js.createMap();
|
||||
|
||||
start () {
|
||||
}
|
||||
|
||||
// update (dt) {}
|
||||
}
|
||||
9
assets/common/ui/base/UIBinder.ts.meta
Normal file
9
assets/common/ui/base/UIBinder.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "103ec118-b2cb-4ee8-aaf8-a3ee3049599e",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
90
assets/common/ui/base/UIHelper.ts
Normal file
90
assets/common/ui/base/UIHelper.ts
Normal file
@ -0,0 +1,90 @@
|
||||
import { SysDefine } from "../config/SysDefine";
|
||||
|
||||
export default class UiHelper {
|
||||
/**
|
||||
* 寻找子节点
|
||||
*/
|
||||
public static findChildInNode(nodeName: string, rootNode: cc.Node): cc.Node {
|
||||
if(rootNode.name == nodeName) {
|
||||
return rootNode;
|
||||
}
|
||||
for(let i=0; i<rootNode.childrenCount; i++) {
|
||||
let node = this.findChildInNode(nodeName, rootNode.children[i]);
|
||||
if(node) {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** 检测前缀是否符合绑定规范 */
|
||||
public static checkNodePrefix(name: string) {
|
||||
if(name[0] !== SysDefine.SYS_STANDARD_Prefix) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/** 检查后缀 */
|
||||
public static checkBindChildren(name: string) {
|
||||
if(name[name.length-1] !== SysDefine.SYS_STANDARD_End) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/** 获得类型和name */
|
||||
public static getPrefixNames(name: string) {
|
||||
if(name === null) {
|
||||
return ;
|
||||
}
|
||||
return name.split(SysDefine.SYS_STANDARD_Separator);
|
||||
}
|
||||
/** 获得Component的类名 */
|
||||
public static getComponentName(com: Function) {
|
||||
let arr = com.name.match(/<.*>$/);
|
||||
if(arr && arr.length > 0) {
|
||||
return arr[0].slice(1, -1);
|
||||
}
|
||||
return com.name;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
*
|
||||
* @param target
|
||||
* @param repeat -1,表示永久执行
|
||||
* @param tweens
|
||||
*/
|
||||
public static async runRepeatTweenAsync(target: any, repeat: number, ...tweens: cc.Tween[]) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let selfTween = cc.tween(target);
|
||||
for(const tmpTween of tweens) {
|
||||
selfTween = selfTween.then(tmpTween);
|
||||
}
|
||||
if(repeat < 0) {
|
||||
cc.tween(target).repeatForever(selfTween).start();
|
||||
}else {
|
||||
cc.tween(target).repeat(repeat, selfTween).start();
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 同步的tween */
|
||||
public static async runTweenAsync(target: any, ...tweens: cc.Tween[]): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
let selfTween = cc.tween(target);
|
||||
for(const tmpTween of tweens) {
|
||||
selfTween = selfTween.then(tmpTween);
|
||||
}
|
||||
selfTween.call(() => {
|
||||
resolve();
|
||||
}).start();
|
||||
});
|
||||
}
|
||||
/** 停止tween */
|
||||
public stopTween(target: any) {
|
||||
cc.Tween.stopAllByTarget(target);
|
||||
}
|
||||
public stopTweenByTag(tag: number) {
|
||||
cc.Tween.stopAllByTag(tag);
|
||||
}
|
||||
}
|
||||
9
assets/common/ui/base/UIHelper.ts.meta
Normal file
9
assets/common/ui/base/UIHelper.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "3451ab80-84de-4f00-b476-68061ac6b3d7",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/ui/config.meta
Normal file
12
assets/common/ui/config.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "d1c72af4-3ff5-452b-b8ba-2e113b597e8e",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
82
assets/common/ui/config/SysDefine.ts
Normal file
82
assets/common/ui/config/SysDefine.ts
Normal file
@ -0,0 +1,82 @@
|
||||
/**窗体类型 */
|
||||
export enum PanelType {
|
||||
/** 屏幕 */
|
||||
Screen,
|
||||
/** 固定窗口 */
|
||||
FixedUI,
|
||||
/** 弹出窗口 */
|
||||
PopUp,
|
||||
/** 独立窗口 */
|
||||
TopTips,
|
||||
/* 子节点,动态加载到ui上的子节点*/
|
||||
Perfab,
|
||||
}
|
||||
/**透明度类型 */
|
||||
export enum MaskOpacity {
|
||||
/** 没有mask, 可以穿透 */
|
||||
None,
|
||||
/** 完全透明,不能穿透 */
|
||||
OpacityZero,
|
||||
/** 高透明度,不能穿透 */
|
||||
OpacityLow,
|
||||
/** 半透明,不能穿透 */
|
||||
OpacityHalf,
|
||||
/** 低透明度, 不能穿透 */
|
||||
OpacityHigh,
|
||||
/** 完全不透明 */
|
||||
OpacityFull,
|
||||
}
|
||||
/** UI的状态 */
|
||||
export enum UIState {
|
||||
None = 0,
|
||||
Loading = 1,
|
||||
Showing = 2,
|
||||
Hiding = 3
|
||||
}
|
||||
/** 常量 */
|
||||
export class SysDefine {
|
||||
/* 路径常量 */
|
||||
public static SYS_PATH_CANVAS = "Canvas";
|
||||
public static SYS_PATH_UIFORMS_CONFIG_INFO = "UIPanelsConfigInfo";
|
||||
public static SYS_PATH_CONFIG_INFO = "SysConfigInfo";
|
||||
/* 标签常量 */
|
||||
public static SYS_UIROOT_NAME = "Canvas/Scene/UIROOT";
|
||||
public static SYS_UIMASK_NAME = "Canvas/Scene/UIROOT/UIMaskManager";
|
||||
public static SYS_UIAdapter_NAME = "Canvas/Scene/UIROOT/UIAdapterManager";
|
||||
/* 节点常量 */
|
||||
public static SYS_SCREEN_NODE = "Screen";
|
||||
public static SYS_FIXEDUI_NODE = "FixedUI";
|
||||
public static SYS_POPUP_NODE = "PopUp";
|
||||
public static SYS_TOPTIPS_NODE = "TopTips";
|
||||
/** 规范符号 */
|
||||
public static SYS_STANDARD_Prefix = '_';
|
||||
public static SYS_STANDARD_Separator = '$';
|
||||
public static SYS_STANDARD_End = '#';
|
||||
|
||||
public static UI_PATH_ROOT = 'UIPanels/';
|
||||
|
||||
public static SeparatorMap: {[key: string]: string} = {
|
||||
"_Node" : "cc.Node",
|
||||
"_Label" : "cc.Label",
|
||||
"_Button" : "cc.Button",
|
||||
"_Sprite" : "cc.Sprite",
|
||||
"_RichText" : "cc.RichText",
|
||||
"_Mask" : "cc.Mask",
|
||||
"_MotionStreak": "cc.MotionStreak",
|
||||
"_TiledMap" : "cc.TiledMap",
|
||||
"_TiledTile" : "cc.TiledTile",
|
||||
"_Spine" : "sp.Skeleton",
|
||||
"_Graphics" : "cc.Graphics",
|
||||
"_Animation" : "cc.Animation",
|
||||
"_WebView" : "cc.WebView",
|
||||
"_EditBox" : "cc.EditBox",
|
||||
"_ScrollView" : "cc.ScrollView",
|
||||
"_VideoPlayer" : "cc.VideoPlayer",
|
||||
"_ProgressBar" : "cc.ProgressBar",
|
||||
"_PageView" : "cc.PageView",
|
||||
"_Slider" : "cc.Slider",
|
||||
"_Toggle" : "cc.Toggle",
|
||||
"_ButtonPlus" : "ButtonPlus",
|
||||
};
|
||||
|
||||
}
|
||||
9
assets/common/ui/config/SysDefine.ts.meta
Normal file
9
assets/common/ui/config/SysDefine.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "69e82fdc-6b83-4ccd-b9d0-0fc99f5cd131",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/ui/uiEv.meta
Normal file
12
assets/common/ui/uiEv.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "7796b825-9433-4ff3-afb2-3e868329c529",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
136
assets/common/ui/uiEv/EventCenter.ts
Normal file
136
assets/common/ui/uiEv/EventCenter.ts
Normal file
@ -0,0 +1,136 @@
|
||||
import { Pool, IPool } from "../../utils/Pool";
|
||||
|
||||
export class EventInfo implements IPool {
|
||||
callback: Function;
|
||||
target: any;
|
||||
once: boolean;
|
||||
|
||||
free() {
|
||||
this.callback = null;
|
||||
this.target = null;
|
||||
this.once = false;
|
||||
}
|
||||
|
||||
init(callback: Function, target: Object, once: boolean) {
|
||||
this.callback = callback;
|
||||
this.target = target;
|
||||
this.once = once;
|
||||
}
|
||||
}
|
||||
class RemoveCommand {
|
||||
public eventName:string;
|
||||
public targetId:string;
|
||||
public callback: Function;
|
||||
|
||||
constructor(eventName: string, callback: Function, targetId: string) {
|
||||
this.eventName = eventName;
|
||||
this.callback = callback;
|
||||
this.targetId = targetId;
|
||||
}
|
||||
}
|
||||
|
||||
let idSeed = 1; // 这里有一个小缺陷就是idSeed有最大值,Number.MAX_VALUE
|
||||
export class EventCenter {
|
||||
|
||||
private static _listeners: {[eventName: string]: {[id: string]: Array<EventInfo>}} = cc.js.createMap();
|
||||
private static _dispatching : number = 0;
|
||||
private static _removeCommands : RemoveCommand[] = [];
|
||||
|
||||
private static _eventPool: Pool<EventInfo> = new Pool<EventInfo>(() => {
|
||||
return new EventInfo();
|
||||
}, 10);
|
||||
|
||||
public static on(eventName: string, callback: Function, target: any = undefined, once = false) {
|
||||
target = target || this;
|
||||
let targetId: string = target['uuid'] || target['id'];
|
||||
if(targetId === undefined) {
|
||||
target['uuid'] = targetId = '' + idSeed++;
|
||||
}
|
||||
this.onById(eventName, targetId, target, callback, once);
|
||||
}
|
||||
public static once(eventName: string, callback: Function, target: any = undefined) {
|
||||
this.on(eventName, callback, target, true);
|
||||
}
|
||||
private static onById(eventName: string, targetId: string, target: any, cb: Function, once: boolean) {
|
||||
let collection = this._listeners[eventName];
|
||||
if(!collection) {
|
||||
collection = this._listeners[eventName] = {};
|
||||
}
|
||||
let events = collection[targetId];
|
||||
if(!events) {
|
||||
events = collection[targetId] = [];
|
||||
}
|
||||
let eventInfo = this._eventPool.alloc();
|
||||
eventInfo.init(cb, target, once);
|
||||
events.push(eventInfo);
|
||||
}
|
||||
|
||||
|
||||
public static off(eventName: string, callback: Function, target: any = undefined) {
|
||||
target = target || this;
|
||||
let targetId = target['uuid'] || target['id'];
|
||||
if(!targetId) return ;
|
||||
this.offById(eventName, callback, targetId);
|
||||
}
|
||||
public static targetOff(target: any) {
|
||||
target = target || this;
|
||||
let targetId = target['uuid'] || target['id'];
|
||||
if(!targetId) return ;
|
||||
for(let event in this._listeners) {
|
||||
let collection = this._listeners[event];
|
||||
if(collection[targetId] !== undefined) {
|
||||
delete collection[targetId];
|
||||
}
|
||||
}
|
||||
}
|
||||
private static offById(eventName: string, callback: Function, targetId: string) {
|
||||
if(this._dispatching > 0) {
|
||||
let cmd = new RemoveCommand(eventName, callback, targetId);
|
||||
this._removeCommands.push(cmd);
|
||||
}else {
|
||||
this.doOff(eventName, callback, targetId);
|
||||
}
|
||||
}
|
||||
private static doOff(eventName: string, callback: Function, targetId: string) {
|
||||
let collection = this._listeners[eventName];
|
||||
if(!collection) return ;
|
||||
let events = collection[targetId];
|
||||
if(!events) return ;
|
||||
for(let i=events.length-1; i>=0; i--) {
|
||||
if(events[i].callback === callback) {
|
||||
events.splice(i, 1);
|
||||
}
|
||||
}
|
||||
if(events.length === 0) {
|
||||
collection[targetId] = null;
|
||||
delete collection[targetId];
|
||||
}
|
||||
}
|
||||
|
||||
private static doRemoveCommands() {
|
||||
if(this._dispatching !== 0) {
|
||||
return;
|
||||
}
|
||||
for(let cmd of this._removeCommands) {
|
||||
this.doOff(cmd.eventName, cmd.callback, cmd.targetId);
|
||||
}
|
||||
this._removeCommands.length = 0;
|
||||
}
|
||||
|
||||
public static emit(eventName: string, ...param: any[]) {
|
||||
let collection = this._listeners[eventName];
|
||||
if(!collection) return false;
|
||||
this._dispatching ++;
|
||||
for(let targetId in collection) {
|
||||
for(let eventInfo of collection[targetId]) {
|
||||
eventInfo.callback.call(eventInfo.target, ...param);
|
||||
if(eventInfo.once) {
|
||||
let cmd = new RemoveCommand(eventName, eventInfo.callback, targetId);
|
||||
this._removeCommands.push(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
this._dispatching --;
|
||||
this.doRemoveCommands();
|
||||
}
|
||||
}
|
||||
9
assets/common/ui/uiEv/EventCenter.ts.meta
Normal file
9
assets/common/ui/uiEv/EventCenter.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "e8b5c41a-34b0-4da4-a35b-1316820fcaef",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
26
assets/common/ui/uiEv/UIBaseEv.ts
Normal file
26
assets/common/ui/uiEv/UIBaseEv.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import UIBase from "../base/UIBase";
|
||||
import {EventCenter} from "./EventCenter";
|
||||
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class UIBaseEv extends UIBase {
|
||||
public registEvent(name:string,callback: Function,onece?:boolean)
|
||||
{
|
||||
EventCenter.on(name,callback,this,onece)
|
||||
}
|
||||
|
||||
public onShow(...obj: any) {
|
||||
super.onShow(obj)
|
||||
this.initEvent()
|
||||
}
|
||||
|
||||
public initEvent(){
|
||||
|
||||
}
|
||||
//清空对象
|
||||
public onRemove(){
|
||||
super.onRemove()
|
||||
EventCenter.targetOff(this)
|
||||
}
|
||||
}
|
||||
9
assets/common/ui/uiEv/UIBaseEv.ts.meta
Normal file
9
assets/common/ui/uiEv/UIBaseEv.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "6f8b417f-3ea0-4bc9-82f1-84f048390e10",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/common/utils.meta
Normal file
12
assets/common/utils.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "509f0e73-fb9d-4ce8-91af-81ee4661771f",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
66
assets/common/utils/Pool.ts
Normal file
66
assets/common/utils/Pool.ts
Normal file
@ -0,0 +1,66 @@
|
||||
export interface IPool {
|
||||
use?(): any;
|
||||
free?(): any;
|
||||
}
|
||||
export class Pool<T extends IPool> {
|
||||
private _fn: () => T;
|
||||
private _idx: number;
|
||||
private _frees: T[];
|
||||
|
||||
public get freeCount() {
|
||||
return this._frees.length;
|
||||
}
|
||||
|
||||
constructor(fn: () => T, size: number) {
|
||||
this._fn = fn;
|
||||
this._idx = size - 1;
|
||||
this._frees = new Array<T>(size);
|
||||
|
||||
for(let i=0; i<size; i++) {
|
||||
this._frees[i] = fn();
|
||||
}
|
||||
}
|
||||
|
||||
public alloc(): T {
|
||||
if(this._idx < 0) {
|
||||
this._expand(Math.round(this._frees.length * 1.2) + 1);
|
||||
}
|
||||
const obj = this._frees[this._idx];
|
||||
this._frees.splice(this._idx);
|
||||
--this._idx;
|
||||
|
||||
obj.use && obj.use();
|
||||
return obj;
|
||||
}
|
||||
|
||||
public free(obj: T) {
|
||||
++ this._idx;
|
||||
obj.free && obj.free();
|
||||
this._frees[this._idx] = obj;
|
||||
}
|
||||
|
||||
public clear(fn: (obj: T) => void) {
|
||||
for(let i=0; i<this._idx; i++) {
|
||||
fn && fn(this._frees[i]);
|
||||
}
|
||||
this._frees.splice(0);
|
||||
this._idx = -1;
|
||||
}
|
||||
|
||||
|
||||
private _expand(size: number) {
|
||||
const old = this._frees;
|
||||
this._frees = new Array(size);
|
||||
|
||||
const len = size - old.length;
|
||||
for(let i=0; i<len; i++) {
|
||||
this._frees[i] = this._fn();
|
||||
}
|
||||
|
||||
for(let i=len,j=0; i<size; ++i, ++j) {
|
||||
this._frees[i] = old[j];
|
||||
}
|
||||
|
||||
this._idx += len;
|
||||
}
|
||||
}
|
||||
9
assets/common/utils/Pool.ts.meta
Normal file
9
assets/common/utils/Pool.ts.meta
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "8cbd49b6-e49b-43ce-a008-23ac54efd0f4",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/resources.meta
Normal file
12
assets/resources.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "7ace7618-9e31-47f2-a299-1cc99974cce4",
|
||||
"isBundle": true,
|
||||
"bundleName": "resources",
|
||||
"priority": 8,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
12
assets/resources/Prefabs.meta
Normal file
12
assets/resources/Prefabs.meta
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"ver": "1.1.2",
|
||||
"uuid": "e744f739-c163-47b1-bfd0-f1fbb9942315",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
||||
939
assets/resources/Prefabs/earningFishModule.prefab
Normal file
939
assets/resources/Prefabs/earningFishModule.prefab
Normal file
@ -0,0 +1,939 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "earningFishModule",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 9
|
||||
},
|
||||
{
|
||||
"__id__": 19
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 23
|
||||
},
|
||||
{
|
||||
"__id__": 24
|
||||
},
|
||||
{
|
||||
"__id__": 25
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 26
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 160,
|
||||
"height": 200
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 1
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "fishSpr",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 6
|
||||
},
|
||||
{
|
||||
"__id__": 7
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 8
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 144,
|
||||
"g": 212,
|
||||
"b": 241,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 120,
|
||||
"height": 100
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
-76,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "unlockLabel",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 4
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 60,
|
||||
"height": 25.2
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 3
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "可解锁",
|
||||
"_N$string": "可解锁",
|
||||
"_fontSize": 20,
|
||||
"_lineHeight": 20,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 3
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "27756ebb-3d33-44b0-9b96-e858fadd4dd4"
|
||||
},
|
||||
"fileId": "48qHy5u/lLAZ2XKiUeq8wg",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "410fb916-8721-4663-bab8-34397391ace7"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 17,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 26,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 2
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "96083d03-c332-4a3f-9386-d03e2d19e8ee"
|
||||
},
|
||||
"fileId": "09JPWAy2lDFbdxMc8GxyQq",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "graySpr",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 10
|
||||
},
|
||||
{
|
||||
"__id__": 13
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 16
|
||||
},
|
||||
{
|
||||
"__id__": 17
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 18
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 120,
|
||||
"height": 100
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
-76,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "sellText",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 9
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 11
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 12
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 252,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 60,
|
||||
"height": 25.2
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-0.435,
|
||||
8.706,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "已售出",
|
||||
"_N$string": "已售出",
|
||||
"_fontSize": 20,
|
||||
"_lineHeight": 20,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 10
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "27756ebb-3d33-44b0-9b96-e858fadd4dd4"
|
||||
},
|
||||
"fileId": "e04x3MD0dBIqWjYVty0Hpy",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "sellLabel",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 9
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 14
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 15
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 252,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 33.37,
|
||||
"height": 25.2
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0.435,
|
||||
-12.188,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 13
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "500",
|
||||
"_N$string": "500",
|
||||
"_fontSize": 20,
|
||||
"_lineHeight": 20,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 13
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "27756ebb-3d33-44b0-9b96-e858fadd4dd4"
|
||||
},
|
||||
"fileId": "cdALSD1/5A7bE1+Lry8xBk",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 9
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "410fb916-8721-4663-bab8-34397391ace7"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 9
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 17,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 26,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 9
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "96083d03-c332-4a3f-9386-d03e2d19e8ee"
|
||||
},
|
||||
"fileId": "c0Knv8ZzhMxIwlxBHvk4C/",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "nameLabel",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 20
|
||||
},
|
||||
{
|
||||
"__id__": 21
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 22
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 40,
|
||||
"height": 25.2
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
-168,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 19
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "角鲸",
|
||||
"_N$string": "角鲸",
|
||||
"_fontSize": 20,
|
||||
"_lineHeight": 20,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 19
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 20,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 19.400000000000006,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 19
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "27756ebb-3d33-44b0-9b96-e858fadd4dd4"
|
||||
},
|
||||
"fileId": "e8vTAcGMFM/4kquBcQbSyt",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "9bbda31e-ad49-43c9-aaf2-f7d9896bac69"
|
||||
},
|
||||
"_type": 1,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Layout",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_layoutSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 160,
|
||||
"height": 200
|
||||
},
|
||||
"_resize": 0,
|
||||
"_N$layoutType": 0,
|
||||
"_N$cellSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 40,
|
||||
"height": 40
|
||||
},
|
||||
"_N$startAxis": 0,
|
||||
"_N$paddingLeft": 0,
|
||||
"_N$paddingRight": 0,
|
||||
"_N$paddingTop": 0,
|
||||
"_N$paddingBottom": 0,
|
||||
"_N$spacingX": 0,
|
||||
"_N$spacingY": 0,
|
||||
"_N$verticalDirection": 1,
|
||||
"_N$horizontalDirection": 0,
|
||||
"_N$affectedByScale": false,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "1f276vPjVpIaa0EieD0b3FP",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"fishSpr": {
|
||||
"__id__": 6
|
||||
},
|
||||
"graySpr": {
|
||||
"__id__": 16
|
||||
},
|
||||
"unlockLabel": {
|
||||
"__id__": 4
|
||||
},
|
||||
"nameLabel": {
|
||||
"__id__": 20
|
||||
},
|
||||
"sellLabel": {
|
||||
"__id__": 14
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "9c638f72-bb74-47a2-8619-82b7198c57e6"
|
||||
},
|
||||
"fileId": "",
|
||||
"sync": false
|
||||
}
|
||||
]
|
||||
8
assets/resources/Prefabs/earningFishModule.prefab.meta
Normal file
8
assets/resources/Prefabs/earningFishModule.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "9c638f72-bb74-47a2-8619-82b7198c57e6",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
393
assets/resources/Prefabs/fishListModule.prefab
Normal file
393
assets/resources/Prefabs/fishListModule.prefab
Normal file
@ -0,0 +1,393 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "fishListModule",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 5
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 8
|
||||
},
|
||||
{
|
||||
"__id__": 9
|
||||
},
|
||||
{
|
||||
"__id__": 10
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 11
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 80,
|
||||
"g": 241,
|
||||
"b": 244,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 320,
|
||||
"height": 300
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 1
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-175,
|
||||
-20,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "fishSpr",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 280,
|
||||
"height": 200
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
-120,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "fbba38eb-7caf-4236-b6e6-a0065f3e7f42"
|
||||
},
|
||||
"fileId": "0eZUOlXfBFsoS7ZrccLHHk",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "fishStr",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 6
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 7
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 90,
|
||||
"height": 50.4
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
-258.095,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "小丑鱼",
|
||||
"_N$string": "小丑鱼",
|
||||
"_fontSize": 30,
|
||||
"_lineHeight": 40,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "fbba38eb-7caf-4236-b6e6-a0065f3e7f42"
|
||||
},
|
||||
"fileId": "40MX4TVsZKJ72N54RjG1t3",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "9bbda31e-ad49-43c9-aaf2-f7d9896bac69"
|
||||
},
|
||||
"_type": 1,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Layout",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_layoutSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 320,
|
||||
"height": 300
|
||||
},
|
||||
"_resize": 0,
|
||||
"_N$layoutType": 0,
|
||||
"_N$cellSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 40,
|
||||
"height": 40
|
||||
},
|
||||
"_N$startAxis": 0,
|
||||
"_N$paddingLeft": 0,
|
||||
"_N$paddingRight": 0,
|
||||
"_N$paddingTop": 0,
|
||||
"_N$paddingBottom": 0,
|
||||
"_N$spacingX": 0,
|
||||
"_N$spacingY": 0,
|
||||
"_N$verticalDirection": 1,
|
||||
"_N$horizontalDirection": 0,
|
||||
"_N$affectedByScale": false,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "681f8+Rim1AvL30rXL2y0f7",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"fishNameLabel": {
|
||||
"__id__": 6
|
||||
},
|
||||
"text": "hello",
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "fbba38eb-7caf-4236-b6e6-a0065f3e7f42"
|
||||
},
|
||||
"fileId": "",
|
||||
"sync": false
|
||||
}
|
||||
]
|
||||
8
assets/resources/Prefabs/fishListModule.prefab.meta
Normal file
8
assets/resources/Prefabs/fishListModule.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "fbba38eb-7caf-4236-b6e6-a0065f3e7f42",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
1738
assets/resources/Prefabs/fishingUpgradeModule.prefab
Normal file
1738
assets/resources/Prefabs/fishingUpgradeModule.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "c098dfa1-9ce2-48aa-b8c2-30884f079f69",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
825
assets/resources/Prefabs/signInModule.prefab
Normal file
825
assets/resources/Prefabs/signInModule.prefab
Normal file
@ -0,0 +1,825 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "signInModule",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 6
|
||||
},
|
||||
{
|
||||
"__id__": 10
|
||||
},
|
||||
{
|
||||
"__id__": 14
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 20
|
||||
},
|
||||
{
|
||||
"__id__": 21
|
||||
},
|
||||
{
|
||||
"__id__": 22
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 23
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 220,
|
||||
"height": 120
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "daysLabel",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 3
|
||||
},
|
||||
{
|
||||
"__id__": 4
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 5
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 62.5,
|
||||
"height": 31.5
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-65.68,
|
||||
34.841,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "第x天",
|
||||
"_N$string": "第x天",
|
||||
"_fontSize": 25,
|
||||
"_lineHeight": 25,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 9,
|
||||
"_left": 13.069999999999993,
|
||||
"_right": 0,
|
||||
"_top": 9.408999999999999,
|
||||
"_bottom": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 2
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "27756ebb-3d33-44b0-9b96-e858fadd4dd4"
|
||||
},
|
||||
"fileId": "4enXVKS0ZDHbasqX6D5vZ2",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "getText",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 7
|
||||
},
|
||||
{
|
||||
"__id__": 8
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 9
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 100,
|
||||
"height": 31.5
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
47.093999999999994,
|
||||
-7.448999999999998,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "立即获得",
|
||||
"_N$string": "立即获得",
|
||||
"_fontSize": 25,
|
||||
"_lineHeight": 25,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 36,
|
||||
"_left": 0,
|
||||
"_right": 12.906000000000006,
|
||||
"_top": 0,
|
||||
"_bottom": 36.801,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 6
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "27756ebb-3d33-44b0-9b96-e858fadd4dd4"
|
||||
},
|
||||
"fileId": "2eNYMyDUFCcptTD+xkevSS",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "earningsLabel",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 11
|
||||
},
|
||||
{
|
||||
"__id__": 12
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 13
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 112.5,
|
||||
"height": 31.5
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
47.093999999999994,
|
||||
-37.052,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "x小时收益",
|
||||
"_N$string": "x小时收益",
|
||||
"_fontSize": 25,
|
||||
"_lineHeight": 25,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_enabled": true,
|
||||
"alignMode": 1,
|
||||
"_target": null,
|
||||
"_alignFlags": 36,
|
||||
"_left": 0,
|
||||
"_right": 6.656000000000006,
|
||||
"_top": 0,
|
||||
"_bottom": 7.198,
|
||||
"_verticalCenter": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 0,
|
||||
"_originalHeight": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 10
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "27756ebb-3d33-44b0-9b96-e858fadd4dd4"
|
||||
},
|
||||
"fileId": "c0gHcfGS1GvrIa/3u9YNtg",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "graySpr",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 15
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 18
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 19
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 220,
|
||||
"height": 120
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "signInStateLabel",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 14
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 16
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 17
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 60,
|
||||
"height": 25.2
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 15
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "已签到",
|
||||
"_N$string": "已签到",
|
||||
"_fontSize": 20,
|
||||
"_lineHeight": 20,
|
||||
"_enableWrapText": true,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 0,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 0,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 15
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "27756ebb-3d33-44b0-9b96-e858fadd4dd4"
|
||||
},
|
||||
"fileId": "f2QgJYwSVOdroDuWk89+kA",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 14
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "410fb916-8721-4663-bab8-34397391ace7"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 14
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "96083d03-c332-4a3f-9386-d03e2d19e8ee"
|
||||
},
|
||||
"fileId": "d4c6ZAfQtL2Jdm7ytjCAIf",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "9bbda31e-ad49-43c9-aaf2-f7d9896bac69"
|
||||
},
|
||||
"_type": 1,
|
||||
"_sizeMode": 0,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Layout",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"_layoutSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 220,
|
||||
"height": 120
|
||||
},
|
||||
"_resize": 0,
|
||||
"_N$layoutType": 0,
|
||||
"_N$cellSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 40,
|
||||
"height": 40
|
||||
},
|
||||
"_N$startAxis": 0,
|
||||
"_N$paddingLeft": 0,
|
||||
"_N$paddingRight": 0,
|
||||
"_N$paddingTop": 0,
|
||||
"_N$paddingBottom": 0,
|
||||
"_N$spacingX": 0,
|
||||
"_N$spacingY": 0,
|
||||
"_N$verticalDirection": 1,
|
||||
"_N$horizontalDirection": 0,
|
||||
"_N$affectedByScale": false,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "4f151+Fq6FA8JpYDt48nlzV",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"daysLabel": {
|
||||
"__id__": 3
|
||||
},
|
||||
"earningsLabel": {
|
||||
"__id__": 11
|
||||
},
|
||||
"graySpr": {
|
||||
"__id__": 18
|
||||
},
|
||||
"signInStateLabel": {
|
||||
"__id__": 16
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "05cbf672-1a49-4cf0-94aa-9e2595154ca4"
|
||||
},
|
||||
"fileId": "",
|
||||
"sync": false
|
||||
}
|
||||
]
|
||||
8
assets/resources/Prefabs/signInModule.prefab.meta
Normal file
8
assets/resources/Prefabs/signInModule.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"ver": "1.2.9",
|
||||
"uuid": "05cbf672-1a49-4cf0-94aa-9e2595154ca4",
|
||||
"optimizationPolicy": "AUTO",
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
215
assets/resources/Prefabs/touristModule.prefab
Normal file
215
assets/resources/Prefabs/touristModule.prefab
Normal file
@ -0,0 +1,215 @@
|
||||
[
|
||||
{
|
||||
"__type__": "cc.Prefab",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"_native": "",
|
||||
"data": {
|
||||
"__id__": 1
|
||||
},
|
||||
"optimizationPolicy": 0,
|
||||
"asyncLoadAssets": false,
|
||||
"readonly": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "touristModule",
|
||||
"_objFlags": 0,
|
||||
"_parent": null,
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 2
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 5
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
-493.137,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "singleTourist",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 3
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 4
|
||||
},
|
||||
"_opacity": 255,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 255,
|
||||
"g": 255,
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 36,
|
||||
"height": 40
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_trs": {
|
||||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
"_eulerAngles": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_skewX": 0,
|
||||
"_skewY": 0,
|
||||
"_is3DNode": false,
|
||||
"_groupIndex": 0,
|
||||
"groupIndex": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_enabled": true,
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "0a6d0d24-1f19-4aff-aa96-4e3cb2d8962d"
|
||||
},
|
||||
"_type": 0,
|
||||
"_sizeMode": 1,
|
||||
"_fillType": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "f54aa56d-666b-4d30-aaee-5beb9d1589c2"
|
||||
},
|
||||
"fileId": "dciWToLF9IYIa0U3Uk36+Q",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "5e0abNjh8RAS4GptkxfVPwr",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"singleTourist": {
|
||||
"__id__": 3
|
||||
},
|
||||
"maxDelayTime": 3,
|
||||
"minMoveTime": 3,
|
||||
"moveDistantTime": 1,
|
||||
"speed": 50,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__uuid__": "f54aa56d-666b-4d30-aaee-5beb9d1589c2"
|
||||
},
|
||||
"fileId": "",
|
||||
"sync": false
|
||||
}
|
||||
]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user