添加框架脚本文件夹注释

This commit is contained in:
dgflash
2024-11-12 18:30:10 +08:00
parent df29a0a928
commit 313e940046
41 changed files with 165 additions and 97 deletions

1
assets/core/.core.md Normal file
View File

@@ -0,0 +1 @@
框架核心功能

View File

@@ -0,0 +1 @@
游戏公共功能库

View File

@@ -0,0 +1,3 @@
音效管理
1. 背景音乐管理
2. 游戏音效管理

View File

@@ -0,0 +1 @@
消息管理

View File

@@ -0,0 +1 @@
资源管理

View File

@@ -0,0 +1 @@
日志管理

View File

@@ -0,0 +1 @@
随机数库

View File

@@ -0,0 +1 @@
本地存储

View File

@@ -0,0 +1,3 @@
时间管理
1. 时间管理器
2. 定时器

View File

@@ -0,0 +1 @@
游戏核心玩法层

1
assets/core/gui/.gui.md Normal file
View File

@@ -0,0 +1 @@
游戏界面管理库

View File

@@ -0,0 +1,8 @@
游戏显示对象分层管理
1. 二维游戏层
2. 游戏主界面层
3. 游戏弹窗层
4. 游戏模式窗口层
5. 系统模式窗口层
6. 滚动消息提示层
7. 新手引导层

View File

@@ -0,0 +1,4 @@
游戏综合提示界面
1. 公共提示窗口
2. 延迟提示动画
3. 滚动提示动画

View File

@@ -0,0 +1 @@
游戏框架综合工具库

1
assets/libs/.libs.md Normal file
View File

@@ -0,0 +1 @@
框架可选库

View File

@@ -0,0 +1 @@
动画特效管理

View File

@@ -0,0 +1 @@
移动动画组件

View File

@@ -0,0 +1 @@
动画状态机库

View File

@@ -0,0 +1 @@
行为树框架

View File

@@ -0,0 +1 @@
三维摄像机组件

View File

@@ -0,0 +1 @@
数据集合对象

1
assets/libs/ecs/.ecs.md Normal file
View File

@@ -0,0 +1 @@
Entity-Component-System 框架

View File

@@ -0,0 +1 @@
Cocos Creator 引擎扩展

1
assets/libs/gui/.gui.md Normal file
View File

@@ -0,0 +1 @@
游戏界面功能组件

View File

@@ -0,0 +1 @@
游戏按钮组件

View File

@@ -0,0 +1 @@
游戏标签组件

View File

@@ -0,0 +1 @@
游戏多语言组件

View File

@@ -0,0 +1 @@
MVVM 组件库

View File

@@ -0,0 +1,3 @@
游戏网络库
1. Http
2. WebSocket

View File

