woso_javan před 2 měsíci
rodič
revize
fc9a86ead3

+ 2 - 2
assets/module_storm_sunder/Prefabs/Buildings/detail_treeA.prefab

@@ -203,7 +203,7 @@
     "__prefab": {
       "__id__": 8
     },
-    "_group": 4,
+    "_group": 16,
     "_type": 4,
     "_mass": 1,
     "_allowSleep": true,
@@ -241,7 +241,7 @@
       "__id__": 10
     },
     "_material": null,
-    "_isTrigger": false,
+    "_isTrigger": true,
     "_center": {
       "__type__": "cc.Vec3",
       "x": 0,

+ 2 - 2
assets/module_storm_sunder/Prefabs/Buildings/farm_plot.prefab

@@ -332,7 +332,7 @@
     "__prefab": {
       "__id__": 13
     },
-    "_group": 4,
+    "_group": 16,
     "_type": 4,
     "_mass": 1,
     "_allowSleep": true,
@@ -370,7 +370,7 @@
       "__id__": 15
     },
     "_material": null,
-    "_isTrigger": false,
+    "_isTrigger": true,
     "_center": {
       "__type__": "cc.Vec3",
       "x": 0,

+ 2 - 2
assets/module_storm_sunder/Prefabs/Buildings/house.prefab

@@ -215,7 +215,7 @@
     "__prefab": {
       "__id__": 8
     },
-    "_group": 4,
+    "_group": 16,
     "_type": 4,
     "_mass": 1,
     "_allowSleep": true,
@@ -253,7 +253,7 @@
       "__id__": 10
     },
     "_material": null,
-    "_isTrigger": false,
+    "_isTrigger": true,
     "_center": {
       "__type__": "cc.Vec3",
       "x": 0.1,

+ 2 - 2
assets/module_storm_sunder/Prefabs/Buildings/lumbermill.prefab

@@ -215,7 +215,7 @@
     "__prefab": {
       "__id__": 8
     },
-    "_group": 4,
+    "_group": 16,
     "_type": 4,
     "_mass": 1,
     "_allowSleep": true,
@@ -253,7 +253,7 @@
       "__id__": 10
     },
     "_material": null,
-    "_isTrigger": false,
+    "_isTrigger": true,
     "_center": {
       "__type__": "cc.Vec3",
       "x": 0.1,

+ 2 - 2
assets/module_storm_sunder/Prefabs/Buildings/market.prefab

@@ -215,7 +215,7 @@
     "__prefab": {
       "__id__": 8
     },
-    "_group": 4,
+    "_group": 16,
     "_type": 4,
     "_mass": 1,
     "_allowSleep": true,
@@ -253,7 +253,7 @@
       "__id__": 10
     },
     "_material": null,
-    "_isTrigger": false,
+    "_isTrigger": true,
     "_center": {
       "__type__": "cc.Vec3",
       "x": 0,

+ 2 - 2
assets/module_storm_sunder/Prefabs/Buildings/mill.prefab

@@ -344,7 +344,7 @@
     "__prefab": {
       "__id__": 13
     },
-    "_group": 4,
+    "_group": 16,
     "_type": 4,
     "_mass": 1,
     "_allowSleep": true,
@@ -382,7 +382,7 @@
       "__id__": 15
     },
     "_material": null,
