@zhongguo168a/yxeditor-common 0.0.111 → 0.0.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +15 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as cc from 'cc';
|
|
1
2
|
import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Prefab, Node, Component, ISchedulable, AssetManager, Asset, Vec2, Texture2D, SpriteAtlas, Camera, Canvas, Vec3, Vec4, Widget, UITransform, math } from 'cc';
|
|
2
3
|
|
|
3
4
|
interface IError {
|
|
@@ -1556,6 +1557,7 @@ declare class AssetURI {
|
|
|
1556
1557
|
}
|
|
1557
1558
|
declare class XAssetManager {
|
|
1558
1559
|
getAsset(uri: string): any;
|
|
1560
|
+
removeAsset(uri: string): void | cc.Asset;
|
|
1559
1561
|
getAssetByUUID(uuid: string): any;
|
|
1560
1562
|
getRoot(): AssetManager;
|
|
1561
1563
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -4988,6 +4988,21 @@ class XAssetManager {
|
|
|
4988
4988
|
return bundle.get(obj.path);
|
|
4989
4989
|
}
|
|
4990
4990
|
}
|
|
4991
|
+
removeAsset(uri) {
|
|
4992
|
+
let obj = new AssetURI(uri);
|
|
4993
|
+
switch (obj.loadType) {
|
|
4994
|
+
case 1:
|
|
4995
|
+
return assetManager.assets.remove(obj.uuid);
|
|
4996
|
+
case 2:
|
|
4997
|
+
return assetManager.assets.remove(obj.name);
|
|
4998
|
+
default:
|
|
4999
|
+
let bundle = assetManager.getBundle(obj.bundle);
|
|
5000
|
+
if (!bundle) {
|
|
5001
|
+
return null;
|
|
5002
|
+
}
|
|
5003
|
+
return bundle.release(obj.path);
|
|
5004
|
+
}
|
|
5005
|
+
}
|
|
4991
5006
|
getAssetByUUID(uuid) {
|
|
4992
5007
|
return assetManager.assets.get(uuid);
|
|
4993
5008
|
}
|