|
@@ -153,10 +153,11 @@ export class LevelAction extends Component {
|
|
|
/** 返回顶部面板里的颜色钉子组件数组*/
|
|
|
get_pin_color(): PinComponent[] {
|
|
|
let arr: PinComponent[] = [];
|
|
|
- for (let i = this.node.children.length - 1; i >= 0; i--) {
|
|
|
- let unit_action = this.node.children[i].getComponent(UnitAction);
|
|
|
- unit_action?.get_pin_color(arr);
|
|
|
- }
|
|
|
+ const units = this.node.getComponentsInChildren(UnitAction)!;
|
|
|
+ console.log('units.length:', units.length);
|
|
|
+ units.forEach((unit) => {
|
|
|
+ unit.get_pin_color(arr);
|
|
|
+ })
|
|
|
return arr
|
|
|
}
|
|
|
|