cocos-enhance-kit/jsb-adapter/engine/jsb-effect-variant.js
2022-06-25 00:23:03 +08:00

25 lines
665 B
JavaScript

// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
(function () {
if (!cc.EffectVariant) return;
let EffectVariant = cc.EffectVariant;
let _init = EffectVariant.prototype.init;
Object.assign(EffectVariant.prototype, {
init (effect) {
_init.call(this, effect);
this._nativeObj = new renderer.EffectVariant(effect._nativeObj);
},
_onEffectChanged () {
let nativeEffect = this._effect ? this._effect._nativeObj : null;
this._nativeObj.setEffect(nativeEffect);
},
updateHash (hash) {
this._nativeObj.updateHash(hash);
}
})
})();