怎么让cc.mask下面的_graphics属性不爆红

下了个源码学习mask, 代码里面有:
_mask: cc.Mask
this._mask._graphics.moveTo(p0.x, p0.y)

_graphics在vs里面老报红,虽然能编过,但是看着很不舒服,请问一下大大,引用什么可以不报啊

this.mask["_graphics"].moveTo(p0.x, p0.y)

提供一个 TS 处理报红的通用方法,我在 ShaderHelper 中使用多次:

//@ts-ignore
cc.Class.Attr.setClassAttr(ShaderHelper, 'program', 'enumList', array);

只需要在有红的代码上面,加上注释://@ts-ignore 就可以了

谢谢大佬,我下的就是你的源码,没想到原作者亲自回复我:joy:

能帮助到你很高兴:slightly_smiling:

https://mp.weixin.qq.com/s/s0RPMssdEURjLgylvZ23TQ

扩展下更全面的:joy: