var el = this.scene.getNodeById(‘gltfitem’).el const gltf = el.getComponent(‘gltf’); console.log('gltf‘) console.log(gltf) var cur = gltf.getInternalNodeByName('bianpao4')
console.log(cur) cur = cur.getChildAtIndex(0) // cur = cur._children[0] // cur = cur._children[0]._children[0]
可以,使用getInternalNodeByName(name: string)来获取内部元素,visible属性在元素的transform组件上。
const gltf = el.getComponent(‘gltf’);
console.log('gltf‘)
console.log(gltf)
var cur = gltf.getInternalNodeByName('bianpao4')
console.log(cur)
cur = cur.getChildAtIndex(0)
// cur = cur._children[0]
// cur = cur._children[0]._children[0]
console.log(cur)
console.log(cur._components)
console.log(cur._components.transform)
setTimeout(() => {
cur._components.transform.visible = false
}, 2000);