xx 1 年之前
父節點
當前提交
bc77bec90b

+ 1 - 1
assets/resources/prefab/run/game_run.prefab

@@ -7162,7 +7162,7 @@
     "node": {
       "__id__": 312
     },
-    "_enabled": true,
+    "_enabled": false,
     "__prefab": {
       "__id__": 322
     },

+ 14 - 14
assets/resources/prefab/run/scene_page.prefab

@@ -165,8 +165,8 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
+      "x": -959.9999999999999,
+      "y": -959.9999999999999,
       "z": 0
     },
     "_lrot": {
@@ -221,8 +221,8 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -960,
-      "y": -540,
+      "x": -959.9999999999999,
+      "y": -959.9999999999999,
       "z": 0
     },
     "_lrot": {
@@ -262,8 +262,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
-      "height": 1080
+      "width": 1919.9999999999998,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -402,13 +402,13 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
-      "height": 1080
+      "width": 1919.9999999999998,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
+      "x": 0,
+      "y": 0
     },
     "_id": ""
   },
@@ -758,8 +758,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
-      "height": 1080
+      "width": 1919.9999999999998,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -908,8 +908,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
-      "height": 1080
+      "width": 1919.9999999999998,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 10 - 1
assets/script/run/bag/dai_dao_ju_bag.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, instantiate, Node, Prefab, Rect, Size, Sprite, UITransform, Vec2, Vec3 } from 'cc';
+import { _decorator, Component, instantiate, Node, Prefab, Rect, ScrollView, Size, Sprite, UITransform, Vec2, Vec3 } from 'cc';
 import { dai_dao_ju_item, event_item, guo_ju_qing_dai_dao_ju, widget_item_data } from '../../../data/data';
 import { widget_base } from '../widget/widget_base';
 import { gameManager } from '../gameManager';
@@ -23,6 +23,7 @@ export class dai_dao_ju_bag extends Component {
     private cur_select_item:bag_drag_item = null;
     private mWidgetList:Map<number,bag_drag_item> = new Map;
     private mData:guo_ju_qing_dai_dao_ju = null;
+    private mScrollView:Node = null;
     public initView(data:guo_ju_qing_dai_dao_ju,tip_call,add_time_call){
         this.content.removeAllChildren()
         this.mWidgetList.clear()
@@ -88,6 +89,14 @@ export class dai_dao_ju_bag extends Component {
                 this.widget_info.show(this.cur_select_item.getData().info_res)
             }
         })
+        this.mScrollView = gameManager.Singleton.getCurSceneLayerPage().getBG()
+        this.action_node.position
+    }
+
+    protected update(dt: number): void {
+        if(this.mScrollView!=null){
+            this.action_node.position =  this.mScrollView.position;
+        }
     }
 
 

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

@@ -581,6 +581,10 @@ export class gameManager extends Component {
             call()
         }
     }
+
+    public getCurSceneLayerPage(){
+        return this.mGameRun.getCurSceneLayerPage()
+    }
 }
 
 

+ 5 - 0
assets/script/run/game_run.ts

@@ -10,6 +10,7 @@ import { loading_view } from './loading_view/loading_view';
 import { login_view } from './login_view/login_view';
 import { game_list } from './game_list_view/game_list';
 import { check_open } from './check_open';
+import { scene_page } from './scene_page';
 const { ccclass, property } = _decorator;
 
 @ccclass('game_run')
@@ -93,6 +94,10 @@ export class game_run extends Component {
         this.scene_layer.getComponent(scene_layer).initScene(pages,type)
     }
 
+    public getCurSceneLayerPage():scene_page{
+        return this.scene_layer.getComponent(scene_layer).getCurScenePage()
+    }
+
     public loadUILayer(ui_widge_list:widget_item_data[]){
         this.ui_layer.getComponent(ui_layer).initUi(ui_widge_list)
         this.initTop()

+ 9 - 0
assets/script/run/lib.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.2.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "d89b1952-912c-480b-a642-9e4bee841387",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 9 - 0
assets/script/run/lib/Coroutine.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "01acecce-ded3-434e-9457-05383e6ed68f",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 5 - 1
assets/script/run/scene_page.ts

@@ -44,7 +44,7 @@ export class scene_page extends Component {
         }else{
             this.content.getComponent(Widget).enabled = false;
         }
-
+        this.content.position = Vec3.ZERO;
         this.mAnimationList = this.mSceneAtt.animation_list;
         console.log("scene_page this.mAnimationList", this.mAnimationList)
         if(this.mIsMask){
@@ -250,6 +250,10 @@ export class scene_page extends Component {
         }
     }
 
+    public getBG(){
+        return this.content;
+    }
+
     public initBG(){
         if(this.mSceneAtt.src.length>0){
             tools.loadUrl(this.mSceneAtt.src,this.content.getComponent(Sprite))