future 1 жил өмнө
parent
commit
7e61088de5

BIN
assets/run/img_game_health_advise.png


+ 134 - 0
assets/run/img_game_health_advise.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.26",
+  "importer": "image",
+  "imported": true,
+  "uuid": "354290d8-788c-4a4b-ab96-5d5c58d4e3f1",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "354290d8-788c-4a4b-ab96-5d5c58d4e3f1@6c48a",
+      "displayName": "img_game_health_advise",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "354290d8-788c-4a4b-ab96-5d5c58d4e3f1",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "354290d8-788c-4a4b-ab96-5d5c58d4e3f1@f9941",
+      "displayName": "img_game_health_advise",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimType": "auto",
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 1080,
+        "height": 1920,
+        "rawWidth": 1080,
+        "rawHeight": 1920,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -540,
+            -960,
+            0,
+            540,
+            -960,
+            0,
+            -540,
+            960,
+            0,
+            540,
+            960,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            1920,
+            1080,
+            1920,
+            0,
+            0,
+            1080,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -540,
+            -960,
+            0
+          ],
+          "maxPos": [
+            540,
+            960,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "354290d8-788c-4a4b-ab96-5d5c58d4e3f1@6c48a",
+        "atlasUuid": ""
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": false,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "354290d8-788c-4a4b-ab96-5d5c58d4e3f1@f9941"
+  }
+}

BIN
assets/run/img_text_sound_bg.png


+ 33 - 33
assets/run/img_text_sound_bg.png.meta

@@ -42,12 +42,12 @@
         "trimType": "auto",
         "trimThreshold": 1,
         "rotated": false,
-        "offsetX": 0,
+        "offsetX": -1,
         "offsetY": 0,
-        "trimX": 0,
-        "trimY": 0,
-        "width": 1062,
-        "height": 279,
+        "trimX": 11,
+        "trimY": 13,
+        "width": 1038,
+        "height": 253,
         "rawWidth": 1062,
         "rawHeight": 279,
         "borderTop": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "vertices": {
           "rawPosition": [
-            -531,
-            -139.5,
+            -519,
+            -126.5,
             0,
-            531,
-            -139.5,
+            519,
+            -126.5,
             0,
-            -531,
-            139.5,
+            -519,
+            126.5,
             0,
-            531,
-            139.5,
+            519,
+            126.5,
             0
           ],
           "indexes": [
@@ -83,33 +83,33 @@
             3
           ],
           "uv": [
-            0,
-            279,
-            1062,
-            279,
-            0,
-            0,
-            1062,
-            0
+            11,
+            266,
+            1049,
+            266,
+            11,
+            13,
+            1049,
+            13
           ],
           "nuv": [
-            0,
-            0,
-            1,
-            0,
-            0,
-            1,
-            1,
-            1
+            0.010357815442561206,
+            0.04659498207885305,
+            0.987758945386064,
+            0.04659498207885305,
+            0.010357815442561206,
+            0.953405017921147,
+            0.987758945386064,
+            0.953405017921147
           ],
           "minPos": [
-            -531,
-            -139.5,
+            -519,
+            -126.5,
             0
           ],
           "maxPos": [
-            531,
-            139.5,
+            519,
+            126.5,
             0
           ]
         },

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 499 - 174
assets/scene/game.scene


+ 1 - 1
assets/script/config.ts

