@zhongguo168a/yxeditor-common 0.0.39 → 0.0.41

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Prefab, Node as Node$1, ISchedulable, AssetManager, Asset, SpriteAtlas, Camera, Canvas, Vec2, Vec3, Vec4, Widget, UITransform, math } from 'cc';
1
+ import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Node, Prefab, ISchedulable, AssetManager, Asset, SpriteAtlas, Camera, Canvas, Vec2, Vec3, Vec4, Widget, UITransform, math } from 'cc';
2
2
 
3
3
  interface IError {
4
4
  isCancel(): boolean;
@@ -1056,19 +1056,6 @@ declare class View extends EventDispatcher {
1056
1056
  protected _route: Route;
1057
1057
  }
1058
1058
 
1059
- declare class UIObjectDict extends Dictionary<string, any | List> {
1060
- /**
1061
- * 获取唯一的
1062
- * @param prefab
1063
- */
1064
- uniqueObject(prefab: Prefab): Node$1;
1065
- removeObject(prefab: Prefab): void;
1066
- popObject(prefab: Prefab): any;
1067
- backObject(object: Node$1): void;
1068
- protected getList(key: any): List;
1069
- }
1070
- declare var uidict: UIObjectDict;
1071
-
1072
1059
  declare class ViewList extends List<View> {
1073
1060
  }
1074
1061
  /**
@@ -1095,8 +1082,6 @@ declare class ViewRepo extends ViewDict {
1095
1082
  listByRoutePath(path: string): ViewList;
1096
1083
  listByTags(tags: string[]): ViewList;
1097
1084
  protected getController(name: string): ViewController;
1098
- get objectDict(): UIObjectDict;
1099
- protected _objectDict: UIObjectDict;
1100
1085
  protected _indexLayer: {};
1101
1086
  protected _indexRoute: {};
1102
1087
  }
@@ -1154,6 +1139,22 @@ declare class ViewController extends Controller {
1154
1139
  protected _layer: string;
1155
1140
  }
1156
1141
 
1142
+ declare class UIObjectRepo extends Dictionary<string, any | List> {
1143
+ /**
1144
+ * 获取唯一的
1145
+ * @param prefab
1146
+ */
1147
+ uniqueObject(prefab: Prefab): Node;
1148
+ removeObject(prefab: Prefab): void;
1149
+ popObject(prefab: Prefab): any;
1150
+ backObject(object: Node): void;
1151
+ protected getList(key: any): List;
1152
+ }
1153
+ /**
1154
+ * 全局的UI对象库,用于管理一些常用的ui对象,例如主界面,背包
1155
+ */
1156
+ declare var uirepo: UIObjectRepo;
1157
+
1157
1158
  declare class ViewHistory extends RouteList {
1158
1159
  back(): void;
1159
1160
  }
@@ -1975,21 +1976,21 @@ declare class UIUtil {
1975
1976
  * @param x
1976
1977
  * @param y
1977
1978
  */
1978
- hitTest(target: Node$1, x: number, y: number): boolean;
1979
- findNode(node: Node$1, name: string): Node$1;
1980
- walk(node: Node$1, f: (target: Node$1) => boolean): void;
1981
- _walk(node: Node$1, f: (target: Node$1) => boolean): boolean;
1979
+ hitTest(target: Node, x: number, y: number): boolean;
1980
+ findNode(node: Node, name: string): Node;
1981
+ walk(node: Node, f: (target: Node) => boolean): void;
1982
+ _walk(node: Node, f: (target: Node) => boolean): boolean;
1982
1983
  }
1983
1984
  declare const uiutil: UIUtil;
1984
1985
 
