@zhongguo168a/yxeditor-common 0.0.79 → 0.0.81
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 +14 -2
- package/dist/index.esm.js +45 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1509,6 +1509,9 @@ declare class AssetLoader extends Dispatcher {
|
|
|
1509
1509
|
onComplete?: (err: any, asset: any) => void;
|
|
1510
1510
|
uuid?: string;
|
|
1511
1511
|
}): this;
|
|
1512
|
+
loadTexture2D(uri: string, otherConfig?: {
|
|
1513
|
+
onComplete?: (err: any, asset: any) => void;
|
|
1514
|
+
}): this;
|
|
1512
1515
|
loadImageAsset(uri: string, otherConfig?: {
|
|
1513
1516
|
onComplete?: (err: any, asset: any) => void;
|
|
1514
1517
|
}): this;
|
|
@@ -1804,7 +1807,7 @@ declare namespace formatutil {
|
|
|
1804
1807
|
function format数字使用逗号(val: number | string, N?: number): string;
|
|
1805
1808
|
}
|
|
1806
1809
|
|
|
1807
|
-
declare enum GeometryDirection {
|
|
1810
|
+
declare const enum GeometryDirection {
|
|
1808
1811
|
East = 0,
|
|
1809
1812
|
SouthEast = 1,
|
|
1810
1813
|
South = 2,
|
|
@@ -1812,9 +1815,18 @@ declare enum GeometryDirection {
|
|
|
1812
1815
|
West = 4,
|
|
1813
1816
|
NorthWest = 5,
|
|
1814
1817
|
North = 6,
|
|
1815
|
-
NorthEast = 7
|
|
1818
|
+
NorthEast = 7,
|
|
1819
|
+
Any = 255
|
|
1820
|
+
}
|
|
1821
|
+
declare const enum DirectionMode {
|
|
1822
|
+
任意 = 0,
|
|
1823
|
+
二方向 = 1,
|
|
1824
|
+
四方向 = 2,
|
|
1825
|
+
斜四方向 = 3,
|
|
1826
|
+
八方向 = 4
|
|
1816
1827
|
}
|
|
1817
1828
|
declare class GeometryUtil {
|
|
1829
|
+
getDirection(mode: DirectionMode, 角度: number): GeometryDirection;
|
|
1818
1830
|
/**
|
|
1819
1831
|
* mode,8表示八方向,2表示二方向(左右),4表示4方向
|
|
1820
1832
|
* @param dot
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HorizontalTextAlignment, VerticalTextAlignment, director, macro, Scheduler, math, instantiate, _decorator, Component, SpriteAtlas, Size, Vec2, Rect, SpriteFrame, path, assetManager, ImageAsset, JsonAsset, TextAsset, Asset,
|
|
1
|
+
import { HorizontalTextAlignment, VerticalTextAlignment, director, macro, Scheduler, math, instantiate, _decorator, Component, SpriteAtlas, Size, Vec2, Rect, SpriteFrame, path, assetManager, Texture2D, ImageAsset, JsonAsset, TextAsset, Asset, find, Canvas, Node, Vec3, Vec4, resources, UITransform, Widget } from 'cc';
|
|
2
2
|
|
|
3
3
|
class NetUtil {
|
|
4
4
|
// 获取URL的参数对象
|
|
@@ -4766,6 +4766,16 @@ class AssetLoader extends Dispatcher {
|
|
|
4766
4766
|
this._loaderList.push(item);
|
|
4767
4767
|
return this;
|
|
4768
4768
|
}
|
|
4769
|
+
loadTexture2D(uri, otherConfig) {
|
|
4770
|
+
let item = new LoaderItem();
|
|
4771
|
+
item.type = "Texture2D";
|
|
4772
|
+
item.uri = new AssetURI(uri);
|
|
4773
|
+
if (otherConfig) {
|
|
4774
|
+
item.onComplete = otherConfig.onComplete;
|
|
4775
|
+
}
|
|
4776
|
+
this._loaderList.push(item);
|
|
4777
|
+
return this;
|
|
4778
|
+
}
|
|
4769
4779
|
loadImageAsset(uri, otherConfig) {
|
|
4770
4780
|
let item = new LoaderItem();
|
|
4771
4781
|
item.type = "ImageAsset";
|
|
@@ -4894,6 +4904,14 @@ class AssetLoader extends Dispatcher {
|
|
|
4894
4904
|
});
|
|
4895
4905
|
break;
|
|
4896
4906
|
}
|
|
4907
|
+
case "Texture2D": {
|
|
4908
|
+
this._loadByItem(item, Texture2D, (err, asset) => {
|
|
4909
|
+
this._loaded++;
|
|
4910
|
+
item.callHandler(null, asset);
|
|
4911
|
+
this.validComplete();
|
|
4912
|
+
});
|
|
4913
|
+
break;
|
|
4914
|
+
}
|
|
4897
4915
|
}
|
|
4898
4916
|
});
|
|
4899
4917
|
return this;
|
|
@@ -5477,8 +5495,34 @@ var GeometryDirection;
|
|
|
5477
5495
|
GeometryDirection[GeometryDirection["NorthWest"] = 5] = "NorthWest";
|
|
5478
5496
|
GeometryDirection[GeometryDirection["North"] = 6] = "North";
|
|
5479
5497
|
GeometryDirection[GeometryDirection["NorthEast"] = 7] = "NorthEast";
|
|
5498
|
+
GeometryDirection[GeometryDirection["Any"] = 255] = "Any";
|
|
5480
5499
|
})(GeometryDirection || (GeometryDirection = {}));
|
|
5500
|
+
var DirectionMode;
|
|
5501
|
+
(function (DirectionMode) {
|
|
5502
|
+
DirectionMode[DirectionMode["\u4EFB\u610F"] = 0] = "\u4EFB\u610F";
|
|
5503
|
+
DirectionMode[DirectionMode["\u4E8C\u65B9\u5411"] = 1] = "\u4E8C\u65B9\u5411";
|
|
5504
|
+
DirectionMode[DirectionMode["\u56DB\u65B9\u5411"] = 2] = "\u56DB\u65B9\u5411";
|
|
5505
|
+
DirectionMode[DirectionMode["\u659C\u56DB\u65B9\u5411"] = 3] = "\u659C\u56DB\u65B9\u5411";
|
|
5506
|
+
DirectionMode[DirectionMode["\u516B\u65B9\u5411"] = 4] = "\u516B\u65B9\u5411";
|
|
5507
|
+
})(DirectionMode || (DirectionMode = {}));
|
|
5481
5508
|
class GeometryUtil {
|
|
5509
|
+
getDirection(mode, 角度) {
|
|
5510
|
+
let direction = 0;
|
|
5511
|
+
switch (mode) {
|
|
5512
|
+
case DirectionMode.任意:
|
|
5513
|
+
direction = GeometryDirection.Any;
|
|
5514
|
+
break;
|
|
5515
|
+
case DirectionMode.二方向:
|
|
5516
|
+
direction = geoutil.angleToDirection(角度, 2);
|
|
5517
|
+
break;
|
|
5518
|
+
case DirectionMode.四方向:
|
|
5519
|
+
direction = geoutil.angleToDirection(角度, 4);
|
|
5520
|
+
break;
|
|
5521
|
+
case DirectionMode.斜四方向:
|
|
5522
|
+
break;
|
|
5523
|
+
}
|
|
5524
|
+
return direction;
|
|
5525
|
+
}
|
|
5482
5526
|
/**
|
|
5483
5527
|
* mode,8表示八方向,2表示二方向(左右),4表示4方向
|
|
5484
5528
|
* @param dot
|