@@ -3,7 +3,7 @@ import { scene_item_data, widget_item_data } from '../data/data';
 const { ccclass, property } = _decorator;
 
 export class config {
-    static debug = true;
+    static debug = false;
     static select_res_and_control_type = {
         RES_TYPE:0,
         CONTROL_TYPE:1,

+ 150 - 116
assets/script/http.ts

@@ -2,31 +2,32 @@ import { _decorator, Component, Node, sys } from 'cc';
 import { config } from './config';
 const { ccclass, property } = _decorator;
 @ccclass('http')
-export class http  {
-    public static domain  = config.debug ? "https://zcapi.xwrun.com" : "https://zcapi.hainanmlwl.com";
+export class http {
+    public static domain = config.debug ? "https://zcapi.xwrun.com" : "https://zcapi.hainanmlwl.com";
+    public static static_domain = config.debug ? "https://zcapi.xwrun.com" : "https://zaoca.oss-cn-beijing.aliyuncs.com"
     public static statistics_domain = config.debug ? "http://logads.xwrun.com" : "https://logads.hainanmlwl.com";
 
-    static post(url,data,call_back){
-         var xml =  new XMLHttpRequest()
-         xml.open('POST',http.domain+url)
-         xml.setRequestHeader('Content-Type','application/json');
-         xml.send(JSON.stringify(data));
-        var array:String[] = ['loadstart','abort', 'error', 'load', 'loadend', 'timeout'];
+    static post(url, data, call_back) {
+        var xml = new XMLHttpRequest()
+        xml.open('POST', http.domain + url)
+        xml.setRequestHeader('Content-Type', 'application/json');
+        xml.send(JSON.stringify(data));
+        var array: String[] = ['loadstart', 'abort', 'error', 'load', 'loadend', 'timeout'];
         array.forEach(function (eventName) {
             xml[('on' + eventName) as 'onloadstart' | 'onabort' | 'onerror' | 'onload' | 'onloadend' | 'ontimeout'] = function () {
-                var str =  '\nEvent : ' + eventName;
+                var str = '\nEvent : ' + eventName;
                 var lstr = ""
                 if (eventName === 'timeout') {
                     lstr += '(timeout)';
                 }
                 else if (eventName === 'loadend') {
                     lstr += '...loadend!';
-          
-                }else if (eventName === 'onerror') {
-    
+
+                } else if (eventName === 'onerror') {
+
                 }
-                console.log("str==",str)
-                console.log("lstr==",lstr)
+                console.log("str==", str)
+                console.log("lstr==", lstr)
             };
         });
 
@@ -35,136 +36,169 @@ export class http  {
             if (xml.readyState === 4 && xml.status >= 200) {
                 //label.string = handler(xml.responseText);
                 // console.log("xml.responseText==",xml.responseText)
-                call_back(null,xml.responseText);
+                call_back(null, xml.responseText);
             } else if (xml.status === 404) {
-                call_back('404 page not found!',null);
-                console.log("status ==",'404 page not found!')
+                call_back('404 page not found!', null);
+                console.log("status ==", '404 page not found!')
             } else if (xml.readyState === 3) {
-                call_back('Request dealing!',null);
-                console.log("status ==",'Request dealing!')
+                call_back('Request dealing!', null);
+                console.log("status ==", 'Request dealing!')
             } else if (xml.readyState === 2) {
-                call_back('Request received!',null);
+                call_back('Request received!', null);
                 console.log("status ==", 'Request received!')
             } else if (xml.readyState === 1) {
-                call_back('Server connection established! Request hasn\'t been received',null);
+                call_back('Server connection established! Request hasn\'t been received', null);
                 console.log("status ==", 'Server connection established! Request hasn\'t been received')
             } else if (xml.readyState === 0) {
-                call_back( 'Request hasn\'t been initiated!',null);
+                call_back('Request hasn\'t been initiated!', null);
                 console.log("status ==", 'Request hasn\'t been initiated!')
             }
         };
     }
 
 
-    public static getGameList(page:number,limit:number=6):string{
+    public static getGameList(page: number, limit: number = 6): string {
         return `/smistatic/levels/${limit}_${page}.json`
     }
 
-    public static get_dyopen_id():string{
+    public static get_dyopen_id(): string {
         return `/note/user/get_dyopen_id`
     }
 
-    public static get_login():string{
+    public static get_login(): string {
         return `/note/user/login`
     }
 
-    public static get_sys_config():string{
+    public static get_sys_config(): string {
         return `/smistatic/sys_config.json`
     }
 
-    public static get_level_info(id:number):string{
+    public static get_level_info(id: number): string {
         return `/smistatic/level_info/${id}.json`
     }
     //场景 scene 0=共用 1 = 场景1 2 = 场景2,
-    public static get_level_resource(id:number,scene:number):string{
+    public static get_level_resource(id: number, scene: number): string {
         return `/smistatic/resource/${id}_${scene}.json`
     }
 
-    public static get_test_user_list():string{
+    public static get_test_user_list(): string {
         return `/smistatic/user_test.json`
     }
 
-    public static sync_data(){
+    public static sync_data() {
         return `/note/user/sync_data`
     }
 
-    public static statistics_ads(){
-        return  `/smadspush`
+    public static statistics_ads() {
+        return `/smadspush`
     }
 
     public static user_unlock_number_status() {
         return `/note/user/unlock_number_status`
     }
 
-    public static run_get(url,call_back){
-        var xml =  new XMLHttpRequest()
-        xml.open('GET',http.domain+url)
-        xml.setRequestHeader('Content-Type','application/json');
+    public static run_get(url, call_back) {
+        var xml = new XMLHttpRequest()
+        xml.open('GET', http.domain + url)
+        xml.setRequestHeader('Content-Type', 'application/json');
+        xml.send();
+
+        var array: String[] = ['loadstart', 'abort', 'error', 'load', 'loadend', 'timeout'];
+        array.forEach(function (eventName) {
+            xml[('on' + eventName) as 'onloadstart' | 'onabort' | 'onerror' | 'onload' | 'onloadend' | 'ontimeout'] = function () {
+                //    var str =  '\nEvent : ' + eventName;
+                var lstr = ""
+                if (eventName === 'timeout') {
+                    lstr += '(timeout)';
+                }
+                else if (eventName === 'loadend') {
+                    lstr += '...loadend!';
+
+                } else if (eventName === 'onerror') {
+
+                }
+            };
+        });
+
+        // Special event
+        xml.onreadystatechange = function () {
+            if (xml.readyState === 4 && xml.status >= 200) {
+                call_back(null, xml.responseText);
+            } else if (xml.status === 404) {
+                call_back('404 page not found!', null);
+            }
+        };
+    }
+
+    public static run_get_static(url, call_back) {
+        var xml = new XMLHttpRequest()
+        xml.open('GET', http.static_domain + url)
+        xml.setRequestHeader('Content-Type', 'application/json');
         xml.send();
-   
-       var array:String[] = ['loadstart','abort', 'error', 'load', 'loadend', 'timeout'];
-       array.forEach(function (eventName) {
-           xml[('on' + eventName) as 'onloadstart' | 'onabort' | 'onerror' | 'onload' | 'onloadend' | 'ontimeout'] = function () {
-            //    var str =  '\nEvent : ' + eventName;
-               var lstr = ""
-               if (eventName === 'timeout') {
-                   lstr += '(timeout)';
-               }
-               else if (eventName === 'loadend') {
-                   lstr += '...loadend!';
-         
-               }else if (eventName === 'onerror') {
-   
-               }
-           };
-       });
-
-       // Special event
-       xml.onreadystatechange = function () {
-           if (xml.readyState === 4 && xml.status >= 200) {
-               call_back(null,xml.responseText);
-           } else if (xml.status === 404) {
-               call_back('404 page not found!',null);
-           }
-       };
-   }
-
-    public static run_post(url,data,call_back){
-        var xml =  new XMLHttpRequest()
-        xml.open('POST',http.domain+url)
-        xml.setRequestHeader('Content-Type','application/json');
-        xml.setRequestHeader('token',config.TOKEN);
+
+        var array: String[] = ['loadstart', 'abort', 'error', 'load', 'loadend', 'timeout'];
+        array.forEach(function (eventName) {
+            xml[('on' + eventName) as 'onloadstart' | 'onabort' | 'onerror' | 'onload' | 'onloadend' | 'ontimeout'] = function () {
+                //    var str =  '\nEvent : ' + eventName;
+                var lstr = ""
+                if (eventName === 'timeout') {
+                    lstr += '(timeout)';
+                }
+                else if (eventName === 'loadend') {
+                    lstr += '...loadend!';
+
+                } else if (eventName === 'onerror') {
+
+                }
+            };
+        });
+
+        // Special event
+        xml.onreadystatechange = function () {
+            if (xml.readyState === 4 && xml.status >= 200) {
+                call_back(null, xml.responseText);
+            } else if (xml.status === 404) {
+                call_back('404 page not found!', null);
+            }
+        };
+    }
+
+    public static run_post(url, data, call_back) {
+        var xml = new XMLHttpRequest()
+        xml.open('POST', http.domain + url)
+        xml.setRequestHeader('Content-Type', 'application/json');
+        xml.setRequestHeader('token', config.TOKEN);
         xml.send(JSON.stringify(data));
-   
-       var array:String[] = ['loadstart','abort', 'error', 'load', 'loadend', 'timeout'];
-       array.forEach(function (eventName) {
-           xml[('on' + eventName) as 'onloadstart' | 'onabort' | 'onerror' | 'onload' | 'onloadend' | 'ontimeout'] = function () {
-               var str =  '\nEvent : ' + eventName;
-               var lstr = ""
-               if (eventName === 'timeout') {
-                   lstr += '(timeout)';
-               }
-               else if (eventName === 'loadend') {
-                   lstr += '...loadend!';
-         
-               }else if (eventName === 'onerror') {
-   
-               }
-           };
-       });
-
-       // Special event
-       xml.onreadystatechange = function () {
-           if (xml.readyState === 4 && xml.status >= 200) {
-               call_back(null,xml.responseText);
-           } else if (xml.status === 404) {
-               call_back('404 page not found!',null);
-           } 
-       };
-   }
-
-    static statistics_post(url,data,call_back){
-        if(sys.platform==sys.Platform.BYTEDANCE_MINI_GAME){
+
+        var array: String[] = ['loadstart', 'abort', 'error', 'load', 'loadend', 'timeout'];
+        array.forEach(function (eventName) {
+            xml[('on' + eventName) as 'onloadstart' | 'onabort' | 'onerror' | 'onload' | 'onloadend' | 'ontimeout'] = function () {
+                var str = '\nEvent : ' + eventName;
+                var lstr = ""
+                if (eventName === 'timeout') {
+                    lstr += '(timeout)';
+                }
+                else if (eventName === 'loadend') {
+                    lstr += '...loadend!';
+
+                } else if (eventName === 'onerror') {
+
+                }
+            };
+        });
+
+        // Special event
+        xml.onreadystatechange = function () {
+            if (xml.readyState === 4 && xml.status >= 200) {
+                call_back(null, xml.responseText);
+            } else if (xml.status === 404) {
+                call_back('404 page not found!', null);
+            }
+        };
+    }
+
+    static statistics_post(url, data, call_back) {
+        if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
             const options = {
                 url: http.statistics_domain + url,
                 data: data,
@@ -177,40 +211,40 @@ export class http  {
             }
             // console.log('tt_options=',options)
 
-            let task = tt.request({ 
+            let task = tt.request({
                 ...options,
                 success(res) { //请求成功回调
                     console.log("请求成功", res.data);
-                    call_back(null,JSON.stringify(res.data));
+                    call_back(null, JSON.stringify(res.data));
                 },
                 fail(res) {//请求失败回调
                     console.log("请求失败", res);
-                    call_back( -1,null);
+                    call_back(-1, null);
                 },
-                complete(res){ //请求结束回调
-                    console.log("调用接口结束",res.data)
+                complete(res) { //请求结束回调
+                    console.log("调用接口结束", res.data)
                 }
             });
 
         } else {
-            var xml =  new XMLHttpRequest()
-            xml.open('POST',http.statistics_domain+url)
-            xml.setRequestHeader('Content-Type','application/json');
-            xml.setRequestHeader('token',config.TOKEN);
+            var xml = new XMLHttpRequest()
+            xml.open('POST', http.statistics_domain + url)
+            xml.setRequestHeader('Content-Type', 'application/json');
+            xml.setRequestHeader('token', config.TOKEN);
             xml.send(JSON.stringify(data));
 
-            var array:String[] = ['loadstart','abort', 'error', 'load', 'loadend', 'timeout'];
+            var array: String[] = ['loadstart', 'abort', 'error', 'load', 'loadend', 'timeout'];
             array.forEach(function (eventName) {
                 xml[('on' + eventName) as 'onloadstart' | 'onabort' | 'onerror' | 'onload' | 'onloadend' | 'ontimeout'] = function () {
-                    var str =  '\nEvent : ' + eventName;
+                    var str = '\nEvent : ' + eventName;
                     var lstr = ""
                     if (eventName === 'timeout') {
                         lstr += '(timeout)';
                     }
                     else if (eventName === 'loadend') {
-                        lstr += '...loadend!'; 
-                    }else if (eventName === 'onerror') {
-    
+                        lstr += '...loadend!';
+                    } else if (eventName === 'onerror') {
+
                     }
                 };
             });
@@ -219,10 +253,10 @@ export class http  {
             xml.onreadystatechange = function () {
                 // console.log('xml.readyState=',xml.readyState, 'xml.status=',xml.status, 'xml.responseText=',xml.responseText)
                 if (xml.readyState === 4 && xml.status >= 200) {
-                    call_back(null,xml.responseText);
+                    call_back(null, xml.responseText);
                 } else if (xml.status === 404) {
-                    call_back('404 page not found!',null);
-                } 
+                    call_back('404 page not found!', null);
+                }
             };
         }
 

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

@@ -0,0 +1,9 @@
+{
+  "ver": "1.2.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "270bccd8-9e19-4954-a35a-bebd94266773",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 21 - 0
assets/script/run/game_health_view/game_health_view.ts

@@ -0,0 +1,21 @@
+import { _decorator, Color, Component, Node, Sprite, UIOpacity} from 'cc';
+const { ccclass, property } = _decorator;
+
+@ccclass('game_health_view')
+export class game_health_view extends Component {
+    @property(Node) bg:Node;
+    public startShow(finish_call){
+        let opacity:number = 255
+        setTimeout(()=> {
+            this.schedule(()=> {
+                opacity-=12
+                this.bg.getComponent(UIOpacity).opacity = opacity
+                if(opacity<=0) {
+                    this.unscheduleAllCallbacks()
+                    finish_call()
+                }
+            },0.1)
+        },500)
+    }
+}
+

+ 9 - 0
assets/script/run/game_health_view/game_health_view.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "79057760-eb35-472c-a16e-c0014eca7884",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 12 - 1
assets/script/run/game_run.ts

@@ -11,6 +11,7 @@ import { game_list } from './game_list_view/game_list';
 import { check_open } from './check_open';
 import { unLock_view } from './unLock_view/unLock_view';
 import { SdkUtil } from '../sdkUtil';
+import { game_health_view } from './game_health_view/game_health_view';
 const { ccclass, property } = _decorator;
 
 @ccclass('game_run')
@@ -24,6 +25,7 @@ export class game_run extends Component {
     @property(Node) game_list:Node = null;
     @property(Node) login_view:Node = null;
     @property(Node) loading_view:Node = null;
+    @property(Node) game_health_view:Node = null;
     @property(Node) loading_level:Node = null;
     @property(Node) check_open:Node = null;
     @property(Node) unLock_view:Node = null;
@@ -56,10 +58,19 @@ export class game_run extends Component {
     }
 
     public runAll(){
-        this.loading_view.active = true;
+        this.game_health_view.active = true;
+        this.loading_view.active = false;
         this.login_view.active = false;
         this.game_list.active = false;
         this.mGameManger.initGR(this)
+        this.game_health_view.getComponent(game_health_view).startShow(()=> {
+            this.game_health_view.active = false;
+            this.showLoading()
+        })
+    }
+
+    public showLoading() {
+        this.loading_view.active = true;
         this.loading_view.getComponent(loading_view).startLoading(()=>{
             this.loading_view.active = false;
             this.showLogin()

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