setChildIndex 为目标对象正下方的值

setChildIndex to value directly below target object

希望将指定对象的对象索引值设置为 -1。

this.setChildIndex(box, circle.index-1);

我认为这会起作用,但显然我错了。 我试图让方框直接位于圆索引下方,该圆索引的索引值不断变化。有谁知道如何做到这一点?

使用 getChildIndex 方法我能够完成这个
解决方案:

this.setChildIndex(box, this.getChildIndex(circle)-1);