-    "_isTrigger": false,
+    "_isTrigger": true,
     "_center": {
       "__type__": "cc.Vec3",
       "x": 0,

+ 2 - 2
assets/module_storm_sunder/Prefabs/Map.prefab

@@ -165,7 +165,7 @@
     "__prefab": {
       "__id__": 6
     },
-    "_group": 16,
+    "_group": 2,
     "_type": 2,
     "_mass": 1,
     "_allowSleep": true,
@@ -414,7 +414,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "buildings",
+    "_name": "props",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {

+ 1 - 1
assets/module_storm_sunder/Prefabs/Props/cake.prefab

@@ -237,7 +237,7 @@
       "__id__": 10
     },
     "_material": null,
-    "_isTrigger": false,
+    "_isTrigger": true,
     "_center": {
       "__type__": "cc.Vec3",
       "x": 0,

+ 107 - 48
assets/module_storm_sunder/Prefabs/Tornado.prefab

@@ -23,31 +23,22 @@
       },
       {
         "__id__": 11
-      },
-      {
-        "__id__": 13
-      },
-      {
-        "__id__": 15
-      },
-      {
-        "__id__": 17
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 19
+        "__id__": 21
       }
     ],
     "_prefab": {
-      "__id__": 21
+      "__id__": 23
     },
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": 0
+      "z": 35.073
     },
     "_lrot": {
       "__type__": "cc.Quat",
@@ -164,7 +155,7 @@
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "08lV28Mc1Oyp+yIX7UVnJb"
+    "fileId": "54sBIhps1DaLKIX/yoOd8p"
   },
   {
     "__type__": "cc.ModelBakeSettings",
@@ -198,7 +189,7 @@
     "__prefab": {
       "__id__": 7
     },
-    "_group": 2,
+    "_group": 8,
     "_type": 1,
     "_mass": 1,
     "_allowSleep": true,
@@ -221,7 +212,7 @@
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "71OvKDJwpP8IslU432Ftyz"
+    "fileId": "b2KdC+gAlM6oeXI1MD7sq+"
   },
   {
     "__type__": "cc.ConeCollider",
@@ -240,17 +231,17 @@
     "_center": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 0,
-      "z": 0
+      "y": -2.9802322387695312e-8,
+      "z": 4.470348358154297e-8
     },
-    "_radius": 0.5,
-    "_height": 1,
+    "_radius": 0.5000000149011612,
+    "_height": 1.0000000596046448,
     "_direction": 1,
     "_id": ""
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "a9T1qJO4tDHbVh3adb4Yw9"
+    "fileId": "94Y3bPlhlL0ImVy1PSVZW/"
   },
   {
     "__type__": "cc.PrefabInfo",
@@ -260,30 +251,86 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "04UOOmRd1KHq9erKbFDcuc",
+    "fileId": "5eFoQ5kahMirFaah5BmPyi",
     "instance": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
   {
     "__type__": "cc.Node",
-    "_name": "point0",
+    "_name": "points",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
       "__id__": 1
     },
+    "_children": [
+      {
+        "__id__": 12
+      },
+      {
+        "__id__": 14
+      },
+      {
+        "__id__": 16
+      },
+      {
+        "__id__": 18
+      }
+    ],
+    "_active": true,
+    "_components": [],
+    "_prefab": {
+      "__id__": 20
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 1073741824,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "point0",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 11
+    },
     "_children": [],
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 12
+      "__id__": 13
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 0.5,
+      "x": 0,
       "y": 0,
-      "z": -2
+      "z": -5
     },
     "_lrot": {
       "__type__": "cc.Quat",
@@ -316,7 +363,7 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "efd0EpbpRFGYQ8AMQBDwVZ",
+    "fileId": "45NvzSuJJK9JAuDr/ON4vc",
     "instance": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
@@ -327,17 +374,17 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 1
+      "__id__": 11
     },
     "_children": [],
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 14
+      "__id__": 15
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 2,
+      "x": 5,
       "y": 0,
       "z": 0
     },
@@ -372,7 +419,7 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "4bDxOgR0lN0Y5smU4fJreO",
+    "fileId": "6bD5huaYNFfL0odjGjWZyL",
     "instance": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
@@ -383,19 +430,19 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 1
+      "__id__": 11
     },
     "_children": [],
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 16
+      "__id__": 17
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -0.5,
+      "x": 0,
       "y": 0,
-      "z": 2
+      "z": 5
     },
     "_lrot": {
       "__type__": "cc.Quat",
@@ -428,7 +475,7 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "97Aha6sq5AkLRJvk7lA1+E",
+    "fileId": "1fkwkGBXZMybzaKhDbnSk+",
     "instance": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
@@ -439,19 +486,19 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 1
+      "__id__": 11
     },
     "_children": [],
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 18
+      "__id__": 19
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -2,
+      "x": -5,
       "y": 0,
