future 1 ano atrás
pai
commit
7a17fa49c2

+ 1 - 0
assets/data/data.ts

@@ -532,6 +532,7 @@ export class event_stop_active_event_item extends base_event_item{ // 不激活
 }
 export class event_collect_event_item extends base_event_item{ // 收集多个事件完成
     public event_id_list:number[] = []
+    public is_alone:boolean = false; //是否单独一个
 }
 export class event_item_countdown_over extends base_event_item{ //倒计时结束
     public binding_widget_id:number = -1; //绑定某一个UI

+ 22 - 22
assets/edit_game.scene

@@ -116,8 +116,8 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 960.0000000000001,
-      "y": 960.0000000000002,
+      "x": 960,
+      "y": 960,
       "z": 0
     },
     "_lrot": {
@@ -206,8 +206,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920.0000000000002,
-      "height": 1920.0000000000002
+      "width": 1920,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -344,7 +344,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 960.0000000000001,
+    "_orthoHeight": 960,
     "_near": 0,
     "_far": 1000,
     "_color": {
@@ -533,8 +533,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 840.0000000000001,
-      "height": 1920.0000000000002
+      "width": 840,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -7333,7 +7333,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": -510.0000000000001,
+      "y": -510,
       "z": 0
     },
     "_lrot": {
@@ -7390,7 +7390,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 420.00000000000006,
+      "x": 420,
       "y": 0,
       "z": 0
     },
@@ -7790,7 +7790,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 800.0000000000001,
+      "width": 800,
       "height": 860
     },
     "_anchorPoint": {
@@ -7908,7 +7908,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -285.00000000000006,
+      "x": -285,
       "y": -105,
       "z": 0
     },
@@ -8191,7 +8191,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 800.0000000000001,
+      "width": 800,
       "height": 210
     },
     "_anchorPoint": {
@@ -8275,7 +8275,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 840.0000000000001,
+      "width": 840,
       "height": 900
     },
     "_anchorPoint": {
@@ -19656,8 +19656,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 840.0000000000001,
-      "height": 1920.0000000000002
+      "width": 840,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -21551,7 +21551,7 @@
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 750.133,
+      "x": 750.1330000000002,
       "y": 0,
       "z": 0
     },
@@ -180365,8 +180365,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 419.9999999999999,
-      "height": 1870.0000000000002
+      "width": 419.9999999999998,
+      "height": 1870
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -180590,8 +180590,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 419.9999999999999,
-      "height": 1920.0000000000002
+      "width": 419.9999999999998,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -183329,8 +183329,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920.0000000000002,
-      "height": 1920.0000000000002
+      "width": 1920,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

Diferenças do arquivo suprimidas por serem muito extensas
+ 758 - 98
assets/resources/prefab/edit_event.prefab


+ 15 - 1
assets/script/edit/event/event_collect_event.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
+import { _decorator, Component, instantiate, Node, Prefab, Toggle } from 'cc';
 import { event_collect_event_item, event_item } from '../../../data/data';
 import { Attributes } from '../Attributes';
 import { tools } from '../../tools';
