@safe-engine/cocos 2.6.4 → 2.6.5
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/dragonbones/DragonBonesSystem.js +3 -3
- package/dist/dragonbones/PixiDragonBonesSprite.d.ts +18 -8
- package/dist/dragonbones/PixiDragonBonesSprite.d.ts.map +1 -1
- package/dist/dragonbones/PixiDragonBonesSprite.js +41 -48
- package/dist/dragonbones/db-cocos/CocosFactory.d.ts.map +1 -1
- package/dist/dragonbones/db-cocos/CocosFactory.js +2 -1
- package/dist/dragonbones/db-cocos/SimpleMeshNode.d.ts +1 -1
- package/dist/dragonbones/db-cocos/SimpleMeshNode.d.ts.map +1 -1
- package/dist/dragonbones/db-cocos/SimpleMeshNode.js +1 -1
- package/dist/gui/GUISystem.js +1 -1
- package/dist/gworld/components/AnimationComponent.d.ts +65 -0
- package/dist/gworld/components/AnimationComponent.d.ts.map +1 -0
- package/dist/gworld/components/AnimationComponent.js +141 -0
- package/dist/gworld/components/CollideComponent.d.ts +64 -0
- package/dist/gworld/components/CollideComponent.d.ts.map +1 -0
- package/dist/gworld/components/CollideComponent.js +269 -0
- package/dist/gworld/components/EnhancedComponent.d.ts +22 -0
- package/dist/gworld/components/EnhancedComponent.d.ts.map +1 -0
- package/dist/gworld/components/EnhancedComponent.js +51 -0
- package/dist/gworld/components/GUIComponent.d.ts +67 -0
- package/dist/gworld/components/GUIComponent.d.ts.map +1 -0
- package/dist/gworld/components/GUIComponent.js +166 -0
- package/dist/gworld/components/NoRenderComponent.d.ts +38 -0
- package/dist/gworld/components/NoRenderComponent.d.ts.map +1 -0
- package/dist/gworld/components/NoRenderComponent.js +81 -0
- package/dist/gworld/components/NodeComp.d.ts +152 -0
- package/dist/gworld/components/NodeComp.d.ts.map +1 -0
- package/dist/gworld/components/NodeComp.js +405 -0
- package/dist/gworld/components/RenderComponent.d.ts +58 -0
- package/dist/gworld/components/RenderComponent.d.ts.map +1 -0
- package/dist/gworld/components/RenderComponent.js +166 -0
- package/dist/gworld/core/NodePool.d.ts +9 -0
- package/dist/gworld/core/NodePool.d.ts.map +1 -0
- package/dist/gworld/core/NodePool.js +30 -0
- package/dist/gworld/core/Scene.d.ts +5 -0
- package/dist/gworld/core/Scene.d.ts.map +1 -0
- package/dist/gworld/core/Scene.js +38 -0
- package/dist/gworld/core/decorator.d.ts +9 -0
- package/dist/gworld/core/decorator.d.ts.map +1 -0
- package/dist/gworld/core/decorator.js +43 -0
- package/dist/gworld/index.d.ts +8 -0
- package/dist/gworld/index.d.ts.map +1 -0
- package/dist/gworld/index.js +43 -0
- package/dist/gworld/systems/AnimationSystem.d.ts +6 -0
- package/dist/gworld/systems/AnimationSystem.d.ts.map +1 -0
- package/dist/gworld/systems/AnimationSystem.js +30 -0
- package/dist/gworld/systems/CollideSystem.d.ts +20 -0
- package/dist/gworld/systems/CollideSystem.d.ts.map +1 -0
- package/dist/gworld/systems/CollideSystem.js +171 -0
- package/dist/gworld/systems/GUISystem.d.ts +15 -0
- package/dist/gworld/systems/GUISystem.d.ts.map +1 -0
- package/dist/gworld/systems/GUISystem.js +123 -0
- package/dist/gworld/systems/NoRenderSystem.d.ts +16 -0
- package/dist/gworld/systems/NoRenderSystem.d.ts.map +1 -0
- package/dist/gworld/systems/NoRenderSystem.js +85 -0
- package/dist/gworld/systems/RenderSystem.d.ts +22 -0
- package/dist/gworld/systems/RenderSystem.d.ts.map +1 -0
- package/dist/gworld/systems/RenderSystem.js +104 -0
- package/dist/helper/NodePool.d.ts +9 -0
- package/dist/helper/NodePool.d.ts.map +1 -0
- package/dist/helper/NodePool.js +29 -0
- package/dist/helper/html-text-parser.d.ts +30 -0
- package/dist/helper/html-text-parser.d.ts.map +1 -0
- package/dist/helper/html-text-parser.js +354 -0
- package/dist/spine/CCSkeleton.d.ts +1 -188
- package/dist/spine/CCSkeleton.d.ts.map +1 -1
- package/dist/spine/CCSkeleton.js +127 -103
- package/dist/spine/CCSkeletonAnimation.d.ts +6 -136
- package/dist/spine/CCSkeletonAnimation.d.ts.map +1 -1
- package/dist/spine/CCSkeletonAnimation.js +101 -95
- package/dist/spine/CCSkeletonCanvasRenderCmd.d.ts.map +1 -1
- package/dist/spine/CCSkeletonCanvasRenderCmd.js +3 -6
- package/dist/spine/CCSkeletonTexture.d.ts +1 -24
- package/dist/spine/CCSkeletonTexture.d.ts.map +1 -1
- package/dist/spine/CCSkeletonTexture.js +6 -4
- package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts +1 -27
- package/dist/spine/CCSkeletonWebGLRenderCmd.d.ts.map +1 -1
- package/dist/spine/CCSkeletonWebGLRenderCmd.js +247 -243
- package/dist/spine/PixiSpineSprite.d.ts +19 -0
- package/dist/spine/PixiSpineSprite.d.ts.map +1 -0
- package/dist/spine/PixiSpineSprite.js +72 -0
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BaseComponentProps, GraphicsRenderProps, SpineData } from '../../../@types/safex';
|
|
2
|
+
import { ComponentX } from '../core/decorator';
|
|
3
|
+
export declare class NodeRender extends ComponentX {
|
|
4
|
+
nodeName: string;
|
|
5
|
+
}
|
|
6
|
+
interface SpriteRenderProps {
|
|
7
|
+
spriteFrame: string;
|
|
8
|
+
texType?: number;
|
|
9
|
+
type?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class SpriteRender extends ComponentX<SpriteRenderProps & BaseComponentProps<SpriteRender>, cc.Sprite> {
|
|
12
|
+
get spriteFrame(): string;
|
|
13
|
+
set spriteFrame(frame: string);
|
|
14
|
+
}
|
|
15
|
+
interface MaskRenderProps {
|
|
16
|
+
type?: number;
|
|
17
|
+
segments?: number;
|
|
18
|
+
inverted?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class MaskRender extends ComponentX<MaskRenderProps, cc.ClippingNode> {
|
|
21
|
+
}
|
|
22
|
+
interface ParticleCompProps {
|
|
23
|
+
plistFile: string;
|
|
24
|
+
}
|
|
25
|
+
export declare class ParticleComp extends ComponentX<ParticleCompProps, cc.ParticleSystem> {
|
|
26
|
+
}
|
|
27
|
+
interface SpineSkeletonProps {
|
|
28
|
+
data: SpineData;
|
|
29
|
+
skin?: string;
|
|
30
|
+
animation?: string;
|
|
31
|
+
timeScale?: number;
|
|
32
|
+
loop?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare class SpineSkeleton extends ComponentX<SpineSkeletonProps & BaseComponentProps<SpineSkeleton>> {
|
|
35
|
+
data: SpineData;
|
|
36
|
+
skin: string;
|
|
37
|
+
animation: string;
|
|
38
|
+
loop: boolean;
|
|
39
|
+
timeScale: number;
|
|
40
|
+
setAnimation(name: string, loop?: boolean): void;
|
|
41
|
+
setSkeletonData(data: string): void;
|
|
42
|
+
}
|
|
43
|
+
export declare class GraphicsRender extends ComponentX<GraphicsRenderProps & BaseComponentProps<GraphicsRender>, cc.DrawNode> {
|
|
44
|
+
lineWidth: number;
|
|
45
|
+
strokeColor: cc.Color;
|
|
46
|
+
fillColor: cc.Color;
|
|
47
|
+
circle(x: any, y: any, r: any): void;
|
|
48
|
+
clear(): void;
|
|
49
|
+
}
|
|
50
|
+
interface TiledMapProps {
|
|
51
|
+
mapFile: string;
|
|
52
|
+
}
|
|
53
|
+
export declare class TiledMap extends ComponentX<TiledMapProps & {
|
|
54
|
+
$ref?: TiledMap;
|
|
55
|
+
}, cc.TMXTiledMap> {
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=RenderComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderComponent.d.ts","sourceRoot":"","sources":["../../../src/gworld/components/RenderComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAE1F,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,qBAAa,UAAW,SAAQ,UAAU;IACxC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,qBAAa,YAAa,SAAQ,UAAU,CAAC,iBAAiB,GAAG,kBAAkB,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC;IAC3G,IAAI,WAAW,WAEd;IAED,IAAI,WAAW,CAAC,KAAK,QAAA,EAepB;CACF;AACD,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AACD,qBAAa,UAAW,SAAQ,UAAU,CAAC,eAAe,EAAE,EAAE,CAAC,YAAY,CAAC;CAAI;AAEhF,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAA;CAClB;AACD,qBAAa,YAAa,SAAQ,UAAU,CAAC,iBAAiB,EAAE,EAAE,CAAC,cAAc,CAAC;CAAI;AAEtF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AACD,qBAAa,aAAc,SAAQ,UAAU,CAAC,kBAAkB,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC;IACnG,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IAEjB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,UAAQ;IAOvC,eAAe,CAAC,IAAI,EAAE,MAAM;CAK7B;AAED,qBAAa,cAAe,SAAQ,UAAU,CAAC,mBAAmB,GAAG,kBAAkB,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC;IACnH,SAAS,SAAI;IACb,WAAW,WAAM;IACjB,SAAS,WAAO;IAEhB,MAAM,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,CAAC,KAAA;IAwDd,KAAK;CAKN;AAED,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,qBAAa,QAAS,SAAQ,UAAU,CAAC,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;CAAE,EAAE,EAAE,CAAC,WAAW,CAAC;CAAI"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TiledMap = exports.GraphicsRender = exports.SpineSkeleton = exports.ParticleComp = exports.MaskRender = exports.SpriteRender = exports.NodeRender = void 0;
|
|
19
|
+
var polyfills_1 = require("../../polyfills");
|
|
20
|
+
var decorator_1 = require("../core/decorator");
|
|
21
|
+
var NodeRender = /** @class */ (function (_super) {
|
|
22
|
+
__extends(NodeRender, _super);
|
|
23
|
+
function NodeRender() {
|
|
24
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
25
|
+
}
|
|
26
|
+
return NodeRender;
|
|
27
|
+
}(decorator_1.ComponentX));
|
|
28
|
+
exports.NodeRender = NodeRender;
|
|
29
|
+
var SpriteRender = /** @class */ (function (_super) {
|
|
30
|
+
__extends(SpriteRender, _super);
|
|
31
|
+
function SpriteRender() {
|
|
32
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(SpriteRender.prototype, "spriteFrame", {
|
|
35
|
+
get: function () {
|
|
36
|
+
return this.props.spriteFrame;
|
|
37
|
+
},
|
|
38
|
+
set: function (frame) {
|
|
39
|
+
this.props.spriteFrame = frame;
|
|
40
|
+
if (this.node && this.node.instance instanceof cc.Sprite) {
|
|
41
|
+
this.node.instance.setTexture(frame);
|
|
42
|
+
}
|
|
43
|
+
// } else if (this.node.instance instanceof ccui.ImageView) {
|
|
44
|
+
// if (this.texType) {
|
|
45
|
+
// this.node.instance.loadTexture(frame, this.texType)
|
|
46
|
+
// } else {
|
|
47
|
+
// this.node.instance.loadTexture(frame)
|
|
48
|
+
// }
|
|
49
|
+
// const sprite = new cc.Sprite(frame)
|
|
50
|
+
// this.node.setContentSize(sprite.getContentSize())
|
|
51
|
+
// } else if (this.node.instance instanceof ccui.Button) {
|
|
52
|
+
// this.node.instance.loadTextureNormal(frame)
|
|
53
|
+
},
|
|
54
|
+
enumerable: false,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
return SpriteRender;
|
|
58
|
+
}(decorator_1.ComponentX));
|
|
59
|
+
exports.SpriteRender = SpriteRender;
|
|
60
|
+
var MaskRender = /** @class */ (function (_super) {
|
|
61
|
+
__extends(MaskRender, _super);
|
|
62
|
+
function MaskRender() {
|
|
63
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
64
|
+
}
|
|
65
|
+
return MaskRender;
|
|
66
|
+
}(decorator_1.ComponentX));
|
|
67
|
+
exports.MaskRender = MaskRender;
|
|
68
|
+
var ParticleComp = /** @class */ (function (_super) {
|
|
69
|
+
__extends(ParticleComp, _super);
|
|
70
|
+
function ParticleComp() {
|
|
71
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
72
|
+
}
|
|
73
|
+
return ParticleComp;
|
|
74
|
+
}(decorator_1.ComponentX));
|
|
75
|
+
exports.ParticleComp = ParticleComp;
|
|
76
|
+
var SpineSkeleton = /** @class */ (function (_super) {
|
|
77
|
+
__extends(SpineSkeleton, _super);
|
|
78
|
+
function SpineSkeleton() {
|
|
79
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
80
|
+
}
|
|
81
|
+
SpineSkeleton.prototype.setAnimation = function (name, loop) {
|
|
82
|
+
if (loop === void 0) { loop = false; }
|
|
83
|
+
var skel = this.node.instance;
|
|
84
|
+
if (skel.setAnimation) {
|
|
85
|
+
skel.setAnimation(0, name, loop);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
SpineSkeleton.prototype.setSkeletonData = function (data) {
|
|
89
|
+
var skel = this.node.instance;
|
|
90
|
+
var atlas = data.replace('.json', '.atlas');
|
|
91
|
+
skel.initWithArgs(data, atlas, this.node.scale);
|
|
92
|
+
};
|
|
93
|
+
return SpineSkeleton;
|
|
94
|
+
}(decorator_1.ComponentX));
|
|
95
|
+
exports.SpineSkeleton = SpineSkeleton;
|
|
96
|
+
var GraphicsRender = /** @class */ (function (_super) {
|
|
97
|
+
__extends(GraphicsRender, _super);
|
|
98
|
+
function GraphicsRender() {
|
|
99
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
100
|
+
_this.lineWidth = 5;
|
|
101
|
+
_this.strokeColor = polyfills_1.RED;
|
|
102
|
+
_this.fillColor = polyfills_1.BLUE;
|
|
103
|
+
return _this;
|
|
104
|
+
}
|
|
105
|
+
GraphicsRender.prototype.circle = function (x, y, r) {
|
|
106
|
+
if (this.node.instance instanceof cc.DrawNode) {
|
|
107
|
+
this.node.instance.drawDot(cc.p(x, y), r, this.fillColor);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
// fill() { }
|
|
111
|
+
// stroke() { }
|
|
112
|
+
// drawPoint(position: Vec2, pointSize: Float, color: Color4B, pointType = PointType.Rect) {
|
|
113
|
+
// }
|
|
114
|
+
// // drawPoints(points: Vec2[], color: Color4B) {
|
|
115
|
+
// // }
|
|
116
|
+
// drawLine(origin: Vec2, destination: Vec2, color: Color4B, thickness: Float) {
|
|
117
|
+
// }
|
|
118
|
+
// drawRect(origin: Vec2, destination: Vec2, color: Color4B) {
|
|
119
|
+
// this.node.instance.drawRect(origin, destination, color)
|
|
120
|
+
// }
|
|
121
|
+
// drawSolidRect(origin: Vec2, destination: Vec2, color: Color4B) {
|
|
122
|
+
// }
|
|
123
|
+
// drawCircle(center: Vec2, radius: Float, angle?: Float, segments?: Integer, drawLineToCenter?: boolean, scaleX?: Float, scaleY?: Float, color?: Color4B, thickness?: Float) {
|
|
124
|
+
// this.node.instance.drawCircle(x, y, radius)
|
|
125
|
+
// }
|
|
126
|
+
// drawSolidCircle(origin: Vec2, destination: Vec2, color: Color4B) {
|
|
127
|
+
// }
|
|
128
|
+
// drawQuadBezier(origin: Vec2, destination: Vec2, color: Color4B) {
|
|
129
|
+
// }
|
|
130
|
+
// drawCubicBezier(origin: Vec2, destination: Vec2, color: Color4B) {
|
|
131
|
+
// }
|
|
132
|
+
// drawCardinalSpline(points: Vec2[], color: Color4B) {
|
|
133
|
+
// }
|
|
134
|
+
// drawCatmullRom(points: Vec2[], color: Color4B) {
|
|
135
|
+
// }
|
|
136
|
+
// drawPoly(points: Vec2[], closedPolygon: boolean, color: Color4B, thickness?: Float) {
|
|
137
|
+
// this.node.instance.poly(points, closedPolygon)
|
|
138
|
+
// this.node.instance.fill(color)
|
|
139
|
+
// }
|
|
140
|
+
// drawSolidPoly(points: Vec2[], color: Color4B) {
|
|
141
|
+
// this.node.instance.drawPoly(points, color)
|
|
142
|
+
// }
|
|
143
|
+
// drawDot(points: Vec2[], color: Color4B) {
|
|
144
|
+
// }
|
|
145
|
+
// drawSegment(from: Vec2, to: Vec2, color: Color4B) {
|
|
146
|
+
// }
|
|
147
|
+
// drawTriangle(p1: Vec2, p2: Vec2, p3: Vec2, color: Color4B) {
|
|
148
|
+
// this.node.instance.poly([p1, p2, p3], true)
|
|
149
|
+
// this.node.instance.fill(color)
|
|
150
|
+
// }
|
|
151
|
+
GraphicsRender.prototype.clear = function () {
|
|
152
|
+
if (this.node.instance instanceof cc.DrawNode) {
|
|
153
|
+
this.node.instance.clear();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return GraphicsRender;
|
|
157
|
+
}(decorator_1.ComponentX));
|
|
158
|
+
exports.GraphicsRender = GraphicsRender;
|
|
159
|
+
var TiledMap = /** @class */ (function (_super) {
|
|
160
|
+
__extends(TiledMap, _super);
|
|
161
|
+
function TiledMap() {
|
|
162
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
163
|
+
}
|
|
164
|
+
return TiledMap;
|
|
165
|
+
}(decorator_1.ComponentX));
|
|
166
|
+
exports.TiledMap = TiledMap;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodePool.d.ts","sourceRoot":"","sources":["../../../src/gworld/core/NodePool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEjD,qBAAa,QAAQ;IACnB,KAAK,EAAE,QAAQ,EAAE,CAAK;IAEtB,GAAG,CAAC,IAAI,EAAE,QAAQ;IAQlB,GAAG,IAAI,QAAQ;IAOf,IAAI;IAIJ,KAAK;CAIN"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NodePool = void 0;
|
|
4
|
+
var NodePool = /** @class */ (function () {
|
|
5
|
+
function NodePool() {
|
|
6
|
+
this.items = [];
|
|
7
|
+
}
|
|
8
|
+
NodePool.prototype.put = function (node) {
|
|
9
|
+
if (node) {
|
|
10
|
+
node.removeFromParent();
|
|
11
|
+
node.entity.immortal = true;
|
|
12
|
+
this.items.push(node);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
NodePool.prototype.get = function () {
|
|
16
|
+
var node = this.items.pop();
|
|
17
|
+
node.entity.immortal = false;
|
|
18
|
+
node.active = true;
|
|
19
|
+
return node;
|
|
20
|
+
};
|
|
21
|
+
NodePool.prototype.size = function () {
|
|
22
|
+
return this.items.length;
|
|
23
|
+
};
|
|
24
|
+
NodePool.prototype.clear = function () {
|
|
25
|
+
this.items.forEach(function (node) { return node.destroy(); });
|
|
26
|
+
this.items.length = 0;
|
|
27
|
+
};
|
|
28
|
+
return NodePool;
|
|
29
|
+
}());
|
|
30
|
+
exports.NodePool = NodePool;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../../src/gworld/core/Scene.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAGnE,qBAAa,cAAe,SAAQ,iBAAiB;IACnD,MAAM;CASP"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.SceneComponent = void 0;
|
|
19
|
+
var __1 = require("..");
|
|
20
|
+
var EnhancedComponent_1 = require("../components/EnhancedComponent");
|
|
21
|
+
var NodeComp_1 = require("../components/NodeComp");
|
|
22
|
+
var SceneComponent = /** @class */ (function (_super) {
|
|
23
|
+
__extends(SceneComponent, _super);
|
|
24
|
+
function SceneComponent() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
SceneComponent.prototype.render = function () {
|
|
28
|
+
var world = __1.GameWorld.Instance;
|
|
29
|
+
world.entities.reset();
|
|
30
|
+
var root = world.entities.create();
|
|
31
|
+
var node = root.assign(new NodeComp_1.NodeComp(cc.director.getRunningScene(), root));
|
|
32
|
+
var sceneComponent = root.assign(this);
|
|
33
|
+
sceneComponent.node = node;
|
|
34
|
+
return sceneComponent;
|
|
35
|
+
};
|
|
36
|
+
return SceneComponent;
|
|
37
|
+
}(EnhancedComponent_1.EnhancedComponent));
|
|
38
|
+
exports.SceneComponent = SceneComponent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EnhancedComponent } from '../components/EnhancedComponent';
|
|
2
|
+
import { NodeComp } from '../components/NodeComp';
|
|
3
|
+
export declare class NoRenderComponentX<Props = object, C extends cc.Node = cc.Node> extends EnhancedComponent<Props, NodeComp<C>> {
|
|
4
|
+
static hasRender: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class ComponentX<Props = object, C extends cc.Node = cc.Node> extends EnhancedComponent<Props, NodeComp<C>> {
|
|
7
|
+
render?(): this;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../../src/gworld/core/decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEjD,qBAAa,kBAAkB,CAAC,KAAK,GAAG,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAE,SAAQ,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxH,MAAM,CAAC,SAAS,UAAQ;CACzB;AAED,qBAAa,UAAU,CAAC,KAAK,GAAG,MAAM,EAAE,CAAC,SAAS,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAE,SAAQ,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAChH,MAAM,CAAC;CAMR"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ComponentX = exports.NoRenderComponentX = void 0;
|
|
19
|
+
var __1 = require("..");
|
|
20
|
+
var EnhancedComponent_1 = require("../components/EnhancedComponent");
|
|
21
|
+
var NoRenderComponentX = /** @class */ (function (_super) {
|
|
22
|
+
__extends(NoRenderComponentX, _super);
|
|
23
|
+
function NoRenderComponentX() {
|
|
24
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
25
|
+
}
|
|
26
|
+
NoRenderComponentX.hasRender = false;
|
|
27
|
+
return NoRenderComponentX;
|
|
28
|
+
}(EnhancedComponent_1.EnhancedComponent));
|
|
29
|
+
exports.NoRenderComponentX = NoRenderComponentX;
|
|
30
|
+
var ComponentX = /** @class */ (function (_super) {
|
|
31
|
+
__extends(ComponentX, _super);
|
|
32
|
+
function ComponentX() {
|
|
33
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
+
}
|
|
35
|
+
ComponentX.prototype.render = function () {
|
|
36
|
+
var world = __1.GameWorld.Instance;
|
|
37
|
+
var root = world.entities.create();
|
|
38
|
+
var comp = root.assign(this);
|
|
39
|
+
return comp;
|
|
40
|
+
};
|
|
41
|
+
return ComponentX;
|
|
42
|
+
}(EnhancedComponent_1.EnhancedComponent));
|
|
43
|
+
exports.ComponentX = ComponentX;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Constructor, System, World } from 'entityx-ts';
|
|
2
|
+
export declare class GameWorld extends World {
|
|
3
|
+
listUpdate: (System | Constructor<System>)[];
|
|
4
|
+
update(dt: number): void;
|
|
5
|
+
private static _instance;
|
|
6
|
+
static get Instance(): GameWorld;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gworld/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvD,qBAAa,SAAU,SAAQ,KAAK;IAClC,UAAU,EAAE,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,CAAK;IACjD,MAAM,CAAC,EAAE,EAAE,MAAM;IAMjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAW;IAEnC,WAAkB,QAAQ,cAGzB;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.GameWorld = void 0;
|
|
19
|
+
var entityx_ts_1 = require("entityx-ts");
|
|
20
|
+
var GameWorld = /** @class */ (function (_super) {
|
|
21
|
+
__extends(GameWorld, _super);
|
|
22
|
+
function GameWorld() {
|
|
23
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
_this.listUpdate = [];
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
GameWorld.prototype.update = function (dt) {
|
|
28
|
+
var _this = this;
|
|
29
|
+
this.listUpdate.forEach(function (system) {
|
|
30
|
+
_this.systems.update(system, dt);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
Object.defineProperty(GameWorld, "Instance", {
|
|
34
|
+
get: function () {
|
|
35
|
+
// Do you need arguments? Make it a regular static method instead.
|
|
36
|
+
return this._instance || (this._instance = new this());
|
|
37
|
+
},
|
|
38
|
+
enumerable: false,
|
|
39
|
+
configurable: true
|
|
40
|
+
});
|
|
41
|
+
return GameWorld;
|
|
42
|
+
}(entityx_ts_1.World));
|
|
43
|
+
exports.GameWorld = GameWorld;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EntityManager, EventManager, System } from 'entityx-ts';
|
|
2
|
+
export declare class AnimationSystem implements System {
|
|
3
|
+
configure(event_manager: EventManager): void;
|
|
4
|
+
update(entities: EntityManager, events: EventManager, dt: Float): void;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=AnimationSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../src/gworld/systems/AnimationSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,YAAY,CAAA;AAI5E,qBAAa,eAAgB,YAAW,MAAM;IAC5C,SAAS,CAAC,aAAa,EAAE,YAAY;IAQrC,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK;CAUhE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnimationSystem = void 0;
|
|
4
|
+
var entityx_ts_1 = require("entityx-ts");
|
|
5
|
+
var AnimationComponent_1 = require("../components/AnimationComponent");
|
|
6
|
+
var NodeComp_1 = require("../components/NodeComp");
|
|
7
|
+
var AnimationSystem = /** @class */ (function () {
|
|
8
|
+
function AnimationSystem() {
|
|
9
|
+
}
|
|
10
|
+
AnimationSystem.prototype.configure = function (event_manager) {
|
|
11
|
+
event_manager.subscribe(entityx_ts_1.EventTypes.ComponentAdded, AnimationComponent_1.AnimationComp, function (_a) {
|
|
12
|
+
var entity = _a.entity;
|
|
13
|
+
var animation = entity.getComponent(AnimationComponent_1.AnimationComp);
|
|
14
|
+
animation.node = entity.getComponent(NodeComp_1.NodeComp);
|
|
15
|
+
setTimeout(animation.start.bind(animation), 0);
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
AnimationSystem.prototype.update = function (entities, events, dt) {
|
|
19
|
+
var animations = entities.entities_with_components(AnimationComponent_1.AnimationComp);
|
|
20
|
+
// cc.log(animations);
|
|
21
|
+
animations.forEach(function (ett) {
|
|
22
|
+
var animation = ett.getComponent(AnimationComponent_1.AnimationComp);
|
|
23
|
+
if (animation.node && animation.node.active) {
|
|
24
|
+
animation.update(dt);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
return AnimationSystem;
|
|
29
|
+
}());
|
|
30
|
+
exports.AnimationSystem = AnimationSystem;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EntityManager, EventManager, System } from 'entityx-ts';
|
|
2
|
+
import { Collider, Contract } from '../components/CollideComponent';
|
|
3
|
+
export declare class CollideSystem implements System {
|
|
4
|
+
listColliders: Collider[];
|
|
5
|
+
_contracts: Contract[];
|
|
6
|
+
removeColliders: any[];
|
|
7
|
+
debugGraphics: cc.DrawNode;
|
|
8
|
+
enabledDebugDraw: boolean;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
colliderMatrix: boolean[][];
|
|
11
|
+
configure(event_manager: EventManager): void;
|
|
12
|
+
private onAddCollider;
|
|
13
|
+
private onRemoveCollider;
|
|
14
|
+
update(entities: EntityManager, events: EventManager, dt: number): void;
|
|
15
|
+
addCollider(collider: Collider): void;
|
|
16
|
+
removeCollider(collider: Collider): void;
|
|
17
|
+
addDebugNode(root: cc.Scene): void;
|
|
18
|
+
toggleDebugDraw(enable?: boolean): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=CollideSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollideSystem.d.ts","sourceRoot":"","sources":["../../../src/gworld/systems/CollideSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAc,MAAM,EAAE,MAAM,YAAY,CAAA;AAG5E,OAAO,EAA+B,QAAQ,EAAiB,QAAQ,EAAmB,MAAM,gCAAgC,CAAA;AAGhI,qBAAa,aAAc,YAAW,MAAM;IAC1C,aAAa,EAAE,QAAQ,EAAE,CAAK;IAC9B,UAAU,EAAE,QAAQ,EAAE,CAAK;IAC3B,eAAe,QAAK;IACpB,aAAa,EAAE,EAAE,CAAC,QAAQ,CAAA;IAC1B,gBAAgB,UAAQ;IACxB,OAAO,UAAO;IACd,cAAc,cAAW;IAEzB,SAAS,CAAC,aAAa,EAAE,YAAY;IASrC,OAAO,CAAC,aAAa,CAOpB;IAED,OAAO,CAAC,gBAAgB,CAEvB;IAED,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM;IA2GhE,WAAW,CAAC,QAAQ,EAAE,QAAQ;IAS9B,cAAc,CAAC,QAAQ,EAAE,QAAQ;IAIjC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK;IAK3B,eAAe,CAAC,MAAM,UAAO;CAI9B"}
|