diff --git a/assets/Scene/helloworld.fire b/assets/Scene/helloworld.fire index a9d9522..3577134 100644 --- a/assets/Scene/helloworld.fire +++ b/assets/Scene/helloworld.fire @@ -532,7 +532,7 @@ { "__type__": "cc.Node", "_name": "DataBoard", - "_objFlags": 512, + "_objFlags": 1536, "_parent": { "__id__": 8 }, @@ -598,7 +598,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "85BlQuDb9HZKuhEJxwyGF+" + "_id": "3bJREBcbZKLqDSz4LhRHLJ" }, { "__type__": "cc.Node", @@ -660,7 +660,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "49+qljSBFDb61/iC62OrLE" + "_id": "bcSyBGvI1Plqe/WzYr3VDx" }, { "__type__": "cc.Sprite", @@ -690,7 +690,7 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "6axJdFuntK570hv44oHwcH" + "_id": "e4rWXBZIdL3I37yOiMLUkp" }, { "__type__": "cc.Node", @@ -752,7 +752,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "66fiagvGZM17jxJS3e3R/O" + "_id": "d2mriWi19PIq4Szy+gixHz" }, { "__type__": "cc.Sprite", @@ -782,7 +782,7 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "e7StEP5C5EIY76/7RYAGaS" + "_id": "57C42kzTlNG6EIZG27BGvo" }, { "__type__": "cc.Node", @@ -844,7 +844,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "67uLDk0kNPMLrmc4a+2Lcz" + "_id": "86jFRLVFRCEZKk+7T7UNZp" }, { "__type__": "cc.Sprite", @@ -874,7 +874,7 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "19kjTk6vxDsqYAK8l1jO+n" + "_id": "3f+lBF49pJWLH2L7X5jaEt" }, { "__type__": "cc.Node", @@ -939,7 +939,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "930hpjvLBPHbYO0z9MngLs" + "_id": "4fBx2G8glEe4Xv4ozR+OYB" }, { "__type__": "cc.Label", @@ -972,7 +972,7 @@ "_N$fontFamily": "Arial", "_N$overflow": 0, "_N$cacheMode": 0, - "_id": "357EdNN/VPTaPJCzr51Jj0" + "_id": "b9AHQFFjJI0q9XNZUOYi0T" }, { "__type__": "cc.LabelOutline", @@ -990,7 +990,7 @@ "a": 255 }, "_width": 6, - "_id": "b4ov1ei1RJaZNO5PGzLCHc" + "_id": "6d1Kd0iBJCHptcQsvN7S7E" }, { "__type__": "9285eM4YhBJhL8+C569X294", @@ -1000,7 +1000,7 @@ "__id__": 8 }, "_enabled": true, - "_id": "1b9viFHsFJHrX+D1PV5q6g" + "_id": "98YtBkfwdHMbzYr7nANfcY" }, { "__type__": "1c152bUhQpJ6J1jGhQVUYf8", diff --git a/assets/Script/DataBoard.ts b/assets/Script/DataBoard.ts index 5260181..80e4d30 100644 --- a/assets/Script/DataBoard.ts +++ b/assets/Script/DataBoard.ts @@ -235,11 +235,13 @@ export default class DataBoard extends cc.Component { protected update() { if (!this.isCustomLabelActive) return; if (!this.customLabelStringSplit) return; - let radian = -this.node.angle * Math.PI / 180; - let cos = Math.cos(radian); - let sin = Math.sin(radian); - this.customLabelNode.x = this.customLabelOffset.x * cos - this.customLabelOffset.y * sin; - this.customLabelNode.y = this.customLabelOffset.x * sin + this.customLabelOffset.y * cos; + if(this.customLabelOffset.x !== 0 || this.customLabelOffset.y !== 0){ + let radian = -this.node.angle * Math.PI / 180; + let cos = Math.cos(radian); + let sin = Math.sin(radian); + this.customLabelNode.x = this.customLabelOffset.x * cos - this.customLabelOffset.y * sin; + this.customLabelNode.y = this.customLabelOffset.x * sin + this.customLabelOffset.y * cos; + } let str = ''; let strs = this.customLabelStringSplit; if (!this.monitorComp && this.customComponentName) { diff --git a/library/imports/1c/1c1526d4-850a-49e8-9d63-1a14155187fc.js b/library/imports/1c/1c1526d4-850a-49e8-9d63-1a14155187fc.js index fbc5e38..a26db34 100644 --- a/library/imports/1c/1c1526d4-850a-49e8-9d63-1a14155187fc.js +++ b/library/imports/1c/1c1526d4-850a-49e8-9d63-1a14155187fc.js @@ -287,11 +287,13 @@ var DataBoard = /** @class */ (function (_super) { return; if (!this.customLabelStringSplit) return; - var radian = -this.node.angle * Math.PI / 180; - var cos = Math.cos(radian); - var sin = Math.sin(radian); - this.customLabelNode.x = this.customLabelOffset.x * cos - this.customLabelOffset.y * sin; - this.customLabelNode.y = this.customLabelOffset.x * sin + this.customLabelOffset.y * cos; + if (this.customLabelOffset.x !== 0 || this.customLabelOffset.y !== 0) { + var radian = -this.node.angle * Math.PI / 180; + var cos = Math.cos(radian); + var sin = Math.sin(radian); + this.customLabelNode.x = this.customLabelOffset.x * cos - this.customLabelOffset.y * sin; + this.customLabelNode.y = this.customLabelOffset.x * sin + this.customLabelOffset.y * cos; + } var str = ''; var strs = this.customLabelStringSplit; if (!this.monitorComp && this.customComponentName) { diff --git a/library/imports/1c/1c1526d4-850a-49e8-9d63-1a14155187fc.js.map b/library/imports/1c/1c1526d4-850a-49e8-9d63-1a14155187fc.js.map index c014019..c157df3 100644 --- a/library/imports/1c/1c1526d4-850a-49e8-9d63-1a14155187fc.js.map +++ b/library/imports/1c/1c1526d4-850a-49e8-9d63-1a14155187fc.js.map @@ -1 +1 @@ -{"version":3,"sources":["assets\\Script\\DataBoard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;gFAwBgF;AAChF,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;AAC3B,IAAM,WAAW,GAAG,EAAE,CAAC,CAAe,OAAO;AAC7C,IAAM,UAAU,GAAG,GAAG,CAAC,CAAe,aAAa;AAC7C,IAAA,KAAiD,EAAE,CAAC,UAAU,EAA5D,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,iBAAiB,uBAAA,EAAE,IAAI,UAAkB,CAA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SAAS,GAiSlD;kBAjSoB,SAAS","file":"","sourceRoot":"/","sourcesContent":["/*******************************************************************************\r\n * 创建: 2022年11月23日\r\n * 作者: 水煮肉片饭(27185709@qq.com)\r\n * 描述: 数据看板\r\n * 节点挂上该组件,就可以在游戏运行过程中,直观看到节点任意属性(包括节点脚本中的属性)\r\n * 可以图形化展示以下四种数据:\r\n * 轮廓盒子: 随节点旋转,代表节点的实时矩形\r\n * 碰撞盒子: 不随节点旋转,一般代表碰撞范围\r\n * 自定义参数: 节点自身属性,以及节点任意脚本中的属性\r\n * 锚点: 锚点位置会显示一个小红点\r\n * 自定义参数(配置想监控的数据):\r\n * wp: 世界坐标\r\n * radian: 节点弧度(单位:π)\r\n * matrix: 变换矩阵\r\n * 自身属性: x,y,parent,children等\r\n * 脚本属性: 脚本实例对象的属性\r\n * ↓↓参数可以用3种分隔符隔开↓↓\r\n * 英文逗号、英文冒号、空格\r\n * ————————————————————————举个栗子————————————————————————\r\n * 脚本: Hero\r\n * 参数: wp,scale,angle,#angle,#hp\r\n * 显示结果:世界坐标,节点scale,节点angle,Hero对象的angle,Hero对象的hp\r\n * ————————————————————————温馨提示————————————————————————\r\n * 初始化的时候,设置全局变量window['DATABOARD'] = false可屏蔽本项目所有DataBoard,不会产生任何额外开销\\n\r\n*******************************************************************************/\r\nwindow['DATABOARD'] = true;\r\nconst ANCHOR_SIZE = 20; //锚点的大小\r\nconst LINEHEIGHT = 1.2; //行高是字体大小的多少倍\r\nconst { ccclass, property, executeInEditMode, menu } = cc._decorator;\r\n@ccclass\r\n@executeInEditMode\r\n@menu('Comp/DataBoard')\r\nexport default class DataBoard extends cc.Component {\r\n @property\r\n private _isOutlineBoxActive: boolean = false;\r\n @property({ displayName: CC_DEV && '轮廓盒子', tooltip: CC_DEV && '随节点旋转,代表实时轮廓' })\r\n private get isOutlineBoxActive() { return this._isOutlineBoxActive };\r\n private set isOutlineBoxActive(value: boolean) {\r\n this._isOutlineBoxActive = value;\r\n this.outlineBoxNode.active = value;\r\n }\r\n @property\r\n private _outlineBoxColor: cc.Color = new cc.Color(Math.random() * 255, Math.random() * 255, Math.random() * 255);\r\n @property({ displayName: CC_DEV && '······颜色', visible() { return this.isOutlineBoxActive } })\r\n private get outlineBoxColor() { return this._outlineBoxColor };\r\n private set outlineBoxColor(value: cc.Color) {\r\n this._outlineBoxColor = value;\r\n this.outlineBoxNode.color = value;\r\n }\r\n @property\r\n private _outlineBoxOpacity: number = 100;\r\n @property({ min: 0, max: 255, step: 1, slide: true, displayName: CC_DEV && '······透明度', visible() { return this.isOutlineBoxActive } })\r\n private get outlineBoxOpacity() { return this._outlineBoxOpacity };\r\n private set outlineBoxOpacity(value: number) {\r\n this._outlineBoxOpacity = value;\r\n this.outlineBoxNode.opacity = value;\r\n }\r\n @property\r\n private _isCollideBoxActive: boolean = true;\r\n @property({ displayName: CC_DEV && '碰撞盒子', tooltip: CC_DEV && '不随节点旋转,代表碰撞范围' })\r\n private get isCollideBoxActive() { return this._isCollideBoxActive };\r\n private set isCollideBoxActive(value: boolean) {\r\n this._isCollideBoxActive = value;\r\n this.collideBoxNode.active = value;\r\n }\r\n @property\r\n private _collideBoxColor: cc.Color = new cc.Color(Math.random() * 255, Math.random() * 255, Math.random() * 255);\r\n @property({ displayName: CC_DEV && '······颜色', visible() { return this.isCollideBoxActive } })\r\n private get collideBoxColor() { return this._collideBoxColor };\r\n private set collideBoxColor(value: cc.Color) {\r\n this._collideBoxColor = value;\r\n this.collideBoxNode.color = value;\r\n }\r\n @property\r\n private _collideBoxOpacity: number = 100;\r\n @property({ min: 0, max: 255, step: 1, slide: true, displayName: CC_DEV && '······透明度', visible() { return this.isCollideBoxActive } })\r\n private get collideBoxOpacity() { return this._collideBoxOpacity };\r\n private set collideBoxOpacity(value: number) {\r\n this._collideBoxOpacity = value;\r\n this.collideBoxNode.opacity = value;\r\n }\r\n @property\r\n private _isCustomLabelActive: boolean = true;\r\n @property({ displayName: CC_DEV && '自定义参数', tooltip: CC_DEV && '配置显示的属性内容' })\r\n private get isCustomLabelActive() { return this._isCustomLabelActive };\r\n private set isCustomLabelActive(value: boolean) {\r\n this._isCustomLabelActive = value;\r\n this.customLabelNode.active = value;\r\n }\r\n @property({ displayName: CC_DEV && '······脚本', tooltip: CC_DEV && '监控哪个脚本', visible() { return this.isCustomLabelActive; } })\r\n private customComponentName: string = '';\r\n @property\r\n private _customLabelString: string = 'x,y';\r\n @property({ multiline: true, displayName: CC_DEV && '······参数', tooltip: CC_DEV && \"—————支持的参数————\\nwp:世界坐标\\nradian:节点弧度(单位:π)\\nmatrix:变换矩阵\\n自身属性:x,y,parent,children等\\n脚本属性:脚本实例对象的属性\\n↓↓参数可以用3种分隔符隔开↓↓\\n英文逗号、英文冒号、空格\\n————举个栗子————\\n脚本:Hero\\n参数:wp,scale,angle,#angle,#hp\\n显示结果:\\n世界坐标,节点scale,节点angle,Hero对象的angle,Hero对象的hp\\n————温馨提示————\\n初始化的时候,设置全局变量\\nwindow['DATABOARD'] = false\\n可屏蔽本项目所有DataBoard,不会产生任何额外开销\", visible() { return this.isCustomLabelActive } })\r\n private get customLabelString() { return this._customLabelString };\r\n private set customLabelString(value: string) {\r\n this._customLabelString = value;\r\n this.customLabelStringSplit = value\r\n .replace(/,|,/g, '_~_').replace(/:|:/g, '_!_').replace(/ |\\t/g, '_@_')\r\n .replace(/_*\\n_*/g, '_\\n_').split('_');\r\n }\r\n @property\r\n private _customLabelOffset: cc.Vec2 = cc.v2(0, 100);\r\n @property({ displayName: CC_DEV && '······偏移', visible() { return this.isCustomLabelActive } })\r\n private get customLabelOffset() { return this._customLabelOffset };\r\n private set customLabelOffset(value: cc.Vec2) {\r\n this._customLabelOffset = value;\r\n this.customLabelNode.x = value.x;\r\n this.customLabelNode.y = value.y;\r\n }\r\n @property\r\n private _customLabelColor: cc.Color = new cc.Color(255, 255, 0);\r\n @property({ displayName: CC_DEV && '······颜色', visible() { return this.isCustomLabelActive } })\r\n private get customLabelColor() { return this._customLabelColor };\r\n private set customLabelColor(value: cc.Color) {\r\n this._customLabelColor = value;\r\n this.customLabelNode.color = value;\r\n }\r\n @property\r\n private _customLabelSize: number = 60;\r\n @property({ displayName: CC_DEV && '······大小', visible() { return this.isCustomLabelActive } })\r\n private get customLabelSize() { return this._customLabelSize };\r\n private set customLabelSize(value: number) {\r\n this._customLabelSize = value;\r\n this.customLabel.fontSize = value;\r\n this.customLabel.lineHeight = value * LINEHEIGHT;\r\n this.customLabelNode.getComponent(cc.LabelOutline).width = value * 0.1;\r\n }\r\n @property\r\n private _customLabelDigit: number = 0;\r\n @property({ min: 0, max: 10, step: 1, slide: true, displayName: CC_DEV && '······小数位数', visible() { return this.isCustomLabelActive } })\r\n private get customLabelDigit() { return this._customLabelDigit };\r\n private set customLabelDigit(value: number) {\r\n this._customLabelDigit = value;\r\n }\r\n private boardNode: cc.Node = null;\r\n private outlineBoxNode: cc.Node = null;\r\n private collideBoxNode: cc.Node = null;\r\n private anchorPointNode: cc.Node = null;\r\n private customLabelNode: cc.Node = null;\r\n private customLabel: cc.Label = null;\r\n private customLabelStringSplit: string[] = null;\r\n private monitorComp: cc.Component = null;\r\n\r\n protected start() {\r\n this.boardNode = this.node.getChildByName('DataBoard');\r\n if (!CC_EDITOR && !window['DATABOARD']) {\r\n this.destroy();\r\n return;\r\n }\r\n if (cc.isValid(this.boardNode)) {\r\n this.boardNode.removeFromParent();\r\n this.boardNode.destroy();\r\n }\r\n let texture = new cc.Texture2D();\r\n texture.initWithData(new Uint8Array([255, 255, 255]), cc.Texture2D.PixelFormat.RGB888, 1, 1);\r\n\r\n this.boardNode = new cc.Node('DataBoard');\r\n this.boardNode.setParent(this.node);\r\n this.boardNode.x = this.boardNode.y = 0;\r\n this.boardNode.zIndex = cc.macro.MAX_ZINDEX;\r\n this.boardNode['_objFlags'] |= cc.Object['Flags'].HideInHierarchy;\r\n this.boardNode['_objFlags'] |= cc.Object['Flags'].LockedInEditor;\r\n\r\n this.outlineBoxNode = new cc.Node('OutlineBox');\r\n this.outlineBoxNode.setParent(this.boardNode);\r\n this.outlineBoxNode.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);\r\n this.outlineBoxNode.active = this.isOutlineBoxActive;\r\n this.outlineBoxNode.color = this.outlineBoxColor;\r\n this.outlineBoxNode.opacity = this.outlineBoxOpacity;\r\n\r\n this.collideBoxNode = new cc.Node('CollideBox');\r\n this.collideBoxNode.setParent(this.boardNode);\r\n this.collideBoxNode.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);\r\n this.collideBoxNode.active = this.isCollideBoxActive;\r\n this.collideBoxNode.color = this.collideBoxColor;\r\n this.collideBoxNode.opacity = this.collideBoxOpacity;\r\n\r\n this.anchorPointNode = new cc.Node('AnchorPoint');\r\n this.anchorPointNode.setParent(this.boardNode);\r\n this.anchorPointNode.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);\r\n this.anchorPointNode.color = cc.color(255, 0, 0);\r\n this.anchorPointNode.width = ANCHOR_SIZE;\r\n this.anchorPointNode.height = ANCHOR_SIZE;\r\n\r\n this.customLabelNode = new cc.Node('CustomLabel');\r\n this.customLabelNode.setParent(this.boardNode);\r\n this.customLabel = this.customLabelNode.addComponent(cc.Label);\r\n this.customLabelNode.addComponent(cc.LabelOutline).color = cc.color(0, 0, 0);\r\n this.customLabelNode.active = this.isCustomLabelActive;\r\n this.customLabelString = this._customLabelString;\r\n this.customLabelNode.x = this.customLabelOffset.x;\r\n this.customLabelNode.y = this.customLabelOffset.y;\r\n this.customLabelNode.color = this.customLabelColor;\r\n this.customLabelSize = this._customLabelSize;\r\n\r\n this.updateAngle();\r\n this.updateScale();\r\n this.updateAnchor();\r\n this.updateSize();\r\n this.node.on(cc.Node.EventType.ROTATION_CHANGED, this.updateAngle, this);\r\n this.node.on(cc.Node.EventType.SCALE_CHANGED, this.updateScale, this);\r\n this.node.on(cc.Node.EventType.ANCHOR_CHANGED, this.updateAnchor, this);\r\n this.node.on(cc.Node.EventType.SIZE_CHANGED, this.updateSize, this);\r\n }\r\n\r\n private updateAngle() {\r\n this.collideBoxNode.angle = -this.node.angle;\r\n this.customLabelNode.angle = -this.node.angle;\r\n }\r\n\r\n private updateScale() {\r\n this.boardNode.scaleX = 1 / this.node.scaleX;\r\n this.boardNode.scaleY = 1 / this.node.scaleY;\r\n this.outlineBoxNode.scaleX = this.node.scaleX;\r\n this.outlineBoxNode.scaleY = this.node.scaleY;\r\n this.collideBoxNode.scaleX = this.node.scaleX;\r\n this.collideBoxNode.scaleY = this.node.scaleY;\r\n }\r\n\r\n private updateAnchor() {\r\n this.outlineBoxNode.anchorX = this.node.anchorX;\r\n this.outlineBoxNode.anchorY = this.node.anchorY;\r\n this.collideBoxNode.anchorX = this.node.anchorX;\r\n this.collideBoxNode.anchorY = this.node.anchorY;\r\n }\r\n\r\n private updateSize() {\r\n this.outlineBoxNode.width = this.node.width;\r\n this.outlineBoxNode.height = this.node.height;\r\n this.collideBoxNode.width = this.node.width;\r\n this.collideBoxNode.height = this.node.height;\r\n }\r\n\r\n protected update() {\r\n if (!this.isCustomLabelActive) return;\r\n if (!this.customLabelStringSplit) return;\r\n let radian = -this.node.angle * Math.PI / 180;\r\n let cos = Math.cos(radian);\r\n let sin = Math.sin(radian);\r\n this.customLabelNode.x = this.customLabelOffset.x * cos - this.customLabelOffset.y * sin;\r\n this.customLabelNode.y = this.customLabelOffset.x * sin + this.customLabelOffset.y * cos;\r\n let str = '';\r\n let strs = this.customLabelStringSplit;\r\n if (!this.monitorComp && this.customComponentName) {\r\n this.monitorComp = this.node.getComponent(this.customComponentName);\r\n }\r\n for (let i = 0, len = strs.length; i < len; ++i) {\r\n let tmp = null;\r\n switch (strs[i]) {\r\n case 'wp':\r\n let matrix = this.node['_worldMatrix'].m;\r\n tmp = `${matrix[12].toFixed(this.customLabelDigit)},\\t${matrix[13].toFixed(this.customLabelDigit)}`;\r\n break;\r\n case 'angle':\r\n tmp = this.node.angle.toFixed(this.customLabelDigit) + '°';\r\n break;\r\n case 'radian':\r\n tmp = (this.node.angle / 180).toFixed(this.customLabelDigit) + 'π';\r\n break;\r\n case 'matrix':\r\n matrix = this.node['_worldMatrix'].m;\r\n tmp = '';\r\n for (let i = 0; i < 4; ++i) {\r\n for (let j = 0; j < 4; ++j) {\r\n let m = matrix[j * 4 + i];\r\n tmp += (m < 0 ? '\\t\\t' : '\\t\\t\\t') + m.toFixed(this.customLabelDigit);\r\n }\r\n i !== 3 && (tmp += '\\n');\r\n }\r\n break;\r\n case 'children':\r\n tmp = '';\r\n for (let i = 0, len = this.node.childrenCount; i < len; ++i) {\r\n tmp += `\\t\\t\\t${i}:${this.node.children[i].name}`;\r\n i !== len - 1 && (tmp += '\\n');\r\n }\r\n break;\r\n case '~': tmp = ',\\t'; break;\r\n case '!': tmp = ':\\t'; break;\r\n case '@': tmp = '\\t\\t'; break;\r\n default:\r\n if (this.node[strs[i]] !== undefined) {\r\n tmp = this.node[strs[i]];\r\n } else if (strs[i].startsWith('#') && this.monitorComp !== null) {\r\n tmp = this.parseString(strs[i].substring(1));\r\n } else {\r\n tmp = strs[i];\r\n }\r\n if (typeof tmp === 'number') {\r\n tmp = tmp.toFixed(this.customLabelDigit);\r\n } else if (tmp.name) {\r\n tmp = tmp.name;\r\n }\r\n break;\r\n }\r\n str += tmp;\r\n }\r\n this.customLabel.string = str;\r\n }\r\n\r\n private parseString(str: string) {\r\n let strs = str.split('.');\r\n let ret = this.monitorComp[strs[0]];\r\n ret === undefined && (ret = `#${strs[0]}`);\r\n for (let i = 1, len = strs.length; i < len; ++i) {\r\n if (ret[strs[i]] === undefined) {\r\n return `${ret.name ? ret.name : ret}.${strs[i]}`;\r\n }\r\n ret = ret[strs[i]];\r\n }\r\n return ret;\r\n }\r\n\r\n protected onDestroy() {\r\n if (cc.isValid(this.boardNode)) {\r\n this.boardNode.removeFromParent();\r\n this.boardNode.destroy();\r\n }\r\n this.node.targetOff(this);\r\n }\r\n}"]} \ No newline at end of file +{"version":3,"sources":["assets\\Script\\DataBoard.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AK,OAAO,IAAI,CAAC,mBAAmB,CAAA,CAAC,CAAC,EAAE,CAAC;oDACjC;IAQ9D;QADC,QAAQ;wDAC6B;IAEtC;QADC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,IAAI,YAAY,EAAE,OAAO,gBAAK,OAAO,IAAI,CAAC,mBAAmB,CAAA,CAAC,CAAC,EAAE,CAAC;qDACxE;IAnG/C,SAAS;QAH7B,OAAO;QACP,iBAAiB;QACjB,IAAI,CAAC,gBAAgB,CAAC;OACF,SAAS,CAmS7B;IAAD,gBAAC;CAnSD,AAmSC,CAnSsC,EAAE,CAAC,SAAS,GAmSlD;kBAnSoB,SAAS","file":"","sourceRoot":"/","sourcesContent":["/*******************************************************************************\r\n * 创建: 2022年11月23日\r\n * 作者: 水煮肉片饭(27185709@qq.com)\r\n * 描述: 数据看板\r\n * 节点挂上该组件,就可以在游戏运行过程中,直观看到节点任意属性(包括节点脚本中的属性)\r\n * 可以图形化展示以下四种数据:\r\n * 轮廓盒子: 随节点旋转,代表节点的实时矩形\r\n * 碰撞盒子: 不随节点旋转,一般代表碰撞范围\r\n * 自定义参数: 节点自身属性,以及节点任意脚本中的属性\r\n * 锚点: 锚点位置会显示一个小红点\r\n * 自定义参数(配置想监控的数据):\r\n * wp: 世界坐标\r\n * radian: 节点弧度(单位:π)\r\n * matrix: 变换矩阵\r\n * 自身属性: x,y,parent,children等\r\n * 脚本属性: 脚本实例对象的属性\r\n * ↓↓参数可以用3种分隔符隔开↓↓\r\n * 英文逗号、英文冒号、空格\r\n * ————————————————————————举个栗子————————————————————————\r\n * 脚本: Hero\r\n * 参数: wp,scale,angle,#angle,#hp\r\n * 显示结果:世界坐标,节点scale,节点angle,Hero对象的angle,Hero对象的hp\r\n * ————————————————————————温馨提示————————————————————————\r\n * 初始化的时候,设置全局变量window['DATABOARD'] = false可屏蔽本项目所有DataBoard,不会产生任何额外开销\\n\r\n*******************************************************************************/\r\nwindow['DATABOARD'] = true;\r\nconst ANCHOR_SIZE = 20; //锚点的大小\r\nconst LINEHEIGHT = 1.2; //行高是字体大小的多少倍\r\nconst { ccclass, property, executeInEditMode, menu } = cc._decorator;\r\n@ccclass\r\n@executeInEditMode\r\n@menu('Comp/DataBoard')\r\nexport default class DataBoard extends cc.Component {\r\n @property\r\n private _isOutlineBoxActive: boolean = false;\r\n @property({ displayName: CC_DEV && '轮廓盒子', tooltip: CC_DEV && '随节点旋转,代表实时轮廓' })\r\n private get isOutlineBoxActive() { return this._isOutlineBoxActive };\r\n private set isOutlineBoxActive(value: boolean) {\r\n this._isOutlineBoxActive = value;\r\n this.outlineBoxNode.active = value;\r\n }\r\n @property\r\n private _outlineBoxColor: cc.Color = new cc.Color(Math.random() * 255, Math.random() * 255, Math.random() * 255);\r\n @property({ displayName: CC_DEV && '······颜色', visible() { return this.isOutlineBoxActive } })\r\n private get outlineBoxColor() { return this._outlineBoxColor };\r\n private set outlineBoxColor(value: cc.Color) {\r\n this._outlineBoxColor = value;\r\n this.outlineBoxNode.color = value;\r\n }\r\n @property\r\n private _outlineBoxOpacity: number = 100;\r\n @property({ min: 0, max: 255, step: 1, slide: true, displayName: CC_DEV && '······透明度', visible() { return this.isOutlineBoxActive } })\r\n private get outlineBoxOpacity() { return this._outlineBoxOpacity };\r\n private set outlineBoxOpacity(value: number) {\r\n this._outlineBoxOpacity = value;\r\n this.outlineBoxNode.opacity = value;\r\n }\r\n @property\r\n private _isCollideBoxActive: boolean = true;\r\n @property({ displayName: CC_DEV && '碰撞盒子', tooltip: CC_DEV && '不随节点旋转,代表碰撞范围' })\r\n private get isCollideBoxActive() { return this._isCollideBoxActive };\r\n private set isCollideBoxActive(value: boolean) {\r\n this._isCollideBoxActive = value;\r\n this.collideBoxNode.active = value;\r\n }\r\n @property\r\n private _collideBoxColor: cc.Color = new cc.Color(Math.random() * 255, Math.random() * 255, Math.random() * 255);\r\n @property({ displayName: CC_DEV && '······颜色', visible() { return this.isCollideBoxActive } })\r\n private get collideBoxColor() { return this._collideBoxColor };\r\n private set collideBoxColor(value: cc.Color) {\r\n this._collideBoxColor = value;\r\n this.collideBoxNode.color = value;\r\n }\r\n @property\r\n private _collideBoxOpacity: number = 100;\r\n @property({ min: 0, max: 255, step: 1, slide: true, displayName: CC_DEV && '······透明度', visible() { return this.isCollideBoxActive } })\r\n private get collideBoxOpacity() { return this._collideBoxOpacity };\r\n private set collideBoxOpacity(value: number) {\r\n this._collideBoxOpacity = value;\r\n this.collideBoxNode.opacity = value;\r\n }\r\n @property\r\n private _isCustomLabelActive: boolean = true;\r\n @property({ displayName: CC_DEV && '自定义参数', tooltip: CC_DEV && '配置显示的属性内容' })\r\n private get isCustomLabelActive() { return this._isCustomLabelActive };\r\n private set isCustomLabelActive(value: boolean) {\r\n this._isCustomLabelActive = value;\r\n this.customLabelNode.active = value;\r\n }\r\n @property({ displayName: CC_DEV && '······脚本', tooltip: CC_DEV && '监控哪个脚本', visible() { return this.isCustomLabelActive; } })\r\n private customComponentName: string = '';\r\n @property\r\n private _customLabelString: string = 'x,y';\r\n @property({ multiline: true, displayName: CC_DEV && '······参数', tooltip: CC_DEV && \"—————支持的参数————\\nwp:世界坐标\\nradian:节点弧度(单位:π)\\nmatrix:变换矩阵\\n自身属性:x,y,parent,children等\\n脚本属性:脚本实例对象的属性\\n↓↓参数可以用3种分隔符隔开↓↓\\n英文逗号、英文冒号、空格\\n————举个栗子————\\n脚本:Hero\\n参数:wp,scale,angle,#angle,#hp\\n显示结果:\\n世界坐标,节点scale,节点angle,Hero对象的angle,Hero对象的hp\\n————温馨提示————\\n初始化的时候,设置全局变量\\nwindow['DATABOARD'] = false\\n可屏蔽本项目所有DataBoard,不会产生任何额外开销\", visible() { return this.isCustomLabelActive } })\r\n private get customLabelString() { return this._customLabelString };\r\n private set customLabelString(value: string) {\r\n this._customLabelString = value;\r\n this.customLabelStringSplit = value\r\n .replace(/,|,/g, '_~_').replace(/:|:/g, '_!_').replace(/ |\\t/g, '_@_')\r\n .replace(/_*\\n_*/g, '_\\n_').split('_');\r\n }\r\n @property\r\n private _customLabelOffset: cc.Vec2 = cc.v2(0, 100);\r\n @property({ displayName: CC_DEV && '······偏移', visible() { return this.isCustomLabelActive } })\r\n private get customLabelOffset() { return this._customLabelOffset };\r\n private set customLabelOffset(value: cc.Vec2) {\r\n this._customLabelOffset = value;\r\n this.customLabelNode.x = value.x;\r\n this.customLabelNode.y = value.y;\r\n }\r\n @property\r\n private _customLabelColor: cc.Color = new cc.Color(255, 255, 0);\r\n @property({ displayName: CC_DEV && '······颜色', visible() { return this.isCustomLabelActive } })\r\n private get customLabelColor() { return this._customLabelColor };\r\n private set customLabelColor(value: cc.Color) {\r\n this._customLabelColor = value;\r\n this.customLabelNode.color = value;\r\n }\r\n @property\r\n private _customLabelSize: number = 60;\r\n @property({ displayName: CC_DEV && '······大小', visible() { return this.isCustomLabelActive } })\r\n private get customLabelSize() { return this._customLabelSize };\r\n private set customLabelSize(value: number) {\r\n this._customLabelSize = value;\r\n this.customLabel.fontSize = value;\r\n this.customLabel.lineHeight = value * LINEHEIGHT;\r\n this.customLabelNode.getComponent(cc.LabelOutline).width = value * 0.1;\r\n }\r\n @property\r\n private _customLabelDigit: number = 0;\r\n @property({ min: 0, max: 10, step: 1, slide: true, displayName: CC_DEV && '······小数位数', visible() { return this.isCustomLabelActive } })\r\n private get customLabelDigit() { return this._customLabelDigit };\r\n private set customLabelDigit(value: number) {\r\n this._customLabelDigit = value;\r\n }\r\n private boardNode: cc.Node = null;\r\n private outlineBoxNode: cc.Node = null;\r\n private collideBoxNode: cc.Node = null;\r\n private anchorPointNode: cc.Node = null;\r\n private customLabelNode: cc.Node = null;\r\n private customLabel: cc.Label = null;\r\n private customLabelStringSplit: string[] = null;\r\n private monitorComp: cc.Component = null;\r\n\r\n protected start() {\r\n this.boardNode = this.node.getChildByName('DataBoard');\r\n if (!CC_EDITOR && !window['DATABOARD']) {\r\n this.destroy();\r\n return;\r\n }\r\n if (cc.isValid(this.boardNode)) {\r\n this.boardNode.removeFromParent();\r\n this.boardNode.destroy();\r\n }\r\n let texture = new cc.Texture2D();\r\n texture.initWithData(new Uint8Array([255, 255, 255]), cc.Texture2D.PixelFormat.RGB888, 1, 1);\r\n\r\n this.boardNode = new cc.Node('DataBoard');\r\n this.boardNode.setParent(this.node);\r\n this.boardNode.x = this.boardNode.y = 0;\r\n this.boardNode.zIndex = cc.macro.MAX_ZINDEX;\r\n this.boardNode['_objFlags'] |= cc.Object['Flags'].HideInHierarchy;\r\n this.boardNode['_objFlags'] |= cc.Object['Flags'].LockedInEditor;\r\n\r\n this.outlineBoxNode = new cc.Node('OutlineBox');\r\n this.outlineBoxNode.setParent(this.boardNode);\r\n this.outlineBoxNode.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);\r\n this.outlineBoxNode.active = this.isOutlineBoxActive;\r\n this.outlineBoxNode.color = this.outlineBoxColor;\r\n this.outlineBoxNode.opacity = this.outlineBoxOpacity;\r\n\r\n this.collideBoxNode = new cc.Node('CollideBox');\r\n this.collideBoxNode.setParent(this.boardNode);\r\n this.collideBoxNode.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);\r\n this.collideBoxNode.active = this.isCollideBoxActive;\r\n this.collideBoxNode.color = this.collideBoxColor;\r\n this.collideBoxNode.opacity = this.collideBoxOpacity;\r\n\r\n this.anchorPointNode = new cc.Node('AnchorPoint');\r\n this.anchorPointNode.setParent(this.boardNode);\r\n this.anchorPointNode.addComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);\r\n this.anchorPointNode.color = cc.color(255, 0, 0);\r\n this.anchorPointNode.width = ANCHOR_SIZE;\r\n this.anchorPointNode.height = ANCHOR_SIZE;\r\n\r\n this.customLabelNode = new cc.Node('CustomLabel');\r\n this.customLabelNode.setParent(this.boardNode);\r\n this.customLabel = this.customLabelNode.addComponent(cc.Label);\r\n this.customLabelNode.addComponent(cc.LabelOutline).color = cc.color(0, 0, 0);\r\n this.customLabelNode.active = this.isCustomLabelActive;\r\n this.customLabelString = this._customLabelString;\r\n this.customLabelNode.x = this.customLabelOffset.x;\r\n this.customLabelNode.y = this.customLabelOffset.y;\r\n this.customLabelNode.color = this.customLabelColor;\r\n this.customLabelSize = this._customLabelSize;\r\n\r\n this.updateAngle();\r\n this.updateScale();\r\n this.updateAnchor();\r\n this.updateSize();\r\n this.node.on(cc.Node.EventType.ROTATION_CHANGED, this.updateAngle, this);\r\n this.node.on(cc.Node.EventType.SCALE_CHANGED, this.updateScale, this);\r\n this.node.on(cc.Node.EventType.ANCHOR_CHANGED, this.updateAnchor, this);\r\n this.node.on(cc.Node.EventType.SIZE_CHANGED, this.updateSize, this);\r\n }\r\n\r\n private updateAngle() {\r\n this.collideBoxNode.angle = -this.node.angle;\r\n this.customLabelNode.angle = -this.node.angle;\r\n }\r\n\r\n private updateScale() {\r\n this.boardNode.scaleX = 1 / this.node.scaleX;\r\n this.boardNode.scaleY = 1 / this.node.scaleY;\r\n this.outlineBoxNode.scaleX = this.node.scaleX;\r\n this.outlineBoxNode.scaleY = this.node.scaleY;\r\n this.collideBoxNode.scaleX = this.node.scaleX;\r\n this.collideBoxNode.scaleY = this.node.scaleY;\r\n }\r\n\r\n private updateAnchor() {\r\n this.outlineBoxNode.anchorX = this.node.anchorX;\r\n this.outlineBoxNode.anchorY = this.node.anchorY;\r\n this.collideBoxNode.anchorX = this.node.anchorX;\r\n this.collideBoxNode.anchorY = this.node.anchorY;\r\n }\r\n\r\n private updateSize() {\r\n this.outlineBoxNode.width = this.node.width;\r\n this.outlineBoxNode.height = this.node.height;\r\n this.collideBoxNode.width = this.node.width;\r\n this.collideBoxNode.height = this.node.height;\r\n }\r\n\r\n protected update() {\r\n if (!this.isCustomLabelActive) return;\r\n if (!this.customLabelStringSplit) return;\r\n if(this.customLabelOffset.x !== 0 || this.customLabelOffset.y !== 0){\r\n let radian = -this.node.angle * Math.PI / 180;\r\n let cos = Math.cos(radian);\r\n let sin = Math.sin(radian);\r\n this.customLabelNode.x = this.customLabelOffset.x * cos - this.customLabelOffset.y * sin;\r\n this.customLabelNode.y = this.customLabelOffset.x * sin + this.customLabelOffset.y * cos;\r\n }\r\n let str = '';\r\n let strs = this.customLabelStringSplit;\r\n if (!this.monitorComp && this.customComponentName) {\r\n this.monitorComp = this.node.getComponent(this.customComponentName);\r\n }\r\n for (let i = 0, len = strs.length; i < len; ++i) {\r\n let tmp = null;\r\n switch (strs[i]) {\r\n case 'wp':\r\n let matrix = this.node['_worldMatrix'].m;\r\n tmp = `${matrix[12].toFixed(this.customLabelDigit)},\\t${matrix[13].toFixed(this.customLabelDigit)}`;\r\n break;\r\n case 'angle':\r\n tmp = this.node.angle.toFixed(this.customLabelDigit) + '°';\r\n break;\r\n case 'radian':\r\n tmp = (this.node.angle / 180).toFixed(this.customLabelDigit) + 'π';\r\n break;\r\n case 'matrix':\r\n matrix = this.node['_worldMatrix'].m;\r\n tmp = '';\r\n for (let i = 0; i < 4; ++i) {\r\n for (let j = 0; j < 4; ++j) {\r\n let m = matrix[j * 4 + i];\r\n tmp += (m < 0 ? '\\t\\t' : '\\t\\t\\t') + m.toFixed(this.customLabelDigit);\r\n }\r\n i !== 3 && (tmp += '\\n');\r\n }\r\n break;\r\n case 'children':\r\n tmp = '';\r\n for (let i = 0, len = this.node.childrenCount; i < len; ++i) {\r\n tmp += `\\t\\t\\t${i}:${this.node.children[i].name}`;\r\n i !== len - 1 && (tmp += '\\n');\r\n }\r\n break;\r\n case '~': tmp = ',\\t'; break;\r\n case '!': tmp = ':\\t'; break;\r\n case '@': tmp = '\\t\\t'; break;\r\n default:\r\n if (this.node[strs[i]] !== undefined) {\r\n tmp = this.node[strs[i]];\r\n } else if (strs[i].startsWith('#') && this.monitorComp !== null) {\r\n tmp = this.parseString(strs[i].substring(1));\r\n } else {\r\n tmp = strs[i];\r\n }\r\n if (typeof tmp === 'number') {\r\n tmp = tmp.toFixed(this.customLabelDigit);\r\n } else if (tmp.name) {\r\n tmp = tmp.name;\r\n }\r\n break;\r\n }\r\n str += tmp;\r\n }\r\n this.customLabel.string = str;\r\n }\r\n\r\n private parseString(str: string) {\r\n let strs = str.split('.');\r\n let ret = this.monitorComp[strs[0]];\r\n ret === undefined && (ret = `#${strs[0]}`);\r\n for (let i = 1, len = strs.length; i < len; ++i) {\r\n if (ret[strs[i]] === undefined) {\r\n return `${ret.name ? ret.name : ret}.${strs[i]}`;\r\n }\r\n ret = ret[strs[i]];\r\n }\r\n return ret;\r\n }\r\n\r\n protected onDestroy() {\r\n if (cc.isValid(this.boardNode)) {\r\n this.boardNode.removeFromParent();\r\n this.boardNode.destroy();\r\n }\r\n this.node.targetOff(this);\r\n }\r\n}"]} \ No newline at end of file diff --git a/library/imports/2d/2d2f792f-a40c-49bb-a189-ed176a246e49.json b/library/imports/2d/2d2f792f-a40c-49bb-a189-ed176a246e49.json index df3cea3..9572e9d 100644 --- a/library/imports/2d/2d2f792f-a40c-49bb-a189-ed176a246e49.json +++ b/library/imports/2d/2d2f792f-a40c-49bb-a189-ed176a246e49.json @@ -533,7 +533,7 @@ { "__type__": "cc.Node", "_name": "DataBoard", - "_objFlags": 512, + "_objFlags": 1536, "_parent": { "__id__": 8 }, @@ -599,7 +599,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "85BlQuDb9HZKuhEJxwyGF+" + "_id": "3bJREBcbZKLqDSz4LhRHLJ" }, { "__type__": "cc.Node", @@ -661,7 +661,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "49+qljSBFDb61/iC62OrLE" + "_id": "bcSyBGvI1Plqe/WzYr3VDx" }, { "__type__": "cc.Sprite", @@ -691,7 +691,7 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "6axJdFuntK570hv44oHwcH" + "_id": "e4rWXBZIdL3I37yOiMLUkp" }, { "__type__": "cc.Node", @@ -753,7 +753,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "66fiagvGZM17jxJS3e3R/O" + "_id": "d2mriWi19PIq4Szy+gixHz" }, { "__type__": "cc.Sprite", @@ -783,7 +783,7 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "e7StEP5C5EIY76/7RYAGaS" + "_id": "57C42kzTlNG6EIZG27BGvo" }, { "__type__": "cc.Node", @@ -845,7 +845,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "67uLDk0kNPMLrmc4a+2Lcz" + "_id": "86jFRLVFRCEZKk+7T7UNZp" }, { "__type__": "cc.Sprite", @@ -875,7 +875,7 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "19kjTk6vxDsqYAK8l1jO+n" + "_id": "3f+lBF49pJWLH2L7X5jaEt" }, { "__type__": "cc.Node", @@ -940,7 +940,7 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "930hpjvLBPHbYO0z9MngLs" + "_id": "4fBx2G8glEe4Xv4ozR+OYB" }, { "__type__": "cc.Label", @@ -973,7 +973,7 @@ "_N$fontFamily": "Arial", "_N$overflow": 0, "_N$cacheMode": 0, - "_id": "357EdNN/VPTaPJCzr51Jj0" + "_id": "b9AHQFFjJI0q9XNZUOYi0T" }, { "__type__": "cc.LabelOutline", @@ -991,7 +991,7 @@ "a": 255 }, "_width": 6, - "_id": "b4ov1ei1RJaZNO5PGzLCHc" + "_id": "6d1Kd0iBJCHptcQsvN7S7E" }, { "__type__": "9285eM4YhBJhL8+C569X294", @@ -1001,7 +1001,7 @@ "__id__": 8 }, "_enabled": true, - "_id": "1b9viFHsFJHrX+D1PV5q6g" + "_id": "98YtBkfwdHMbzYr7nANfcY" }, { "__type__": "1c152bUhQpJ6J1jGhQVUYf8", diff --git a/library/uuid-to-mtime.json b/library/uuid-to-mtime.json index e04cf6b..2f9c6d0 100644 --- a/library/uuid-to-mtime.json +++ b/library/uuid-to-mtime.json @@ -515,8 +515,8 @@ "relativePath": "Texture" }, "2d2f792f-a40c-49bb-a189-ed176a246e49": { - "asset": 1685197458380, - "meta": 1685197458389, + "asset": 1685198509889, + "meta": 1685198509897, "relativePath": "Scene\\helloworld.fire" }, "a8027877-d8d6-4645-97a0-52d4a0123dba": { @@ -534,14 +534,14 @@ "meta": 1685194622776, "relativePath": "Texture\\zhizhuxia.png" }, - "9285e338-6210-4984-bf3e-0b9ebd5f6f78": { - "asset": 1685197428895, - "meta": 1685197433673, - "relativePath": "Script\\Hero.ts" - }, "1c1526d4-850a-49e8-9d63-1a14155187fc": { - "asset": 1685197605521, - "meta": 1685197607883, + "asset": 1685198389728, + "meta": 1685198397873, "relativePath": "Script\\DataBoard.ts" + }, + "9285e338-6210-4984-bf3e-0b9ebd5f6f78": { + "asset": 1685198371101, + "meta": 1685198397889, + "relativePath": "Script\\Hero.ts" } } \ No newline at end of file