我用的是cocos create 3.8.8
const graphics = this.getComponent(Graphics)
if (!graphics) return
graphics.fillColor.fromHEX('#ff0000');
graphics.circle(0, 0, 100)
graphics.fill()
以上代码可以画出红色的圆.
const graphics = this.getComponent(Graphics)
if (!graphics) return
graphics.fillColor.set(1, 0, 0, 1)
graphics.circle(0, 0, 100)
graphics.fill()
以上的代码却是漆黑一片,
我知道问题出在 graphics.fillColor.set(1, 0, 0, 1)
但是不知道为什么会不行