1985
1986
  declare class WidgetAlign {
1986
- node: Node$1;
1987
- targetNode: Node$1;
1987
+ node: Node;
1988
+ targetNode: Node;
1988
1989
  protected nodeWidget: Widget;
1989
1990
  protected parentTransform: UITransform;
1990
1991
  protected targetTransform: UITransform;
1991
1992
  protected uipos: math.Vec3;
1992
- constructor(node: Node$1, targetNode: Node$1);
1993
+ constructor(node: Node, targetNode: Node);
1993
1994
  topTop(distance?: number): void;
1994
1995
  topBottom(distance?: number): void;
1995
1996
  leftleft(distance?: number): void;
@@ -2002,43 +2003,43 @@ declare class WidgetUtil {
2002
2003
  * @param parent 对齐的父节点
2003
2004
  * @param distance
2004
2005
  */
2005
- alignTop(node: Node$1, parent: Node$1, distance?: number): void;
2006
+ alignTop(node: Node, parent: Node, distance?: number): void;
2006
2007
  /**
2007
2008
  * 与目标顶对齐,node和target都必须在渲染树中
2008
2009
  * @param node 需要修改的节点
2009
2010
  * @param target 对齐目标
2010
2011
  * @param distance
2011
2012
  */
2012
- alignTopWorld(node: Node$1, target: Node$1, distance?: number): void;
2013
+ alignTopWorld(node: Node, target: Node, distance?: number): void;
2013
2014
  /**
2014
2015
  * 与目标顶对齐,node和target都必须在渲染树中
2015
2016
  * @param node 需要修改的节点
2016
2017
  * @param target 对齐目标
2017
2018
  * @param distance
2018
2019
  */
2019
- alignBottomWorld(node: Node$1, target: Node$1, distance?: number): void;
2020
+ alignBottomWorld(node: Node, target: Node, distance?: number): void;
2020
2021
  /**
2021
2022
  * 调整【node】的widget,对齐【targetNode】
2022
2023
  * @param node
2023
2024
  * @param targetNode
2024
2025
  */
2025
- align(node: Node$1, targetNode: Node$1): WidgetAlign;
2026
+ align(node: Node, targetNode: Node): WidgetAlign;
2026
2027
  /**
2027
2028
  * 与目标右对齐
2028
2029
  * @param node 需要修改的节点
2029
2030
  * @param parent 对齐的父节点
2030
2031
  * @param distance
2031
2032
  */
2032
- alignLeft(node: Node$1, parent: Node$1, distance?: number): void;
2033
+ alignLeft(node: Node, parent: Node, distance?: number): void;
2033
2034
  /**
2034
2035
  * 与目标右对齐
2035
2036
  * @param node 需要修改的节点
2036
2037
  * @param target 对齐目标
2037
2038
  * @param distance
2038
2039
  */
2039
- alignLeftWorld(node: Node$1, target: Node$1, distance?: number): void;
2040
+ alignLeftWorld(node: Node, target: Node, distance?: number): void;
2040
2041
  }
2041
2042
  declare var widgetutil: WidgetUtil;
2042
2043
 
2043
- export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, NetUtil, PageController, PathUtil, Pool, RandUtil, Route, RouteList, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, View, ViewController, ViewDict, ViewEvent, ViewHistory, ViewList, ViewRepo, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, treeutil, uidict, uimgr, uiutil, viewhistorys, viewrepo, widgetutil };
2044
+ export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, NetUtil, PageController, PathUtil, Pool, RandUtil, Route, RouteList, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, View, ViewController, ViewDict, ViewEvent, ViewHistory, ViewList, ViewRepo, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, viewrepo, widgetutil };
2044
2045
  export type { CreatorFunction, DisposeFunction, IController, IError, IEventDispatcher, IExtend, IListItem, IModel, IModule, ITreeListItem, RecycleFunction };
package/dist/index.esm.js CHANGED
@@ -3693,60 +3693,6 @@ Route.data = {};
3693
3693
  class RouteList extends List {
3694
3694
  }
3695
3695
 
3696
- class UIObjectDict extends Dictionary {
3697
- /**
3698
- * 获取唯一的
3699
- * @param prefab
3700
- */
3701
- uniqueObject(prefab) {
3702
- if (!prefab) {
3703
- console.warn("未设置prefab");
3704
- return;
3705
- }
3706
- let key = prefab.data.uuid;
3707
- let object = this.get(key);
3708
- if (!object) {
3709
- object = instantiate(prefab);
3710
- this.set(key, object);
3711
- }
3712
- return object;
3713
- }
3714
- removeObject(prefab) {
3715
- if (!prefab) {
3716
- console.warn("未设置prefab");
3717
- return;
3718
- }
3719
- this.delete(prefab.data.uuid);
3720
- }
3721
- popObject(prefab) {
3722
- let object;
3723
- let key = prefab.data.uuid;
3724
- let list = this.getList(key);
3725
- if (list.length == 0) {
3726
- object = instantiate(prefab);
3727
- }
3728
- else {
3729
- object = list.pop();
3730
- }
3731
- return object;
3732
- }
3733
- backObject(object) {
3734
- // @ts-ignore
3735
- let key = object.prefab.asset.uuid;
3736
- let list = this.getList(key);
3737
- list.push(object);
3738
- }
3739
- getList(key) {
3740
- let list = this.get(key);
3741
- if (!list) {
3742
- list = new List();
3743
- this.set(key, list);
3744
- }
3745
- return list;
3746
- }
3747
- }
3748
- var uidict = new UIObjectDict();
3749
-
3750
3696
  class ViewList extends List {
3751
3697
  }
3752
3698
  /**
@@ -3816,14 +3762,6 @@ class ViewRepo extends ViewDict {
3816
3762
  getController(name) {
3817
3763
  return ctrlrepo.get(name);
3818
3764
  }
3819
- get objectDict() {
3820
- let dict = this._objectDict;
3821
- if (!dict) {
3822
- dict = new UIObjectDict();
3823
- this._objectDict = dict;
3824
- }
3825
- return dict;
3826
- }
3827
3765
  }
3828
3766
  const viewrepo = new ViewRepo();
3829
3767
 
@@ -4040,6 +3978,63 @@ class ViewController extends Controller {
4040
3978
  }
4041
3979
  }
4042
3980
 
3981
+ class UIObjectRepo extends Dictionary {
3982
+ /**
3983
+ * 获取唯一的
3984
+ * @param prefab
3985
+ */
3986
+ uniqueObject(prefab) {
3987
+ if (!prefab) {
3988
+ console.warn("未设置prefab");
3989
+ return;
3990
+ }
3991
+ let key = prefab.data.uuid;
3992
+ let object = this.get(key);
3993
+ if (!object) {
3994
+ object = instantiate(prefab);
3995
+ this.set(key, object);
3996
+ }
3997
+ return object;
3998
+ }
3999
+ removeObject(prefab) {
4000
+ if (!prefab) {
4001
+ console.warn("未设置prefab");
4002
+ return;
4003
+ }
4004
+ this.delete(prefab.data.uuid);
4005
+ }
4006
+ popObject(prefab) {
4007
+ let object;
4008
+ let key = prefab.data.uuid;
4009
+ let list = this.getList(key);
4010
+ if (list.length == 0) {
4011
+ object = instantiate(prefab);
4012
+ }
4013
+ else {
4014
+ object = list.pop();
4015
+ }
4016
+ return object;
4017
+ }
4018
+ backObject(object) {
4019
+ // @ts-ignore
4020
+ let key = object.prefab.asset.uuid;
4021
+ let list = this.getList(key);
4022
+ list.push(object);
4023
+ }
4024
+ getList(key) {
4025
+ let list = this.get(key);
4026
+ if (!list) {
4027
+ list = new List();
4028
+ this.set(key, list);
4029
+ }
4030
+ return list;
4031
+ }
4032
+ }
4033
+ /**
4034
+ * 全局的UI对象库,用于管理一些常用的ui对象,例如主界面,背包
4035
+ */
4036
+ var uirepo = new UIObjectRepo();
4037
+
4043
4038
  class ViewHistory extends RouteList {
4044
4039
  back() {
4045
4040
  if (viewhistorys.length == 0) {
@@ -6384,5 +6379,5 @@ class WidgetUtil {
6384
6379
  }
6385
6380
  var widgetutil = new WidgetUtil();
6386
6381
 
6387
- export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, NetUtil, PageController, PathUtil, Pool, RandUtil, Route, RouteList, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, View, ViewController, ViewDict, ViewEvent, ViewHistory, ViewList, ViewRepo, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, treeutil, uidict, uimgr, uiutil, viewhistorys, viewrepo, widgetutil };
6382
+ export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, NetUtil, PageController, PathUtil, Pool, RandUtil, Route, RouteList, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, View, ViewController, ViewDict, ViewEvent, ViewHistory, ViewList, ViewRepo, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, viewrepo, widgetutil };
6388
6383
  //# sourceMappingURL=index.esm.js.map