-      "z": 0.5
+      "z": 0
     },
     "_lrot": {
       "__type__": "cc.Quat",
@@ -484,7 +531,20 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "6ed5STiNVPv68MYccQfANX",
+    "fileId": "5cSM8RHw1PJosXKmWXO6tv",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "aaVTSRjAZGiL/gEYIMcJLp",
     "instance": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
@@ -499,27 +559,27 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 20
+      "__id__": 22
     },
     "points": [
       {
-        "__id__": 11
+        "__id__": 12
       },
       {
-        "__id__": 13
+        "__id__": 14
       },
       {
-        "__id__": 15
+        "__id__": 16
       },
       {
-        "__id__": 17
+        "__id__": 18
       }
     ],
     "_id": ""
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "60ByWU2pZIIoeQxE8l8LnS"
+    "fileId": "7aI3hGBslEiZ/KnKTUXIJi"
   },
   {
     "__type__": "cc.PrefabInfo",
@@ -529,8 +589,7 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "c46/YsCPVOJYA4mWEpNYRx",
-    "instance": null,
+    "fileId": "7fzeuXamJOA4JobLGguO8T",
     "targetOverrides": null
   }
 ]

+ 1 - 1
assets/module_storm_sunder/Prefabs/Tornado.prefab.meta

@@ -2,7 +2,7 @@
   "ver": "1.1.50",
   "importer": "prefab",
   "imported": true,
-  "uuid": "04a5bb68-6799-409e-9c01-9bf76b296382",
+  "uuid": "d4e37ab6-7666-41a2-8808-647e5edd6b44",
   "files": [
     ".json"
   ],

+ 0 - 106
assets/module_storm_sunder/Script/Component/HolePlayer.ts

@@ -1,106 +0,0 @@
-import { BoxCollider, Component, ConeCollider, CylinderCollider, ITriggerEvent, MeshCollider, Node, ParticleSystem, SphereCollider, Vec3, _decorator, director, game, isValid, v3 } from 'cc';
-import { PropComponent } from './PropComponent';
-import { UIJoyStick } from '../UIJoyStick';
-import { GameMgr, GameStatus } from '../Manager/GameMgr';
-const { ccclass, property } = _decorator;
-
-const _dir: Vec3 = new Vec3();
-const _ime: Vec3 = new Vec3();
-
-@ccclass('HolePlayer')
-export class HolePlayer extends Component {
-    @property(Node)
-    tornad: Node = null!;
-
-    @property({ type: [Node] })
-    points: Node[] = [];
-
-    holeTigger: ConeCollider = null!;
-    speed: number = 10;
-
-    coefficient: number = 1;
-    isMagment: boolean = false;
-
-    protected start(): void {
-        this.initilizeData();
-        this.updateHoleView();
-        this.initilizeUI();
-        this.addEventListener();
-    }
-
-    initilizeData(): void {
-
-    }
-
-    initilizeUI(): void {
-        this.holeTigger = this.tornad.getComponent(ConeCollider)!;
-        console.log('this.holeTigger', this.holeTigger);
-        this.holeTigger.on('onTriggerEnter', this.onTriggerEnter, this);
-        this.holeTigger.on('onTriggerStay', this.onTriggerStay, this);
-        this.holeTigger.on('onTriggerExit', this.onTriggerExit, this);
-    }
-
-    addEventListener(): void {
-
-    }
-
-    protected onDestroy(): void {
-    }
-
-    onTriggerEnter(event: ITriggerEvent): void {
-        const selfCollider = event.selfCollider as SphereCollider;
-        const otherCollider = event.otherCollider as CylinderCollider;
-        const radius = otherCollider.radius;
-
-        console.log(event.otherCollider.node.name);
-        if (event.otherCollider.getGroup() == 1 << 2) {
-            const food = event.otherCollider.node.getComponent(PropComponent);
-            event.otherCollider.node.setParent(this.points[Math.floor(Math.random() * this.points.length)]);
-            event.otherCollider.node.setPosition(Vec3.ZERO);
-
-            food.swallow();
-        }
-
-    }
-
-    onTriggerStay(event: ITriggerEvent): void {
-
-    }
-
-    onTriggerExit(event: ITriggerEvent): void {
-
-    }
-
-    getPlanceVec3(event: ITriggerEvent): Vec3 {
-        const otherPos = event.otherCollider.worldBounds.center;
-        const otherPlanceToY = new Vec3(otherPos.x, 0, otherPos.z);
-        const distance = otherPlanceToY.clone().subtract3f(this.node.position.x, 0, this.node.position.z);
-        return distance;
-    }
-
-    update(deltaTime: number) {
-        if (GameMgr.inst.gameStatus != GameStatus.Playing) return;
-        this.MoveHandler();
-        //自身旋转
-        this.RotateHandler();
-    }
-
-    RotateHandler(): void {
-        const rotateSpeed = 500;
-        this.node.eulerAngles = new Vec3(this.node.eulerAngles.x, this.node.eulerAngles.y + rotateSpeed * game.deltaTime, this.node.eulerAngles.z);
-        // console.log('this.node.eulerAngles:', this.node.eulerAngles);
-    }
-
-    MoveHandler(): void {
-        const playerDir = UIJoyStick.ins.dir;
-        const playerX = playerDir.x * this.speed * game.deltaTime;
-        const playerZ = playerDir.y * this.speed * game.deltaTime;
-
-        this.node.setPosition(this.node.position.x + playerX, 0, this.node.position.z - playerZ);
-    }
-
-    updateHoleView(): void {
-    }
-}
-
-

