mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-12-08 12:28:44 +00:00
[adapters] 增加小游戏适配部分源码
This commit is contained in:
12
adapters/common/engine/Texture2D.js
Normal file
12
adapters/common/engine/Texture2D.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const Texture2D = cc.Texture2D;
|
||||
|
||||
if (Texture2D) {
|
||||
Object.assign(Texture2D.prototype, {
|
||||
initWithElement (element) {
|
||||
if (!element)
|
||||
return;
|
||||
this._image = element;
|
||||
this.handleLoadedTexture();
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user