@cc-component/cc-fly 0.0.0-stage → 1.0.0

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.
Files changed (38) hide show
  1. package/.cc-ex-component.md +12 -0
  2. package/assets/fly/Interface.ts +32 -0
  3. package/assets/fly/Interface.ts.meta +9 -0
  4. package/assets/fly/base/BuffUI.ts +68 -0
  5. package/assets/fly/base/BuffUI.ts.meta +9 -0
  6. package/assets/fly/base/FlyArrowLauncher.ts +166 -0
  7. package/assets/fly/base/FlyArrowLauncher.ts.meta +9 -0
  8. package/assets/fly/base/FlyBaseBullet.ts +9 -0
  9. package/assets/fly/base/FlyBaseBullet.ts.meta +9 -0
  10. package/assets/fly/base/FlyBaseHit.ts +10 -0
  11. package/assets/fly/base/FlyBaseHit.ts.meta +9 -0
  12. package/assets/fly/base/FlyBaseHp.ts +96 -0
  13. package/assets/fly/base/FlyBaseHp.ts.meta +9 -0
  14. package/assets/fly/base/FlyBasePlayer.ts +359 -0
  15. package/assets/fly/base/FlyBasePlayer.ts.meta +9 -0
  16. package/assets/fly/base/FlyDamageLabel.ts +198 -0
  17. package/assets/fly/base/FlyDamageLabel.ts.meta +9 -0
  18. package/assets/fly/base/FlyDamageLabelManager.ts +111 -0
  19. package/assets/fly/base/FlyDamageLabelManager.ts.meta +9 -0
  20. package/assets/fly/base/FlyModule.ts +145 -0
  21. package/assets/fly/base/FlyModule.ts.meta +9 -0
  22. package/assets/fly/base/FlyNodePoolUtil.ts +56 -0
  23. package/assets/fly/base/FlyNodePoolUtil.ts.meta +9 -0
  24. package/assets/fly/base/FlyPlayerBuffSystem.ts +673 -0
  25. package/assets/fly/base/FlyPlayerBuffSystem.ts.meta +9 -0
  26. package/assets/fly/base/FlyPooledParticleEffect.ts +58 -0
  27. package/assets/fly/base/FlyPooledParticleEffect.ts.meta +9 -0
  28. package/assets/fly/base/FlySkiiManager.ts +19 -0
  29. package/assets/fly/base/FlySkiiManager.ts.meta +9 -0
  30. package/assets/fly/base.meta +9 -0
  31. package/assets/fly.meta +9 -0
  32. package/assets/pathfinding.meta +9 -0
  33. package/assets.meta +9 -0
  34. package/index.ts +19 -0
  35. package/index.ts.meta +9 -0
  36. package/package.json +18 -5
  37. package/package.json.meta +11 -0
  38. package/README.md +0 -3