+ 0 - 1
assets/module_storm_sunder/Script/Component/HolePlayer.ts.meta

@@ -1 +0,0 @@
-{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"b97175d1-f1f5-47f6-8391-15d58d5619a3","files":[],"subMetas":{},"userData":{}}

+ 6 - 6
assets/module_storm_sunder/Script/Component/TornadoComponent.ts

@@ -14,8 +14,8 @@ export class TornadoComponent extends Component {
     points: Node[] = [];
 
     tornado: Node = null!;
-    tigger: ConeCollider = null!; //龙卷风触发器
-    radiusTigger: ConeCollider = null!;     //龙卷风半径检测触发器
+    tigger: Collider = null!; //龙卷风触发器
+    radiusTigger: Collider = null!;     //龙卷风半径检测触发器
 
     attack: number = 1;
     speed: number = 50;
@@ -30,15 +30,15 @@ export class TornadoComponent extends Component {
         if (!this.node) return;
 
         this.tornado = this.node.getChildByName('tornado')!;
-        this.tigger = this.tornado.getComponent(ConeCollider)!;
+        this.tigger = this.tornado.getComponent(Collider)!;
 
         this.tigger.on('onTriggerEnter', this.onTriggerEnter, this);
         this.tigger.on('onTriggerStay', this.onTriggerStay, this);
     }
 
     onTriggerEnter(event: ITriggerEvent): void {
-        console.log('发生碰撞+++++++++++++++++++++++++++')
-        if (event.otherCollider.getGroup() == 1 << 2) {
+        console.log(`龙卷风碰撞到:${event.otherCollider.node.name}`)
+        if (event.otherCollider.getGroup() == 1 << 4) {
             let comp = event.otherCollider.node.getComponent(PropComponent)!;
 
             if (comp) {
@@ -56,7 +56,7 @@ export class TornadoComponent extends Component {
         if (GameMgr.inst.gameStatus != GameStatus.Playing) return;
         this.MoveHandler();
         // //自身旋转
-        // this.RotateHandler();
+        this.RotateHandler();
     }
 
     RotateHandler(): void {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 223 - 688
assets/module_storm_sunder/rooster_stormsunder.scene


+ 7 - 7
settings/v2/packages/project.json

@@ -20,27 +20,27 @@
     "collisionGroups": [
       {
         "index": 1,
-        "name": "PLAYER"
+        "name": "floor"
       },
       {
         "index": 2,
-        "name": "ENEMY"
+        "name": "obstacle"
       },
       {
         "index": 3,
-        "name": "OBSTACLE"
+        "name": "player"
       },
       {
         "index": 4,
-        "name": "FLOOR"
+        "name": "prop"
       }
     ],
     "collisionMatrix": {
-      "0": 1,
+      "0": 25,
       "1": 30,
       "2": 30,
-      "3": 22,
-      "4": 14,
+      "3": 23,
+      "4": 15,
       "5": 32,
       "6": 64,
       "7": 128,

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů