[0]挂载在预制体上的runtime脚本要怎么获得?

官方文档提供了this.owner.scene as MyRuntime这句代码获得挂在在scene2D上的runtime,那如果针对预制体要如何获得挂载在预制体上的runtime,对预制体使用这段代码貌似拿到的是对应的scene2D上的runtime,而不是预制体身上的runtime
已邀请:

99mengx

赞同来自:

破案了,如果需要获得预制体上的runtime,则 let rt = this.owner as xxxRT;就行了,不需要.scene

该问题目前已经被锁定, 无法添加新回复

商务合作
商务合作