diff --git a/src/layaAir/laya/ui/UIComponent.ts b/src/layaAir/laya/ui/UIComponent.ts index a0f94557f3..b268422ec2 100644 --- a/src/layaAir/laya/ui/UIComponent.ts +++ b/src/layaAir/laya/ui/UIComponent.ts @@ -5,6 +5,7 @@ import { Node } from "../display/Node" import { Sprite } from "../display/Sprite" import { Event } from "../events/Event" import { ILaya } from "../../ILaya"; +import { SerializeUtil } from "../loaders/SerializeUtil"; /** * Component 是ui控件类的基类。 @@ -327,7 +328,9 @@ export class UIComponent extends Sprite { set disabled(value: boolean) { if (value !== this._disabled) { - this.gray = this._disabled = value; + this._disabled = value; + if (!SerializeUtil.isDeserializing) + this.gray = value; this.mouseEnabled = !value; } } diff --git a/src/layaAir/laya/webgl/shader/d2/value/Value2D.ts b/src/layaAir/laya/webgl/shader/d2/value/Value2D.ts index 979c269d16..5bf1eecc4e 100644 --- a/src/layaAir/laya/webgl/shader/d2/value/Value2D.ts +++ b/src/layaAir/laya/webgl/shader/d2/value/Value2D.ts @@ -117,7 +117,7 @@ export class Value2D { if (this.textureHost) { if (this.textureHost instanceof RenderTexture2D) { textrueReadGamma = (this.textureHost as RenderTexture2D).gammaCorrection != 1; - } else if (this.textureHost instanceof Texture) { + } else if (this.textureHost instanceof Texture && (this.textureHost as Texture).bitmap) { textrueReadGamma = (this.textureHost as Texture).bitmap.gammaCorrection != 1; } }