future 1 жил өмнө
parent
commit
3207335c2a

+ 1 - 0
assets/data/data.ts

@@ -80,6 +80,7 @@ export class att_drag_data{
     public drag_size_height:number = 0;
     public drag_size_height:number = 0;
     public drag_pos_x:number = 0;
     public drag_pos_x:number = 0;
     public drag_pos_y:number = 0;
     public drag_pos_y:number = 0;
+    public z_index:number = 0; //层级(方便查看,和前台没关系)
     public other_event_id:number = -1; //其他拖拽的完成事件
     public other_event_id:number = -1; //其他拖拽的完成事件
     public is_err_drag_back:boolean = true; //拖拽错误是否回归原位
     public is_err_drag_back:boolean = true; //拖拽错误是否回归原位
     public other_drag_list:att_drag_data[] = [];
     public other_drag_list:att_drag_data[] = [];

+ 2 - 2
assets/edit_game.scene

@@ -344,7 +344,7 @@
     "_priority": 0,
     "_priority": 0,
     "_fov": 45,
     "_fov": 45,
     "_fovAxis": 0,
     "_fovAxis": 0,
-    "_orthoHeight": 960,
+    "_orthoHeight": 970.9983633387889,
     "_near": 0,
     "_near": 0,
     "_far": 1000,
     "_far": 1000,
     "_color": {
     "_color": {
@@ -38546,7 +38546,7 @@
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
       "x": 0,
       "x": 0,
-      "y": -1646.7000000000003,
+      "y": -1716.7000000000003,
       "z": 0
       "z": 0
     },
     },
     "_lrot": {
     "_lrot": {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 390 - 279
assets/resources/prefab/task/other_drag_list_item.prefab


+ 12 - 1
assets/script/edit/attributes/other_drag_list_item.ts

@@ -1,9 +1,10 @@
-import { _decorator, Component, EditBox, Label, Node, Toggle } from 'cc';
+import { _decorator, Component, EditBox, isDisplayStats, Label, Node, Sprite, Toggle } from 'cc';
 import { att_drag_data, event_item } from '../../../data/data';
 import { att_drag_data, event_item } from '../../../data/data';
 import { Attributes } from '../Attributes';
 import { Attributes } from '../Attributes';
 import { tools } from '../../tools';
 import { tools } from '../../tools';
 import { config } from '../../config';
 import { config } from '../../config';
 import { ClientEvent } from '../../clientEvent';
 import { ClientEvent } from '../../clientEvent';
+import { widget_item } from '../widget_item';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
 
 
 @ccclass('other_drag_list_item')
 @ccclass('other_drag_list_item')
@@ -17,6 +18,7 @@ export class other_drag_list_item extends Component {
     @property(Node) btn_delete:Node = null;
     @property(Node) btn_delete:Node = null;
     @property(EditBox) editBox_remark:EditBox = null;
     @property(EditBox) editBox_remark:EditBox = null;
     @property(Node) btn_is_show:Node = null;
     @property(Node) btn_is_show:Node = null;
+    @property(EditBox) editBox_z_index:EditBox = null;
     private m_data:att_drag_data = null;
     private m_data:att_drag_data = null;
     private delete_call = null;
     private delete_call = null;
     public initView(data:att_drag_data,call){
     public initView(data:att_drag_data,call){
@@ -49,6 +51,8 @@ export class other_drag_list_item extends Component {
             // console.log('this.m_data.is_show_inTheEditor=',this.m_data.is_show_inTheEditor)
             // console.log('this.m_data.is_show_inTheEditor=',this.m_data.is_show_inTheEditor)
             this.change()
             this.change()
         }, this)
         }, this)
+
+        this.editBox_z_index.node.on('editing-did-ended', this.change, this)
     }
     }
     change(){
     change(){
         this.m_data.drag_pos_x = parseInt(this.drag_x.string);
         this.m_data.drag_pos_x = parseInt(this.drag_x.string);
@@ -58,6 +62,8 @@ export class other_drag_list_item extends Component {
         this.m_data.drag_size_height = parseInt(this.drag_height.string);
         this.m_data.drag_size_height = parseInt(this.drag_height.string);
 
 
         this.m_data.remark = this.editBox_remark.string;
         this.m_data.remark = this.editBox_remark.string;
+
+        this.m_data.z_index = parseInt(this.editBox_z_index.string)
        
        
         ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView, Attributes.Singleton.get_cur_att_data(),config.attributes_list_type.drag)
         ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView, Attributes.Singleton.get_cur_att_data(),config.attributes_list_type.drag)
     }
     }
