cocos-enhance-kit/jsb-adapter/engine/jsb-effect-variant.js

25 lines
665 B
JavaScript
Raw Permalink Normal View History

2022-06-24 16:23:03 +00:00
// 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);
}
})
})();