소스 검색

举起道具

chelios 3 년 전
부모
커밋
0636f34a44

+ 27 - 32
assets/Script/game/element/JG0111_1.ts

@@ -3,14 +3,8 @@ import { AudioMgr } from "../../main/ViewManage";
 import BaseEvent from "../fight/evnet/base/BaseEvent";
 
 
-const SpineName = {
-    CLOSE: "close",
-    OPEN: "open"
-}
-
-
 /**
- * 多组按钮控制开门
+ * 多组按钮控制开门-解救宠物剧情
  */
 const { ccclass, property } = cc._decorator;
 
@@ -53,10 +47,14 @@ export default class JG0111_1 extends BaseEvent {
     })
     mFenceTrigger: Array<cc.Node> = [];
 
-    /**
-     * 是否选中
-     */
-    public isHang = false;
+    @property({
+        displayName: '困住的宠物',
+        type: cc.Node,
+    })
+    mPet: cc.Node = null;
+
+
+
     /**
      * 机关是否已经结束
      */
@@ -88,48 +86,35 @@ export default class JG0111_1 extends BaseEvent {
     }
 
     onBegin(tag: number) {
-        this.isHang = true;
         this.mIcon.spriteFrame = this.mIcon1;
         this.checkOpen();
     }
 
     onEnd(tag: number) {
-        // this.isHang = false
-        // this.mIcon.spriteFrame = this.mIcon0
-        // this.isOver = false;
-        // for (let i = 0; i < this.mFenceTrigger.length; i++) {
-        //     const element = this.mFenceTrigger[i];
-        //     // element.active = true;
-        //     this.showFence(element, SpineName.CLOSE);
-        //     element.getComponent(cc.PhysicsBoxCollider).enabled = true;
-        // }
     }
 
     private checkOpen() {
         if (this.isOver) {
             return
         }
-        //检查其它开关是否打开
-        for (let i = 0; i < this.mButtons.length; i++) {
-            const element = this.mButtons[i];
-            let fdb = element.getComponent(JG0111_1)
-            if (!fdb.isHang) return
-        }
         this.isOver = true;
         this.pause();
         this.moveCamera(this.mFenceTrigger[0].getPosition(), 1, () => {
             cc.tween(this.node).sequence(
                 cc.callFunc(() => {
-                    for (let i = 0; i < this.mFenceTrigger.length; i++) {
-                        const element = this.mFenceTrigger[i];
-                        element.active = false
-                        // this.showFence(element, SpineName.OPEN);
+                    this.showFence(this.mFenceTrigger[0], 'down');
+                    let nodes = this.mFenceTrigger[1].children
+                    for (let i = 0; i < nodes.length; i++) {
+                        const element = nodes[i];
+                        this.showFence(element, 'down');
                     }
                     this.ff.main.playerEffectByPath(AudioMgr.openDoor);
                 }),
                 cc.delayTime(1),
                 cc.callFunc(() => {
                     this.resume()
+                    this.mFenceTrigger[0].getComponent(cc.PhysicsBoxCollider).enabled = false;
+                   
                     // for (let i = 0; i < this.mFenceTrigger.length; i++) {
                     //     const element = this.mFenceTrigger[i];
                     //     // element.active = false;
@@ -137,7 +122,17 @@ export default class JG0111_1 extends BaseEvent {
                     // }
                 })
             ).start();
-
         })
     }
+
+    private showFence(element, action) {
+        let nodes = element.children;
+        for (let i = 0; i < nodes.length; i++) {
+            const element = nodes[i];
+            let spine:sp.Skeleton = element.getComponent(sp.Skeleton);
+            if (spine) {
+                spine.setAnimation(0, action, false);
+            }
+        }
+    }
 }

+ 30 - 0
assets/Script/game/element/JG0116.ts

@@ -0,0 +1,30 @@
+import BaseEvent from "../fight/evnet/base/BaseEvent";
+
+const {ccclass, property} = cc._decorator;
+/**
+ * 捡起物品,扔物品
+ */
+@ccclass
+export default class JG0116 extends BaseEvent {
+
+    @property({
+        displayName:'捡起图标',
+        type:cc.SpriteFrame
+    })
+    liftIcon: cc.SpriteFrame = null;
+
+    @property({
+        displayName:'扔出图标',
+        type:cc.SpriteFrame
+    })
+    throwIcon: cc.SpriteFrame = null;
+
+    
+    
+
+
+
+
+
+    
+}

+ 9 - 0
assets/Script/game/element/JG0116.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "6d91b210-120e-40f0-a1e4-4e8b05fcf077",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 21 - 2
assets/Script/game/fight/object/MSprite.ts

@@ -1,6 +1,5 @@
 
 import Joystick_mag, { SpeedType } from "../../../joystick/Joystick_mag";
-import Joystick from "../../../util/Joystick";
 import { FFAttr } from "../../data/FFCalAttr";
 import { __SkillData } from "../../data/sdata/SManage";
 import BObject from "../bullet/BObject";
@@ -35,7 +34,7 @@ export default class MSprite extends FSprite {
     /**
      * 移动速度
      */
-    private speedN = 120000;
+    private speedN = 80000;
 
     public start(){
         super.start()
@@ -287,6 +286,26 @@ export default class MSprite extends FSprite {
                 }
             }
         });
+    }
+    /**
+     * 临时捡起的东西
+     */
+    public tmpObject:cc.Node = null;
+    /**
+     * 角色举起物品
+     * @param object 
+     */
+    public liftObject(object:cc.Node){
+        
+    }
+    /**
+     * 将捡起来的东西扔出去
+     */
+    public throwObject(){
+
+
+
+
     }
 
 }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2787 - 2858
assets/resources/prefab/map/map2.prefab


+ 1 - 1
settings/project.json

@@ -83,7 +83,7 @@
     "width": 960,
     "height": 640
   },
-  "last-module-event-record-time": 1622533918222,
+  "last-module-event-record-time": 1625451440015,
   "assets-sort-type": "name",
   "facebook": {
     "appID": "",