@cc-component/cc-core 1.3.0 → 1.3.2
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/assets/core/lib/ecs/.ecs.md +1 -0
- package/assets/core/lib/ecs/ECS.ts +329 -0
- package/assets/core/{home/BaseBoxView.ts.meta → lib/ecs/ECS.ts.meta} +1 -1
- package/assets/core/lib/ecs/ECSComp.ts +35 -0
- package/assets/core/{home/DouYinShow.ts.meta → lib/ecs/ECSComp.ts.meta} +1 -1
- package/assets/core/lib/ecs/ECSEntity.ts +302 -0
- package/assets/core/lib/ecs/ECSEntity.ts.meta +9 -0
- package/assets/core/lib/ecs/ECSGroup.ts +83 -0
- package/assets/core/lib/ecs/ECSGroup.ts.meta +9 -0
- package/assets/core/lib/ecs/ECSMask.ts +57 -0
- package/assets/core/lib/ecs/ECSMask.ts.meta +9 -0
- package/assets/core/lib/ecs/ECSMatcher.ts +215 -0
- package/assets/core/lib/ecs/ECSMatcher.ts.meta +9 -0
- package/assets/core/lib/ecs/ECSModel.ts +82 -0
- package/assets/core/lib/ecs/ECSModel.ts.meta +9 -0
- package/assets/core/lib/ecs/ECSSystem.ts +221 -0
- package/assets/core/lib/ecs/ECSSystem.ts.meta +9 -0
- package/assets/core/lib/ecs/IECS.ts.meta +9 -0
- package/assets/core/lib/ecs.meta +9 -0
- package/index.ts +1 -0
- package/package.json +1 -1
- package/assets/core/home/BaseBoxView.ts +0 -57
- package/assets/core/home/DouYinShow.ts +0 -27
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { _decorator, Component, Node, Size, UITransform, v2, Vec2 } from 'cc';
|
|
2
|
-
const { ccclass, property } = _decorator;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@ccclass('BaseBoxView')
|
|
6
|
-
export class BaseBoxView extends Component {
|
|
7
|
-
box_size: any = { width: 100, height: 100 };//获取碰撞盒大小
|
|
8
|
-
box_node: Node;
|
|
9
|
-
box_center: Node;
|
|
10
|
-
box_node_ut: UITransform;
|
|
11
|
-
|
|
12
|
-
ut: UITransform;
|
|
13
|
-
|
|
14
|
-
protected onLoad(): void {
|
|
15
|
-
this.ut = this.node.getComponent(UITransform);
|
|
16
|
-
if (this.box_node) {
|
|
17
|
-
this.box_node_ut = this.box_node.getComponent(UITransform);
|
|
18
|
-
this.node.BoxView = this;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
UpdateBox(target: Node) {
|
|
24
|
-
// const data = CommonModule.Get_MapCenter().map_view.GetMapModel(0, 0)
|
|
25
|
-
// target = data.node;
|
|
26
|
-
// if (this.box_node) {
|
|
27
|
-
// this.box_node.scale = target.scale;
|
|
28
|
-
// const targetUT = target.getComponent(UITransform);
|
|
29
|
-
// this.box_node_ut.anchorPoint = v2(0.5, 0);
|
|
30
|
-
// this.box_node_ut.contentSize = new Size(targetUT.contentSize.width, targetUT.contentSize.height);
|
|
31
|
-
// this.box_size.width = this.box_node_ut.width;
|
|
32
|
-
// this.box_size.height = this.box_node_ut.height;
|
|
33
|
-
// }
|
|
34
|
-
}
|
|
35
|
-
// Collision(target_enemy: BoxView) {
|
|
36
|
-
// const box1 = this.GetBox(this);
|
|
37
|
-
// const box2 = this.GetBox(this.target_enemy);
|
|
38
|
-
|
|
39
|
-
// const ok = App.Collision(box1, box2);
|
|
40
|
-
// // Logger.debug("碰撞了吗?", ok, this.node.name)
|
|
41
|
-
// return ok
|
|
42
|
-
// }
|
|
43
|
-
|
|
44
|
-
public GetBox() {
|
|
45
|
-
const player = this;
|
|
46
|
-
const node = this.box_node;
|
|
47
|
-
const width = this.box_size.width;
|
|
48
|
-
const height = this.box_size.height;
|
|
49
|
-
const x = node.worldPosition.x - width * 0.5;
|
|
50
|
-
const y = node.worldPosition.y - height * 0.5;
|
|
51
|
-
return {
|
|
52
|
-
x1: x, y1: y,
|
|
53
|
-
x2: x + player.box_size.width, y2: y + player.box_size.height
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { _decorator, CCBoolean, Component, Node } from 'cc';
|
|
2
|
-
import { BYTEDANCE } from 'cc/env';
|
|
3
|
-
const { ccclass, property } = _decorator;
|
|
4
|
-
|
|
5
|
-
@ccclass('DouYinShow')
|
|
6
|
-
export class DouYinShow extends Component {
|
|
7
|
-
|
|
8
|
-
@property({})
|
|
9
|
-
isTip = false;
|
|
10
|
-
protected onLoad(): void {
|
|
11
|
-
if (BYTEDANCE) {
|
|
12
|
-
if (!App.IsDouYin() && !this.isTip) {
|
|
13
|
-
this.node.active = false;
|
|
14
|
-
} else {
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
start() {
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
update(deltaTime: number) {
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|