@zhongguo168a/yxeditor-common 0.0.111 → 0.0.118
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/README.md +10 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.esm.js +42 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,3 +41,13 @@ npm version patch && npm publish --access public
|
|
|
41
41
|
```shell
|
|
42
42
|
npm version patch && npm publish --access public
|
|
43
43
|
```
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
npm 2FA Recovery Codes
|
|
47
|
+
```
|
|
48
|
+
891dffeb71266ea5d2a196589367da9a0e09659d16d1be254f8c635639b8c2d4
|
|
49
|
+
355e2e46df3f9179d41af99a0b4b4ea6478e0ef516d4c1475f55560b6c38f082
|
|
50
|
+
a7e71f6df9cf2aee6bc66cf61266d8867db50739448a5a21a8a27628093a3bb4
|
|
51
|
+
af822ad8ed2a28cb95e7ba98c3a1c3cb227dad4b17413f8969c50f91ee4d713f
|
|
52
|
+
9e4ea27411fdd50b79eae520f9678b3a7cd8f36a1fa552a85551bcacdef76b15
|
|
53
|
+
```
|
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
|
}
|
|
@@ -1596,6 +1598,10 @@ declare class AssetLoader extends Dispatcher {
|
|
|
1596
1598
|
onComplete?: (err: any, asset: any) => void;
|
|
1597
1599
|
preload?: boolean;
|
|
1598
1600
|
}): this;
|
|
1601
|
+
loadText(uri: string, otherConfig?: {
|
|
1602
|
+
onComplete?: (err: any, asset: any) => void;
|
|
1603
|
+
preload?: boolean;
|
|
1604
|
+
}): this;
|
|
1599
1605
|
loadJson(uri: string, otherConfig?: {
|
|
1600
1606
|
onComplete?: (err: any, asset: any) => void;
|
|
1601
1607
|
preload?: boolean;
|
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
|
}
|
|
@@ -5070,6 +5085,17 @@ class AssetLoader extends Dispatcher {
|
|
|
5070
5085
|
this._loaderList.push(item);
|
|
5071
5086
|
return this;
|
|
5072
5087
|
}
|
|
5088
|
+
loadText(uri, otherConfig) {
|
|
5089
|
+
let item = new LoaderItem();
|
|
5090
|
+
item.type = "Text";
|
|
5091
|
+
item.uri = new AssetURI(uri);
|
|
5092
|
+
if (otherConfig) {
|
|
5093
|
+
item.onComplete = otherConfig.onComplete;
|
|
5094
|
+
item.preload = otherConfig.preload != undefined ? otherConfig.preload : false;
|
|
5095
|
+
}
|
|
5096
|
+
this._loaderList.push(item);
|
|
5097
|
+
return this;
|
|
5098
|
+
}
|
|
5073
5099
|
loadJson(uri, otherConfig) {
|
|
5074
5100
|
let item = new LoaderItem();
|
|
5075
5101
|
item.type = "Json";
|
|
@@ -5155,6 +5181,22 @@ class AssetLoader extends Dispatcher {
|
|
|
5155
5181
|
});
|
|
5156
5182
|
break;
|
|
5157
5183
|
}
|
|
5184
|
+
case "Text": {
|
|
5185
|
+
let asset = assetx.getAsset(item.uri.name);
|
|
5186
|
+
if (asset) {
|
|
5187
|
+
this._loaded++;
|
|
5188
|
+
item.callHandler(null, asset);
|
|
5189
|
+
this.validComplete();
|
|
5190
|
+
}
|
|
5191
|
+
else {
|
|
5192
|
+
this._loadByItem(item, null, (err, asset) => {
|
|
5193
|
+
this._loaded++;
|
|
5194
|
+
item.callHandler(err, asset);
|
|
5195
|
+
this.validComplete();
|
|
5196
|
+
});
|
|
5197
|
+
}
|
|
5198
|
+
break;
|
|
5199
|
+
}
|
|
5158
5200
|
case "Json": {
|
|
5159
5201
|
let asset = assetx.getAsset(item.uri.name);
|
|
5160
5202
|
if (asset) {
|