future 1 ano atrás
pai
commit
a308589b79

+ 2 - 2
assets/data/data.ts

@@ -357,7 +357,7 @@ export class event_item{
     public event_item_play_ani_data:event_item_play_ani = null; //播放动画
     public event_item_top_view_data:event_item_top_view = null; //弹窗
     public event_item_text_sound_data:event_item_text_sound = null; //出现文字及语音
-    public event_item_change_one_item_status_data:event_item_change_one_item_status = null; //改变指定道具状态
+    public event_item_change_one_item_status_data:event_item_change_one_item_status = null; //改变指定道具资源
     public event_item_show_new_item_data:event_item_show_new_item = null; //出现新道具
     public event_item_hide_data:event_item_hide = null; //隐藏某个道具
     public event_item_delay_exe_data:event_item_delay_exe_event = null; //延迟执行一个事件
@@ -428,7 +428,7 @@ export class event_item_top_view extends base_event_item{ // 弹窗
 export class event_item_text_sound extends base_event_item{ //出现文字及语音
     public binding_widget_id:number = -1; //绑定某一个UI
 }
-export class event_item_change_one_item_status extends base_event_item{ //改变指定道具状态
+export class event_item_change_one_item_status extends base_event_item{ //改变指定道具资源
     public binding_widget_id:number = -1; //绑定某一个UI
     public att:ui_att_item = new ui_att_item;
 }

+ 2 - 2
assets/resources/prefab/add_task_item.prefab

@@ -136,7 +136,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
+      "width": 1919.9999999999998,
       "height": 100
     },
     "_anchorPoint": {
@@ -258,7 +258,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
+      "width": 1919.9999999999998,
       "height": 100
     },
     "_anchorPoint": {

+ 6 - 6
assets/resources/prefab/edit_event.prefab

@@ -6088,7 +6088,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 0,
+      "y": -150,
       "z": 0
     },
     "_lrot": {
@@ -6562,8 +6562,8 @@
     },
     "_alignFlags": 40,
     "_target": null,
-    "_left": 480,
-    "_right": 480,
+    "_left": -30,
+    "_right": -30,
     "_top": 0,
     "_bottom": 0,
     "_horizontalCenter": 0,
@@ -7295,7 +7295,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
+      "width": 900,
       "height": 300
     },
     "_anchorPoint": {
@@ -26217,8 +26217,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1919.9999999999998,
-      "height": 1919.9999999999998
+      "width": 1920,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 3 - 3
assets/script/config.ts

@@ -6,7 +6,7 @@ const { ccclass, property } = _decorator;
 export class config {
     static debug = true;
     static domain = "https://zcapi.xwrun.com";
-    static is_MAC_edit = false; //目前临时处理
+    static is_MAC_edit = true; //目前临时处理
     static select_res_and_control_type = {
         RES_TYPE:0,
         CONTROL_TYPE:1,
@@ -72,7 +72,7 @@ export class config {
         config.event_type_map.set(config.event_type.play_ani,"播放动画")
         config.event_type_map.set(config.event_type.top_view,"弹窗")
         config.event_type_map.set(config.event_type.text_sound,"出现文字及语音")
-        config.event_type_map.set(config.event_type.change_one_item_status,"改变指定道具状态")
+        config.event_type_map.set(config.event_type.change_one_item_status,"改变指定道具资源")
         config.event_type_map.set(config.event_type.show_new_item,"出现新道具")
         config.event_type_map.set(config.event_type.show_question_select,"出现问题选择")
         config.event_type_map.set(config.event_type.countdown_over,"倒计时结束")
@@ -215,7 +215,7 @@ export class config {
         play_ani:0,//播放动画
         top_view:1,//弹窗
         text_sound:2,//出现文字及语音
-        change_one_item_status:3,//改变指定道具状态
+        change_one_item_status:3,//改变指定道具资源
         show_new_item:4,//出现新道具
         show_question_select:5,//出现问题选择
         start_event:6, //开始事件

+ 0 - 1
assets/script/edit/animation/new_frame.ts

@@ -171,7 +171,6 @@ export class new_frame extends Component {
     }
 
     public show_edit(item:frame_item,up_frame:ani_frame=null){
-        console.log("show_edit show_edit show_edit show_edit show_edit")
         this.m_up_frame = up_frame;
         this.node.active = true;
         this.m_data = item.getData();

+ 22 - 1
assets/script/edit/event/event_change_one_item_status.ts

@@ -1,5 +1,5 @@
 import { _decorator, assetManager, Component, ImageAsset, Label, Node, Rect, Sprite, SpriteFrame, Texture2D, UITransform, Vec2 } from 'cc';
-import { attributes_data, event_item_change_one_item_status, widget_item_data } from '../../../data/data';
+import { attributes_data, bag_item_data, event_item_change_one_item_status, widget_item_data } from '../../../data/data';
 import { ClientEvent } from '../../clientEvent';
 import { config } from '../../config';
 import { base_res } from '../base_res';
@@ -17,6 +17,27 @@ export class event_change_one_item_status extends Component {
     @property(Node) lab_res_name:Node = null;
     @property(Node) rect_res:Node = null;
     @property(Node) res_sf:Node = null;
+    protected start(): void {
+        this.res_sf.on(Node.EventType.TOUCH_END, ()=> {
+            tools.select_res_list((data:bag_item_data)=> {
+                // console.log('data=',data)
+                this.m_data.att.res = data.url
+                this.m_data.att.res_name = data.name
+                if(data.url.length>0) {
+                    assetManager.loadRemote<ImageAsset>(this.m_data.att.res, (err, imageAsset2)=>{
+                        if (!err && imageAsset2) {        
+                            const texture = new Texture2D();
+                            texture.image = imageAsset2;
+                            let spFrame2 = new SpriteFrame();     
+                            spFrame2.texture = texture;
+                            this.res_sf.getComponent(Sprite).spriteFrame = spFrame2
+                        }
+                    }); 
+                }
+                this.lab_res_name.getComponent(Label).string = this.m_data.att.res_name
+            })
+        },this)
+    }
     public initView(data:event_item_change_one_item_status){
         this.m_data = data;
         this.btn_select_widget.on(Node.EventType.TOUCH_END,()=>{

+ 1 - 0
assets/script/run/gameManager.ts

@@ -55,6 +55,7 @@ export class gameManager extends Component {
                     // console.log("run_get:",_data.content.length)
                     for (let index = 0; index < _data.content.length; index++) {
                         const url:string = _data.content[index];
+                        console.log('url=',url)
                         let hz = url.substring(url.length-3,url.length);
         
                         if(hz==="png"||hz==="jpg"){

+ 2 - 2
assets/script/run/scene_page.ts

@@ -44,7 +44,7 @@ export class scene_page extends Component {
         }
 
         this.mAnimationList = this.mSceneAtt.animation_list;
-        console.log(" this.mAnimationList", this.mAnimationList)
+        console.log("scene_page this.mAnimationList", this.mAnimationList)
         if(this.mIsMask){
             this.maskView.active = true;
         }else{
@@ -82,7 +82,7 @@ export class scene_page extends Component {
         if(item){
             item.getComponent(widget_base).beActive(widgetId,event)
         }
-        console.log("event.type",event.type)
+        console.log("scene_page event.type",event.type)
         if(event.type===config.event_type.scene_ani){
 
             let ani_id = event.event_item_scene_ani.ani_id;