Results 55 comments of SmallMain

Perhaps it would be better to provide apis like these that can update or play to a specific location themselves? 也许同时或只提供像下面这些可以自行 update 或者播放至指定位置的 api 更好? - https://gsap.com/docs/v3/GSAP/gsap.updateRoot() - https://gsap.com/docs/v3/GSAP/Tween/seek() -...

It sounds like a custom build plugin api, but it doesn't look like cocos is ready to open it up too much.

> > 个人认为 strictPropertyInitialization 没任何问题。只需要实现类似rust option类型即可。对于一个可空类型在任意地方unwraps 都是合理的。只需要程序本身可以认为此时是安全的就行。如果出现了空异常,那么说明程序执行了错误的逻辑。对于无法明确是否已经不会空的地方,也可自行通过 if let = Some(..) 判断。 也就是Nullable。或者从其他大型ts项目(babylon/vue)代码来看,大家都会默认为设置此类型为Nullable。也就是 T | undefined。这也更符合强类型语言的编程思维。cocos 的ts是基础设施。严格理当更好。对于这种变量,要么赋值要么可空。 > > 你最后一句话 "要么赋值要么可空" 说到了点子上, 这个是我本来打算说的第二个话题(第二步) : 如果不想关闭 strictPropertyInitialization , 可以考虑关闭 strictNullChecks ....

> 再补充下 : > > 找 tsconfig 参考时, 有的人会习惯性的找 最大的ts项目 vue.js 做参考. vue.js 没有改变 strictPropertyInitialization 和 strictNullChecks 在严格模式下的默认值 (都为 true) 但是 vue.js 本身基于 函数式编程的思想, 几乎没有 类和成员变量的概念, 自然没有受到 strictPropertyInitialization = true...