fixed the problem of graphics component scene error when the script is changed (#6922)

This commit is contained in:
JoneLau
2020-06-23 17:19:06 +08:00
committed by GitHub
parent e9ef6426f6
commit 7fa501ffcb
+2 -4
View File
@@ -259,8 +259,6 @@ export class GraphicsComponent extends UIRenderComponent {
public onEnable () {
super.onEnable();
this._attachToScene();
this._activateMaterial();
}
@@ -536,8 +534,8 @@ export class GraphicsComponent extends UIRenderComponent {
* 根据当前的画线样式,绘制当前或已经存在的路径。
*/
public stroke () {
this._attachToScene();
(this._assembler as IAssembler).stroke!(this);
this._attachToScene();
}
/**
@@ -548,8 +546,8 @@ export class GraphicsComponent extends UIRenderComponent {
* 根据当前的画线样式,填充当前或已经存在的路径。
*/
public fill () {
this._attachToScene();
(this._assembler as IAssembler).fill!(this);
this._attachToScene();
}
/**