@@ -0,0 +1,58 @@
1
+ import { _decorator, Component, ParticleSystem2D, sp } from 'cc';
2
+ import { FlyNodePoolUtil } from './FlyNodePoolUtil';
3
+
4
+ const { ccclass, property } = _decorator;
5
+
6
+ @ccclass('FlyPooledParticleEffect')
7
+ export class FlyPooledParticleEffect extends Component {
8
+ @property({ type: ParticleSystem2D, displayName: '粒子系统' })
9
+ ps: ParticleSystem2D = null;
10
+
11
+ @property({ type: sp.Skeleton, displayName: 'Spine 骨骼' })
12
+ skeleton: sp.Skeleton = null;
13
+
14
+ @property({ displayName: 'Spine 动画名', tooltip: '填写需要播放的动画,播放一次后自动回收到对象池。' })
15
+ spineAnimation = '';
16
+
17
+ private returnedToPool = false;
18
+
19
+ onLoad(): void {
20
+ this.ps ??= this.getComponent(ParticleSystem2D);
21
+ if (this.ps) this.ps.playOnLoad = false;
22
+ this.skeleton ??= this.getComponent(sp.Skeleton);
23
+ this.skeleton?.setCompleteListener(() => this.returnToPool());
24
+ }
25
+
26
+ play(): void {
27
+ this.ps ??= this.getComponent(ParticleSystem2D);
28
+ this.skeleton ??= this.getComponent(sp.Skeleton);
29
+ this.returnedToPool = false;
30
+
31
+ if (this.ps) {
32
+ this.ps.playOnLoad = false;
33
+ this.ps.stopSystem();
34
+ this.ps.resetSystem();
35
+ return;
36
+ }
37
+
38
+ if (this.skeleton) {
39
+ if (this.spineAnimation) {
40
+ this.skeleton.setAnimation(0, this.spineAnimation, false);
41
+ } else {
42
+ this.returnToPool();
43
+ }
44
+ }
45
+ }
46
+
47
+ update(): void {
48
+ if (!this.returnedToPool && this.ps?.stopped && this.ps.particleCount === 0) {
49
+ this.returnToPool();
50
+ }
51
+ }
52
+
53
+ private returnToPool(): void {
54
+ if (this.returnedToPool) return;
55
+ this.returnedToPool = true;
56
+ FlyNodePoolUtil.put(this.node);
57
+ }
58
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "4.0.24",
3
+ "importer": "typescript",
4
+ "imported": true,
5
+ "uuid": "9ad4f87e-144f-4e7d-9e12-76daec0f43b1",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
@@ -0,0 +1,19 @@
1
+ import { _decorator, Component, Node } from 'cc';
2
+ const { ccclass, property } = _decorator;
3
+
4
+ @ccclass('FlySkiiManager')
5
+ export class FlySkiiManager {
6
+ static instance: FlySkiiManager | null = null;
7
+ static getInstance(): FlySkiiManager {
8
+ if (!FlySkiiManager.instance) {
9
+ FlySkiiManager.instance = new FlySkiiManager();
10
+ }
11
+ return FlySkiiManager.instance;
12
+ }
13
+
14
+
15
+ EmitSkillAnim: Function | null = null;
16
+
17
+ }
18
+
19
+
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "4.0.24",
3
+ "importer": "typescript",
4
+ "imported": true,
5
+ "uuid": "0c7d9be2-d0c6-4957-abc5-0c550bace637",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "1.2.0",
3
+ "importer": "directory",
4
+ "imported": true,
5
+ "uuid": "3cbea25c-dfc1-45d0-ad43-c19d3e307bd2",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "1.2.0",
3
+ "importer": "directory",
4
+ "imported": true,
5
+ "uuid": "437b287e-070b-4916-8a69-96139c6a1420",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "1.2.0",
3
+ "importer": "directory",
4
+ "imported": true,
5
+ "uuid": "e4e42467-8a2b-4dc2-9fdc-0cf349ccf04d",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
package/assets.meta ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "1.2.0",
3
+ "importer": "directory",
4
+ "imported": true,
5
+ "uuid": "26f5c181-7f68-4336-b9b0-b03c14f2e67f",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
package/index.ts ADDED
@@ -0,0 +1,19 @@
1
+ // 负责导出assets下的模块,如: export { default } from './assets/xxx.ts'
2
+
3
+ export { } from './assets/fly/Interface';
4
+ export * from './assets/fly/base/FlyArrowLauncher';
5
+ export * from './assets/fly/base/FlyBaseBullet';
6
+ export * from './assets/fly/base/FlyBaseHit';
7
+ export * from './assets/fly/base/FlyBaseHp';
8
+ export * from './assets/fly/base/FlyDamageLabelManager';
9
+ export * from './assets/fly/base/FlyDamageLabel';
10
+
11
+ export * from './assets/fly/base/FlyNodePoolUtil';
12
+ export * from './assets/fly/base/FlyPlayerBuffSystem';
13
+ export * from './assets/fly/base/FlyPooledParticleEffect';
14
+
15
+
16
+
17
+
18
+
19
+
package/index.ts.meta ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "ver": "4.0.24",
3
+ "importer": "typescript",
4
+ "imported": true,
5
+ "uuid": "94ad86cd-5c18-4717-9ad2-c9c5331ad2ec",
6
+ "files": [],
7
+ "subMetas": {},
8
+ "userData": {}
9
+ }
package/package.json CHANGED
@@ -1,6 +1,19 @@
1
- {
2
- "name": "@cc-component/cc-fly",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
1
+ {
2
+ "name": "@cc-component/cc-fly",
3
+ "version": "1.0.0",
4
+ "engine": ">=3.8.6",
5
+ "description": "系统组件添加常用扩展方法",
6
+ "main": "index.ts",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://gitee.com/YangFanHome/cc-fly"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "registry": "https://registry.npmjs.org"
17
+ },
18
+ "license": "MIT"
6
19
  }
@@ -0,0 +1,11 @@
1
+ {
2
+ "ver": "2.0.1",
3
+ "importer": "json",
4
+ "imported": true,
5
+ "uuid": "66c783ea-897e-4707-a1f5-2d9b3bcb8cac",
6
+ "files": [
7
+ ".json"
8
+ ],
9
+ "subMetas": {},
10
+ "userData": {}
11
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.