revert preview change (#15450)

This commit is contained in:
Jiujiang Liu
2023-06-16 14:29:35 +08:00
committed by GitHub
parent 820826939d
commit 6f412705ff
+7 -7
View File
@@ -666,16 +666,16 @@ exports.methods = {
addAssetChangeListener(add = true) {
if (!add && this.hasListenAssetsChange) {
Editor.Message.__protected__.removeBroadcastListener('scene:asset-applied', this.onAssetChangeBind);
Editor.Message.__protected__.removeBroadcastListener('asset-db:asset-change', this.onAssetChangeBind);
this.hasListenAssetsChange = false;
return;
}
Editor.Message.__protected__.addBroadcastListener('scene:asset-applied', this.onAssetChangeBind);
Editor.Message.__protected__.addBroadcastListener('asset-db:asset-change', this.onAssetChangeBind);
this.hasListenAssetsChange = true;
},
async onAssetChange(uuids) {
if (uuids.includes(this.asset.uuid)) {
async onAssetChange(uuid) {
if (this.asset.uuid === uuid) {
// Update the animation dump when the parent assets changes
this.meta = await Editor.Message.request('asset-db', 'query-asset-meta', this.asset.uuid);
const clipInfo = animation.methods.getCurClipInfo.call(this);
@@ -684,7 +684,7 @@ exports.methods = {
},
};
exports.ready = function() {
exports.ready = function () {
this.gridWidth = 0;
this.gridTableWith = 0;
this.activeTab = 'animation';
@@ -726,7 +726,7 @@ exports.ready = function() {
this.eventEditor.ready.call(this);
};
exports.update = async function(assetList, metaList) {
exports.update = async function (assetList, metaList) {
this.assetList = assetList;
this.metaList = metaList;
this.isMultiple = this.assetList.length > 1;
@@ -757,7 +757,7 @@ exports.update = async function(assetList, metaList) {
this.refreshPreview();
};
exports.close = function() {
exports.close = function () {
for (const prop in Elements) {
const element = Elements[prop];
if (element.close) {