mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-25 19:28:28 +00:00
25 lines
665 B
JavaScript
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);
|
|
}
|
|
})
|
|
})();
|