Results 438 comments of finscn

I found `selectedObjectsChanged` & `currentObjectsChanged` could be used for `selected object` But I change found the method to listen object.visible

@bjorn , Could you supply a common api to listen any property changed of the object. the callback with some arguments : propertyName, oldValue , newValue , oldType, newType ....

> Maybe you can write a little bit about your use-case of connecting to a change in visibility? I create some shdow-node , the shdow-node links to some real nodes....

搜了下 cocos的源码 没有搜到任何 WXWebAssembly.Memory 相关代码. 是不是没有使用共享内存?

> ```ts > querySpineSkeletonDataByUUID > ``` 这个 querySpineSkeletonDataByUUID 是 cocos内部在使用. 我这边并不会直接用 所以如果要用缓存 希望 cocos内部能实现这个机制. 比如这样做: ```ts cc.sp.SkeletonData.prototype.getRuntimeData = function (quiet?: boolean): cc.sp.spine.SkeletonData | null { if (this._skeletonCache) { return this._skeletonCache;...

> cocos 目前已经通过this._skeletonCache进行缓存了,asset资产销毁时会执行c++端资源销毁 this._skeletonCache 就是通过 querySpineSkeletonDataByUUID 获得的. 每次 query 得到的都是一个新的对象. 它并不是一个简单的指向`wasm中skeletonData对象`的指针, 而是一个比较复杂的对象, 更像一个代理. 如果一个 spine 动画 有 数百个实例, 每个实例 都有一个属于自己的 this._skeletonCache 对象 , 这些对象最终代表的是同一个`wasm中skeletonData对象`, 但是在js端, 是多个不同的对象. 他们应该是使用同一个js对象的.

> skeleton-data只要没释放,所有的对象都是共享同一个skeletonCache ```ts public getRuntimeData (quiet?: boolean): spine.SkeletonData | null { if (this._skeletonCache) { return this._skeletonCache; } if (!(this.textures && this.textures.length > 0) && this.textureNames && this.textureNames.length > 0) {...

@bofeng-song 我知道我们测试后出现差异的原因了 通常情况下, 下面这段代码 结果是 true : ``` // spineA 和 spineB 均为 cc.sp.Skeleton 组件的实例. spineA.skeletonData._skeletonCache === spineB.skeletonData._skeletonCache ``` 本质上 并不是因为 两个 _skeletonCache 是同一个对象, 而是因为 两个 skeletonData 是同一个对象. 这也是 你那边...

@bofeng-song 其实我要说的重点就是开头的这个: ``` const dataA = spine.wasmUtil.querySpineSkeletonDataByUUID(12345); const dataB = spine.wasmUtil.querySpineSkeletonDataByUUID(12345); console.log(dataA === dataB) ; // 打印 false ``` 可能你在 wasm/cpp 端是共享的一个对象, 但是在 js/ts端 每次都会创建一个新的 代理类 或者包装类.

> 这种没法重现,而且堆栈是不可阅读的情况下的报错没有什么意义。 目前我可以分析出个错误 是因为部分 updateUVs (sprite: Sprite) 方法只判断了 spriteFrame 是否存在 没有判断 spriteFrame 是否有效引起的. 比如文件 cocos/2d/assembler/sprite/simple.ts : ```ts updateUVs (sprite: Sprite) { if (!sprite.spriteFrame) return; const renderData = sprite.renderData!; const vData...