@cc-component/cc-ex-component 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -147,7 +147,10 @@ export class ReferenceComponent extends Component {
|
|
|
147
147
|
let refData = new CollectorNodeData();
|
|
148
148
|
let name = node.name.replace(this._tag, "").trim();
|
|
149
149
|
refData.key = name;
|
|
150
|
+
|
|
150
151
|
refData.com = (node.getComponent(`cc.${nodeType}`) ?? (node.getComponent(`${nodeType}`) ?? node)) as any;
|
|
152
|
+
// console.log('2--', refData.com.name)
|
|
153
|
+
|
|
151
154
|
this.nodes.push(refData);
|
|
152
155
|
}
|
|
153
156
|
}
|
|
@@ -162,7 +165,12 @@ export class ReferenceComponent extends Component {
|
|
|
162
165
|
while (checkArr.length > 0) {
|
|
163
166
|
let v = checkArr.shift();
|
|
164
167
|
let rc = v.getComponent(ReferenceComponent);
|
|
165
|
-
|
|
168
|
+
|
|
169
|
+
if (rc && rc != this) {
|
|
170
|
+
// arr.push(v);
|
|
171
|
+
// console.log("[MLogger]", v.name, "被引用");
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
166
174
|
arr.push(...v.children.filter(v => {
|
|
167
175
|
const ok = this.isNodeValid(v)
|
|
168
176
|
return ok
|
|
@@ -391,10 +399,14 @@ export class ${className}Window extends ViewModel(${this.baseWindowName}) {${sx.
|
|
|
391
399
|
private getPropertyType(node: Node) {
|
|
392
400
|
if (!EDITOR_NOT_IN_PREVIEW) return;
|
|
393
401
|
if (!node) { return "Node" }
|
|
394
|
-
|
|
395
402
|
//自定义脚本
|
|
396
|
-
let comp = node.getComponent('
|
|
397
|
-
if (comp)
|
|
403
|
+
let comp = node.getComponent('BaseReference');
|
|
404
|
+
if (comp) {
|
|
405
|
+
// const com = node.getComponentsInChildren("BaseReference").pop()
|
|
406
|
+
return js.getClassName(comp);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
|
|
398
410
|
//自定义组件
|
|
399
411
|
if (node.getComponent("Switch")) return "Switch";
|
|
400
412
|
if (node.getComponent("MSlider")) return "MSlider";
|
package/assets/core/ViewModel.ts
CHANGED
|
@@ -217,7 +217,6 @@ export function ViewModel<T extends new (...args: any[]) => Component>(Base: T)
|
|
|
217
217
|
is_load_sub?: boolean;
|
|
218
218
|
/**是否记录-不记录可重复打开窗口 */
|
|
219
219
|
is_record?: boolean;
|
|
220
|
-
name_ui: string;
|
|
221
220
|
};
|
|
222
221
|
// 创建响应式数据
|
|
223
222
|
_makeReactive<T extends object>(obj: T, pathPrefix: string): T {
|
|
@@ -667,7 +666,7 @@ function updateStatus(data: IBindingData, com: Component, value: any, self: any)
|
|
|
667
666
|
// const width = 100
|
|
668
667
|
// const height = 163
|
|
669
668
|
// layout.itemSize = math.size(width, height)
|
|
670
|
-
table_collection.layout = data.layout(self)
|
|
669
|
+
table_collection.layout = data.layout?.call(self)
|
|
671
670
|
// 注册列表内需要使用的 cell 节点类型
|
|
672
671
|
// 这个演示是通过编辑器绑定的,可以查看场景内 list 节点里的 register cells 配置
|
|
673
672
|
// this.table_collection.register('cell', () => instantiate('your cell prefab'))
|
|
@@ -697,8 +696,10 @@ function updateStatus(data: IBindingData, com: Component, value: any, self: any)
|
|
|
697
696
|
table_collection.reloadData()
|
|
698
697
|
}
|
|
699
698
|
break;
|
|
699
|
+
case 'cc.Node':
|
|
700
|
+
break;
|
|
700
701
|
default: {
|
|
701
|
-
//
|
|
702
|
+
// if (com) console.error(`请检查类型: ${data.type}`);
|
|
702
703
|
break
|
|
703
704
|
}
|
|
704
705
|
}
|