mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 01:12:42 +08:00
Button allow enableAutoGrayEffect when COLOR transition being choosed (#3026)
This commit is contained in:
@@ -502,7 +502,7 @@ function _doDispatchEvent (owner, event) {
|
||||
}
|
||||
}
|
||||
_cachedArray.length = 0;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* !#en
|
||||
|
||||
@@ -661,14 +661,15 @@ let Button = cc.Class({
|
||||
|
||||
_updateDisabledState () {
|
||||
if (this._sprite) {
|
||||
this._sprite.setState(cc.Sprite.State.NORMAL);
|
||||
}
|
||||
if (this.enableAutoGrayEffect && this.transition !== Transition.COLOR) {
|
||||
if (!(this.transition === Transition.SPRITE && this.disabledSprite)) {
|
||||
if (this._sprite && !this.interactable) {
|
||||
this._sprite.setState(cc.Sprite.State.GRAY);
|
||||
if (this.enableAutoGrayEffect) {
|
||||
if (!(this.transition === Transition.SPRITE && this.disabledSprite)) {
|
||||
if (!this.interactable) {
|
||||
this._sprite.setState(cc.Sprite.State.GRAY);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this._sprite.setState(cc.Sprite.State.NORMAL);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user