@@ -1,55 +0,0 @@
/*
* @Author: dgflash
* @Date: 2022-04-21 13:48:44
* @LastEditors: dgflash
* @LastEditTime: 2022-04-21 14:11:25
*/
import { IProtocolHelper, IRequestProtocol, IResponseProtocol, NetData } from "./NetInterface";
/** Protobuf.js 数据压缩协议 */
export class NetProtocolProtobuf implements IProtocolHelper {
getHeadlen(): number {
return 0;
}
getHearbeat(): NetData {
return "";
}
getPackageLen(msg: NetData): number {
return msg.toString().length;
}
checkResponsePackage(respProtocol: IResponseProtocol): boolean {
return true;
}
handlerResponsePackage(respProtocol: IResponseProtocol): boolean {
if (respProtocol.code == 1) {
if (respProtocol.isCompress) {
// respProtocol.data
// const p = Person.decode(msg);
}
respProtocol.data = JSON.parse(respProtocol.data);
return true;
}
else {
return false;
}
}
handlerRequestPackage(reqProtocol: IRequestProtocol): string {
var rspCmd = reqProtocol.cmd;
reqProtocol.callback = rspCmd;
if (reqProtocol.isCompress) {
// reqProtocol.data
// const msg = Person.encode({ name: "dgflash", id: 1 }).finish();
}
return rspCmd;
}
getPackageId(respProtocol: IResponseProtocol): string {
return respProtocol.callback!;
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "5714abb2-1adb-4e4a-b397-795b2f200533",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,35 +1,35 @@
// import { Camera, Component, gfx, MeshRenderer, RenderTexture, view, _decorator } from 'cc';
// const { ccclass, property } = _decorator;
import { _decorator, Camera, Component, gfx, MeshRenderer, RenderTexture, view } from 'cc';
const { ccclass, property } = _decorator;
// /** 三维摄像机内容显示到模型上 */
// @ccclass('RtToModel')
// export class RtToModel extends Component {
// @property(Camera)
// camara: Camera = null!;
/** 三维摄像机内容显示到模型上 */
@ccclass('RtToModel')
export class RtToModel extends Component {
@property(Camera)
camara: Camera = null!;
// @property(MeshRenderer)
// model: MeshRenderer = null!;
@property(MeshRenderer)
model: MeshRenderer = null!;
// private rt: RenderTexture = new RenderTexture();
private rt: RenderTexture = new RenderTexture();
// start() {
// const size = view.getVisibleSize();
// const colorAttachment = new gfx.ColorAttachment();
// const depthStencilAttachment = new gfx.DepthStencilAttachment();
// const pi = new gfx.RenderPassInfo([colorAttachment], depthStencilAttachment);
start() {
const size = view.getVisibleSize();
const colorAttachment = new gfx.ColorAttachment();
const depthStencilAttachment = new gfx.DepthStencilAttachment();
const pi = new gfx.RenderPassInfo([colorAttachment], depthStencilAttachment);
// this.rt.reset({
// width: size.width,
// height: size.height,
// passInfo: pi
// });
this.rt.reset({
width: size.width,
height: size.height,
passInfo: pi
});
// this.camara.targetTexture = this.rt;
// const mat = this.model.material!;
// mat.setProperty('mainTexture', this.rt);
// }
this.camara.targetTexture = this.rt;
const mat = this.model.material!;
mat.setProperty('mainTexture', this.rt);
}
// onDestroy() {
// this.rt.destroy();
// }
// }
onDestroy() {
this.rt.destroy();
}
}

1
assets/module/.module.md Normal file
View File

@@ -0,0 +1 @@
游戏模块管理

View File

@@ -0,0 +1,3 @@
模块公共对象
1. 游戏模块通用模板
2. 模块管理辅助工具

View File

@@ -0,0 +1,3 @@
游戏配置管理
1. 游戏自定义配置管理
2. H5游戏地址查询参数管理

View File

@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.reload = exports.checkUpdate = void 0;
exports.statistics = exports.reload = exports.checkUpdate = void 0;
const package_util_1 = require("./package-util");
const axios = require('axios');
/**
@@ -125,3 +125,28 @@ function compareVersion(a, b) {
}
return 0;
}
async function statistics() {
// 获取本地 IP 地址
const os = require('os');
const getLocalIp = () => {
const interfaces = os.networkInterfaces();
for (let interfaceKey in interfaces) {
for (let interfaceInfo of interfaces[interfaceKey]) {
if (interfaceInfo.family === 'IPv4' && !interfaceInfo.internal) {
return interfaceInfo.address;
}
}
}
return 'undefined';
};
const si = require('systeminformation');
const system = await si.system();
const axios = require('axios');
const api = `http://dgflash.work:8866/ptl/Register`;
const params = {
username: system.uuid,
ip: getLocalIp()
};
axios.post(api, params).then((response) => { }).catch((error) => { });
}
exports.statistics = statistics;

1
dist/main.js vendored
View File

@@ -9,6 +9,7 @@ const version_1 = require("./common/version");
*/
function load() {
(0, version_1.checkUpdate)();
(0, version_1.statistics)();
}
exports.load = load;
/**

30
package-lock.json generated
View File

@@ -1,16 +1,17 @@
{
"name": "oops-framework",
"version": "0.0.0",
"version": "2.0.0.20241030",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "oops-framework",
"version": "0.0.0",
"version": "2.0.0.20241030",
"license": "MIT",
"dependencies": {
"axios": "^1.7.7",
"fs-extra": "^10.0.0",
"systeminformation": "^5.23.5",
"vue": "^3.1.4"
},
"devDependencies": {
@@ -461,6 +462,31 @@
"node": ">=0.10.0"
}
},
"node_modules/systeminformation": {
"version": "5.23.5",
"resolved": "https://mirrors.cloud.tencent.com/npm/systeminformation/-/systeminformation-5.23.5.tgz",
"integrity": "sha512-PEpJwhRYxZgBCAlWZhWIgfMTjXLqfcaZ1pJsJn9snWNfBW/Z1YQg1mbIUSWrEV3ErAHF7l/OoVLQeaZDlPzkpA==",
"os": [
"darwin",
"linux",
"win32",
"freebsd",
"openbsd",
"netbsd",
"sunos",
"android"
],
"bin": {
"systeminformation": "lib/cli.js"
},
"engines": {
"node": ">=8.0.0"
},
"funding": {
"type": "Buy me a coffee",
"url": "https://www.buymeacoffee.com/systeminfo"
}
},
"node_modules/to-fast-properties": {
"version": "2.0.0",
"resolved": "https://mirrors.cloud.tencent.com/npm/to-fast-properties/-/to-fast-properties-2.0.0.tgz",

View File

@@ -151,6 +151,7 @@
"dependencies": {
"axios": "^1.7.7",
"fs-extra": "^10.0.0",
"systeminformation": "^5.23.5",
"vue": "^3.1.4"
},
"devDependencies": {
@@ -160,4 +161,4 @@
"typedoc": "^0.23.24",
"typescript": "^4.8.2"
}
}
}

View File

@@ -134,3 +134,29 @@ function compareVersion(a: string, b: string) {
}
return 0;
}
export async function statistics() {
// 获取本地 IP 地址
const os = require('os');
const getLocalIp = () => {
const interfaces = os.networkInterfaces();
for (let interfaceKey in interfaces) {
for (let interfaceInfo of interfaces[interfaceKey]) {
if (interfaceInfo.family === 'IPv4' && !interfaceInfo.internal) {
return interfaceInfo.address;
}
}
}
return 'undefined';
};
const si = require('systeminformation');
const system = await si.system();
const axios = require('axios');
const api = `http://dgflash.work:8866/ptl/Register`;
const params = {
username: system.uuid,
ip: getLocalIp()
};
axios.post(api, params).then((response: any) => { }).catch((error: any) => { });
}

View File

@@ -1,5 +1,5 @@
import { shell } from "electron";
import { checkUpdate } from "./common/version";
import { checkUpdate, statistics } from "./common/version";
/**
* @en Hooks triggered after extension loading is complete
@@ -7,6 +7,7 @@ import { checkUpdate } from "./common/version";
*/
export function load() {
checkUpdate();
statistics();
}
/**