mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-26 03:38:29 +00:00
[engine] 修复勾选延迟加载资源时资源不会加载的问题
This commit is contained in:
parent
b330bf563c
commit
27477452c5
@ -819,8 +819,10 @@ let Label = cc.Class({
|
||||
// 根据材质更新 uniform
|
||||
const isMultiMaterial = material.material.isMultiSupport();
|
||||
if (isMultiMaterial) {
|
||||
// 贴图在 updateRenderData 才确定下来
|
||||
// if (texture) this._updateMultiTexId(material, texture);
|
||||
const texture = this._frame._texture;
|
||||
if (texture instanceof cc.Texture2D && !texture.loaded) {
|
||||
cc.assetManager.postLoadNative(texture);
|
||||
}
|
||||
this._texIdDirty = true;
|
||||
} else {
|
||||
material.setProperty('texture', this._frame._texture);
|
||||
|
@ -261,6 +261,10 @@ var MotionStreak = cc.Class({
|
||||
const isMultiMaterial = material.material.isMultiSupport();
|
||||
if (isMultiMaterial) {
|
||||
if (!this._texture) return;
|
||||
const texture = this._texture;
|
||||
if (texture instanceof cc.Texture2D && !texture.loaded) {
|
||||
cc.assetManager.postLoadNative(texture);
|
||||
}
|
||||
this._updateMultiTexId(material, this._texture);
|
||||
} else {
|
||||
const textureImpl = this._texture && this._texture.getImpl();
|
||||
|
@ -486,8 +486,9 @@ var Sprite = cc.Class({
|
||||
// 根据材质更新 uniform
|
||||
const isMultiMaterial = material.material.isMultiSupport();
|
||||
if (isMultiMaterial) {
|
||||
// 在 assembler 中进行更新性能会更好,不需要每次 setSpriteFrame 都更新,并且动态图集会导致两次触发
|
||||
// if (texture) this._updateMultiTexId(material, texture);
|
||||
if (texture instanceof cc.Texture2D && !texture.loaded) {
|
||||
cc.assetManager.postLoadNative(texture);
|
||||
}
|
||||
this._texIdDirty = true;
|
||||
} else {
|
||||
const textureImpl = texture && texture.getImpl();
|
||||
|
Loading…
Reference in New Issue
Block a user