-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the UI error issues caused by adjustments to the batching and splitting of UI elements. #18052
Conversation
Are all the |
|
It seems unnecessary at the moment; the impact of resetState is not significant, and testing has shown no issues. |
Shall we only change the |
I think we need to check whether renderData is null in all places since we modified the behavior in UIRenderer which is a base class. |
I see. So we should change all the |
@cocos-robot run test cases |
@GengineJS, Please check the result of
Task Details |
@GengineJS, Please check the result of
Task Details
|
@@ -320,6 +320,10 @@ export class UIRenderer extends Renderer { | |||
this.node.on(NodeEventType.ANCHOR_CHANGED, this._nodeStateChange, this); | |||
this.node.on(NodeEventType.SIZE_CHANGED, this._nodeStateChange, this); | |||
this.node.on(NodeEventType.PARENT_CHANGED, this._colorDirty, this); | |||
// If the renderData is invalid, it needs to be rebuilt to recalculate the batch processing. | |||
if (!this._renderData && this._flushAssembler) { | |||
this._flushAssembler(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause the issue: https://forum.cocos.org/t/topic/165212/66
In ParticleSystem2D component, this._renderData is always null
, so each time onEnable
is invoked, ParticleSystem2D._flushAssembler
method will be invoked which will create new RenderData in it.
protected _flushAssembler (): void {
const assembler = ParticleSystem2D.Assembler.getAssembler(this);
if (this._assembler !== assembler) {
this._assembler = assembler;
}
if (this._assembler && this._assembler.createData) {
// ---> this._simulator.renderData will be overridden.
this._simulator.renderData = this._assembler.createData(this);
this._simulator.renderData.particleInitRenderDrawInfo(this.renderEntity);
this._simulator.initDrawInfo();
}
}
No description provided.