@zhongguo168a/yxeditor-common 0.0.110 → 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 +3 -1
- package/dist/index.esm.js +19 -4
- 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 {
|
|
@@ -676,7 +677,7 @@ declare class ListSource extends EventDispatcher {
|
|
|
676
677
|
at(index: number): ListNode;
|
|
677
678
|
first(): ListNode;
|
|
678
679
|
last(): ListNode;
|
|
679
|
-
length(): number;
|
|
680
|
+
get length(): number;
|
|
680
681
|
/**
|
|
681
682
|
* 添加项,无法添加相同的项
|
|
682
683
|
* @param node
|
|
@@ -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
|
@@ -2669,7 +2669,7 @@ class ListSource extends EventDispatcher {
|
|
|
2669
2669
|
last() {
|
|
2670
2670
|
return this._data[this._data.length - 1];
|
|
2671
2671
|
}
|
|
2672
|
-
length() {
|
|
2672
|
+
get length() {
|
|
2673
2673
|
return this._data.length;
|
|
2674
2674
|
}
|
|
2675
2675
|
/**
|
|
@@ -2763,7 +2763,7 @@ class ListSource extends EventDispatcher {
|
|
|
2763
2763
|
this.dispatch(ListSource.EVENT_REFRESH, { node: node });
|
|
2764
2764
|
}
|
|
2765
2765
|
walk(f) {
|
|
2766
|
-
for (let i = 0; i < this.length
|
|
2766
|
+
for (let i = 0; i < this.length; i++) {
|
|
2767
2767
|
let item = this._data[i];
|
|
2768
2768
|
if (!f(item)) {
|
|
2769
2769
|
return false;
|
|
@@ -2939,7 +2939,7 @@ class Dictionary {
|
|
|
2939
2939
|
}
|
|
2940
2940
|
}
|
|
2941
2941
|
deleteDictionary(other) {
|
|
2942
|
-
if (other.length
|
|
2942
|
+
if (other.length == 0) {
|
|
2943
2943
|
return;
|
|
2944
2944
|
}
|
|
2945
2945
|
for (const key in other._data) {
|
|
@@ -2990,7 +2990,7 @@ class Dictionary {
|
|
|
2990
2990
|
return [value, value !== undefined];
|
|
2991
2991
|
}
|
|
2992
2992
|
isEmpty() {
|
|
2993
|
-
return this.length
|
|
2993
|
+
return this.length === 0;
|
|
2994
2994
|
}
|
|
2995
2995
|
items() {
|
|
2996
2996
|
const items = [];
|
|
@@ -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
|
}
|