@@ -10,9 +10,15 @@ const { ccclass, property } = _decorator;
 export class event_collect_event extends Component {
     private m_data:event_collect_event_item = null;
     @property(Node) btn_select_collect_event:Node = null;
+    @property(Node) alone_node:Node = null;
     @property(Node) content:Node = null;
     @property(Prefab) item_prefab:Prefab = null;
     private _self_event_id:number = 0;
+    protected start(): void {
+        this.alone_node.on(Toggle.EventType.TOGGLE, ()=> {
+            this.m_data.is_alone = this.alone_node.getComponent(Toggle).isChecked
+        })
+    }
     public initView(data:event_collect_event_item,self_event_id:number){
         this.m_data = data;
         this._self_event_id = self_event_id;
@@ -28,6 +34,14 @@ export class event_collect_event extends Component {
           
         })
         this.updateStatus()
+        this.updateAloneStatus()
+    }
+
+    updateAloneStatus() {
+        if(this.m_data.is_alone==undefined||this.m_data.is_alone==null) {
+            this.m_data.is_alone = false
+        }
+        this.alone_node.getComponent(Toggle).isChecked = this.m_data.is_alone
     }
 
     updateStatus(){

+ 53 - 20
assets/script/run/TaskSchedule/taskServce.ts

@@ -16,6 +16,7 @@ export class taskServce {
     private static finishZhaoXiJie:Map<number,boolean> = new Map;
     private static finishDaGuai:Map<number,boolean> = new Map;
     private static cur_collect_event:event_item = null;
+    private static cur_only_collect_event:event_item = null;
     public static guo_ju_qing_binding_event_id:number = -1;
     private static isFinishZhaoXiJieTask:boolean = false;
     private static finishZhaoXiJieLastEventId:number = -1;
@@ -58,6 +59,7 @@ export class taskServce {
         taskServce.finishDaGuai.clear()
         taskServce.finishZhaoXiJie.clear();
         taskServce.cur_collect_event = null;
+        taskServce.cur_only_collect_event = null;
         taskServce.guo_ju_qing_binding_event_id = -1;
         taskServce.isFinishZhaoXiJieTask = false;
         taskServce.finishZhaoXiJieLastEventId = -1;
@@ -163,14 +165,34 @@ export class taskServce {
                 ClientEvent.dispatchEvent(config.EventRun.NOTICE_EVENT,event.event_item_show_question_select_data.binding_widget_id,event)
             break;
             case config.event_type.collect_event:
-                taskServce.cur_collect_event = new event_item;
-                taskServce.cur_collect_event.event_id = event.event_id;
-                taskServce.cur_collect_event.type = event.type;
-                taskServce.cur_collect_event.event_item_collect_event_data = new event_collect_event_item
-                for (let index = 0; index < event.event_item_collect_event_data.event_id_list.length; index++) {
-                    const element = event.event_item_collect_event_data.event_id_list[index];
-                    taskServce.cur_collect_event.event_item_collect_event_data.event_id_list.push(element)
+                let event_id_list = event.event_item_collect_event_data.event_id_list
+                let is_alone = event.event_item_collect_event_data.is_alone
+                if(is_alone==undefined||is_alone==null) {
+                    is_alone =false
                 }
+                if(is_alone) {
+                    taskServce.cur_only_collect_event = new event_item;
+                    taskServce.cur_only_collect_event.event_id = event.event_id;
+                    taskServce.cur_only_collect_event.type = event.type;
+                    taskServce.cur_only_collect_event.event_item_collect_event_data = new event_collect_event_item
+                    for (let index = 0; index < event_id_list.length; index++) {
+                        const element = event_id_list[index];
+                        taskServce.cur_only_collect_event.event_item_collect_event_data.event_id_list.push(element)
+                    }
+                    // console.log('唯一 收集事件:',taskServce.cur_only_collect_event.event_item_collect_event_data.event_id_list)
+                } else {
+                    taskServce.cur_collect_event = new event_item;
+                    taskServce.cur_collect_event.event_id = event.event_id;
+                    taskServce.cur_collect_event.type = event.type;
+                    taskServce.cur_collect_event.event_item_collect_event_data = new event_collect_event_item
+                    for (let index = 0; index < event_id_list.length; index++) {
+                        const element = event_id_list[index];
+                        taskServce.cur_collect_event.event_item_collect_event_data.event_id_list.push(element)
+                    }
+                    // console.log('普通 收集事件:',taskServce.cur_collect_event.event_item_collect_event_data.event_id_list)
+                }
+
+                // 之前的
                 // console.log("collect_event--",taskServce.cur_collect_event)
                 // for (let index = 0; index < taskServce.cur_collect_event.event_item_collect_event_data.event_id_list.length; index++) {
                 //     const element = taskServce.cur_collect_event.event_item_collect_event_data.event_id_list[index];
@@ -338,22 +360,33 @@ export class taskServce {
             return
         }
         let event = this.exeWidgeTaskDic.get(widget_id)
-        if(taskServce.cur_collect_event!=null){
-            if(event!=null){
-                let e_index = taskServce.cur_collect_event.event_item_collect_event_data.event_id_list.indexOf(event.event_id)
-                if(e_index!=-1){
-                    taskServce.cur_collect_event.event_item_collect_event_data.event_id_list.splice(e_index,1)
+        if(taskServce.cur_only_collect_event!=null && event!=null) {
+            let e_index = taskServce.cur_only_collect_event.event_item_collect_event_data.event_id_list.indexOf(event.event_id)
+            if(e_index!=-1){
+                taskServce.cur_only_collect_event.event_item_collect_event_data.event_id_list.splice(e_index,1)
+            }
+            if(taskServce.cur_only_collect_event.event_item_collect_event_data.event_id_list.length<=0){
+                ClientEvent.dispatchEvent(config.EventRun.ON_WIDGET_FINISH_COLLECT_EVENT,taskServce.cur_only_collect_event.event_id)
+                let collect_event = taskServce.getEventById(taskServce.cur_only_collect_event.event_id)
+                if(collect_event.success.trigger_event_id!=-1){
+                    taskServce.exeNextDelayEvent(collect_event)
                 }
-                if(taskServce.cur_collect_event.event_item_collect_event_data.event_id_list.length<=0){
-                    ClientEvent.dispatchEvent(config.EventRun.ON_WIDGET_FINISH_COLLECT_EVENT,taskServce.cur_collect_event.event_id)
-                    let collect_event = taskServce.getEventById(taskServce.cur_collect_event.event_id)
-                    if(collect_event.success.trigger_event_id!=-1){
-                        taskServce.extEventByEventId(collect_event.success.trigger_event_id)
-                    }
-                    console.log("ON_WIDGET_FINISH_COLLECT_EVENT event",collect_event)
+                console.log("唯一 ON_WIDGET_FINISH_COLLECT_EVENT event",collect_event)
+            }
+        }
+        if(taskServce.cur_collect_event!=null && event!=null){
+            let e_index = taskServce.cur_collect_event.event_item_collect_event_data.event_id_list.indexOf(event.event_id)
+            if(e_index!=-1){
+                taskServce.cur_collect_event.event_item_collect_event_data.event_id_list.splice(e_index,1)
+            }
+            if(taskServce.cur_collect_event.event_item_collect_event_data.event_id_list.length<=0){
+                ClientEvent.dispatchEvent(config.EventRun.ON_WIDGET_FINISH_COLLECT_EVENT,taskServce.cur_collect_event.event_id)
+                let collect_event = taskServce.getEventById(taskServce.cur_collect_event.event_id)
+                if(collect_event.success.trigger_event_id!=-1){
+                    taskServce.extEventByEventId(collect_event.success.trigger_event_id)
                 }
+                console.log("普通 ON_WIDGET_FINISH_COLLECT_EVENT event",collect_event)
             }
-            // console.log("event", taskServce.cur_collect_event.event_item_collect_event_data.event_id_list)
         }
 
         let id =  taskServce.exeNextEvent(event)

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff