UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

14 lines (13 loc) 478 B
"use strict"; import { ObjectNamedFunction1 } from "./_Base"; import { getObjectChildrenCountRef } from "../../core/reactivity/ObjectHierarchyReactivity"; import { dummyReadRefVal } from "./_Param"; export class getObjectChild extends ObjectNamedFunction1 { static type() { return "getObjectChild"; } func(object3D, index) { dummyReadRefVal(getObjectChildrenCountRef(object3D).value); return object3D.children[index] || object3D.children[0] || object3D; } }