diff --git a/cocos/3d/ui/components/button-component.ts b/cocos/3d/ui/components/button-component.ts index ecb9eed450..3036e1fd19 100644 --- a/cocos/3d/ui/components/button-component.ts +++ b/cocos/3d/ui/components/button-component.ts @@ -479,6 +479,12 @@ export class ButtonComponent extends Component { this.node.on('spriteframe-changed', (comp: SpriteComponent) => { if (this._transition === Transition.SPRITE) { this._normalSprite = comp.spriteFrame; + } else { + // avoid serialization data loss when in no-sprite mode + this._normalSprite = null; + this._hoverSprite = null; + this._pressedSprite = null; + this._disabledSprite = null; } }, this); }