MCPcopy Create free account
hub / github.com/esengine/esengine / setup_afterAdd

Method setup_afterAdd

packages/fairygui/src/core/GObject.ts:1050–1078  ·  view source on GitHub ↗

* Setup after adding to parent * 添加到父容器之后的设置

(buffer: ByteBuffer, beginPos: number)

Source from the content-addressed store, hash-verified

1048 * 添加到父容器之后的设置
1049 */
1050 public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {
1051 buffer.seek(beginPos, 1);
1052
1053 const str = buffer.readS();
1054 if (str) {
1055 this.tooltips = str;
1056 }
1057
1058 const groupId = buffer.getInt16();
1059 if (groupId >= 0 && this._parent) {
1060 this.group = this._parent.getChildAt(groupId) as GGroup;
1061 }
1062
1063 buffer.seek(beginPos, 2);
1064
1065 const cnt = buffer.getInt16();
1066 for (let i = 0; i < cnt; i++) {
1067 let nextPos = buffer.getInt16();
1068 nextPos += buffer.pos;
1069
1070 const gearIndex = buffer.readByte();
1071 const gear = this.getGear(gearIndex);
1072 if (gear) {
1073 gear.setup(buffer);
1074 }
1075
1076 buffer.pos = nextPos;
1077 }
1078 }
1079
1080 // Render data collection | 渲染数据收集
1081

Callers 1

Calls 7

getGearMethod · 0.95
readSMethod · 0.80
getInt16Method · 0.80
getChildAtMethod · 0.80
readByteMethod · 0.80
seekMethod · 0.65
setupMethod · 0.45

Tested by

no test coverage detected