@@ -79,6 +85,11 @@ export class other_drag_list_item extends Component {
             data.is_show_inTheEditor = true
             data.is_show_inTheEditor = true
         }
         }
         this.btn_is_show.getComponent(Toggle).isChecked = data.is_show_inTheEditor
         this.btn_is_show.getComponent(Toggle).isChecked = data.is_show_inTheEditor
+
+        if(data.z_index==undefined) {
+            data.z_index = 0
+        }
+        this.editBox_z_index.string = data.z_index.toString()
     }
     }
 }
 }
 
 

+ 8 - 1
assets/script/edit/widget_item.ts

@@ -9,7 +9,6 @@ import { tools } from '../tools';
 import { Text_Sound } from './uiWidget/Text_Sound';
 import { Text_Sound } from './uiWidget/Text_Sound';
 import { question_select } from './uiWidget/question_select';
 import { question_select } from './uiWidget/question_select';
 import { count_down } from './uiWidget/count_down';
 import { count_down } from './uiWidget/count_down';
-import { Attributes } from './Attributes';
 const { ccclass, property } = _decorator;
 const { ccclass, property } = _decorator;
 
 
 @ccclass('widget_item')
 @ccclass('widget_item')
@@ -125,6 +124,7 @@ export class widget_item extends Component {
         if(this.m_att.drag_data.other_drag_list==undefined){
         if(this.m_att.drag_data.other_drag_list==undefined){
             this.m_att.drag_data.other_drag_list = []
             this.m_att.drag_data.other_drag_list = []
         }
         }
+        // 刷新 其他拖拽
         this.other_drag_content.removeAllChildren()
         this.other_drag_content.removeAllChildren()
         for (let index = 0; index < this.m_att.drag_data.other_drag_list.length; index++) {
         for (let index = 0; index < this.m_att.drag_data.other_drag_list.length; index++) {
             const element:att_drag_data =  this.m_att.drag_data.other_drag_list[index];
             const element:att_drag_data =  this.m_att.drag_data.other_drag_list[index];
@@ -132,6 +132,10 @@ export class widget_item extends Component {
             item.off(Node.EventType.TOUCH_MOVE)
             item.off(Node.EventType.TOUCH_MOVE)
             item.parent = this.other_drag_content;
             item.parent = this.other_drag_content;
             item.position = new Vec3(element.drag_pos_x,element.drag_pos_y)
             item.position = new Vec3(element.drag_pos_x,element.drag_pos_y)
+            if(element.z_index==undefined) {
+                element.z_index=0
+            } 
+            item.setSiblingIndex(element.z_index)
             item.getComponent(UITransform).setContentSize(new Size(element.drag_size_width,element.drag_size_height))
             item.getComponent(UITransform).setContentSize(new Size(element.drag_size_width,element.drag_size_height))
             item.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
             item.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
                 let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
                 let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
@@ -425,6 +429,7 @@ export class widget_item extends Component {
                         if(this.m_att.drag_data.other_drag_list==undefined){
                         if(this.m_att.drag_data.other_drag_list==undefined){
                             this.m_att.drag_data.other_drag_list = []
                             this.m_att.drag_data.other_drag_list = []
                         }
                         }
+                        // 更新 其他拖拽
                         this.other_drag_content.removeAllChildren()
                         this.other_drag_content.removeAllChildren()
                         for (let index = 0; index < this.m_att.drag_data.other_drag_list.length; index++) {
                         for (let index = 0; index < this.m_att.drag_data.other_drag_list.length; index++) {
                             const element =  this.m_att.drag_data.other_drag_list[index];
                             const element =  this.m_att.drag_data.other_drag_list[index];
@@ -433,6 +438,8 @@ export class widget_item extends Component {
                             item.parent = this.other_drag_content;
                             item.parent = this.other_drag_content;
                             item.position = new Vec3(element.drag_pos_x,element.drag_pos_y)
                             item.position = new Vec3(element.drag_pos_x,element.drag_pos_y)
                             item.getComponent(UITransform).setContentSize(new Size(element.drag_size_width,element.drag_size_height))
                             item.getComponent(UITransform).setContentSize(new Size(element.drag_size_width,element.drag_size_height))
+                            if(element.z_index==undefined) { element.z_index=0 }
+                            item.setSiblingIndex(element.z_index)
                             item.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
                             item.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
                                 let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
                                 let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
                                 let n_p = this.node.getComponent(UITransform).convertToNodeSpaceAR(p)
                                 let n_p = this.node.getComponent(UITransform).convertToNodeSpaceAR(p)

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно