薛鸿潇 5 лет назад
Родитель
Сommit
e54866e9bb

+ 12 - 0
mk_framework/assets/MKLib.meta

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.2",
+  "uuid": "cf93c8ed-f08b-4713-8125-e3c5f8841f64",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

+ 12 - 0
mk_framework/assets/MKLib/manager.meta

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.2",
+  "uuid": "566918b2-4065-416a-8466-62af26ceccb6",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

+ 90 - 0
mk_framework/assets/MKLib/manager/EventMgr.ts

@@ -0,0 +1,90 @@
+
+/*============================================================================================================*/
+/**
+ * 事件管理
+ */
+/*============================================================================================================*/
+export class EventMgr {
+
+    private _event_target = new cc.EventTarget();
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public on(event_type, event_callback, event_target) {
+        this._event_target && this._event_target.on(event_type, event_callback, event_target);
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public off(event_type, event_callback, event_target) {
+        if (!event_type || !event_callback || !event_target) {
+            cc.warn('Event method off error. check your params...');
+        }
+        this._event_target && this._event_target.off(event_type, event_callback, event_target);
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public offTypeEvent(event_type) {
+        this._event_target && this._event_target.off(event_type);
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public offTargetEvent(event_target) {
+        this._event_target && this._event_target.targetOff(event_target);
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public once(event_type, event_callback, event_target) {
+        this._event_target && this._event_target.once(event_type, event_callback, event_target);
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public emit(event_type, p1?, p2?, p3?, p4?, p5?) {
+        this._event_target && this._event_target.emit(event_type, p1, p2, p3, p4, p5);
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public emitEvent(event_type, user_obj) {
+        // let event = new Event.EventCustom(event_type);
+        // event.setUserData(user_obj);
+        // this._event_target && this._event_target.dispatchEvent(event);
+    }
+    /** 按钮事件接口 
+     * - comp_btn:按钮组件
+     * - func:事件函数
+     * - target:指定脚本
+     * - btn_data:按钮传递的参数
+     * - need_sound:是否需要音效
+    */
+    public addClickEvent(comp_btn: cc.Button, func: Function, target: any, btn_data?, need_sound = true) {
+        if (!comp_btn) {
+            cc.log(target + '的btn是空的');
+            return;
+        }
+        comp_btn.node.on('click', func.bind(target, comp_btn, btn_data), target);
+        // need_sound && comp_btn.node.on('click', func, target);// 按钮音效
+    }
+};
+// declare global {
+//     const XXEvent: XXEvent;
+// }
+// window['XXEvent'] = new XXEvent();

+ 9 - 0
mk_framework/assets/MKLib/manager/EventMgr.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "fd16fa51-13af-4fcc-b3a7-6f30fb8f2752",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 254 - 0
mk_framework/assets/MKLib/manager/LoaderMgr.ts

@@ -0,0 +1,254 @@
+/*============================================================================================================*/
+/**
+ * @description 资源加载
+ */
+/*============================================================================================================*/
+// import { loader, error, JsonAsset, log, sys, SpriteAtlas, SpriteFrame } from 'cc';
+
+// window.xx = window.xx || {};
+// export class LoaderMgr {
+export class LoaderMgr {
+    // xx.Loader = {
+    private _profile_res = {};
+    private _bundle = null;
+    // todo 根据场景来清除资源缓存(什么场景加载的资源就保存到什么场景资源配置上。
+    //  可能存在的问题:两个场景公用的资源可能会被释放,之后重新加载,可能会有问题
+    //  )
+    public SetBundle(bundle) {
+        bundle && (this._bundle = bundle);
+    }
+
+    public GetBundle() {
+        return this._bundle || cc.resources;
+    }
+    /*============================================================================================================*/
+    /**
+     * 异步加载资源
+     */
+    /*============================================================================================================*/
+    public LoadAsset(relative_path: string, complete_callback) {
+        let loader = this.GetBundle();
+        loader.load(relative_path, (error, asset) => {
+            if (error) {
+                error('xx.LoadAsset failed ... and path = ' + relative_path, '===error:', JSON.stringify(error));
+                return;
+            } else {
+                complete_callback && complete_callback(asset);
+            }
+        });
+    }
+
+    /*============================================================================================================*/
+    /**
+     * 根据类型异步加载
+     */
+    /*============================================================================================================*/
+    public LoadAssetByType(relative_path: string, asset_type, complete_callback?: Function) {
+        return new Promise((resolve: (data) => void, reject) => {
+            this.GetBundle().load(relative_path, asset_type, (error, asset) => {
+                if (error) {
+                    error('xx.LoadAssetByType failed ... and path = ' + relative_path, '==error:', JSON.stringify(error));
+                    reject();
+                    return;
+                } else {
+                    complete_callback && complete_callback(asset);
+                    resolve(asset);
+                }
+            });
+        });
+    }
+
+    /*============================================================================================================*/
+    /**
+     * 递归获取resource路径下资源地址数组
+     * @param type 资源类型,如果为空,则返回所有类型文件地址
+     */
+    /*============================================================================================================*/
+    public GetDirUrlsRecursion(path, type) {
+        let urls = [];
+        this.GetBundle().getDirWithPath(path, type, urls);
+        let arr_path = [];
+        for (let i = 0; i < urls.length; i++) {
+            const element = urls[i].path;
+            arr_path.push(element);
+        }
+        return arr_path;
+    }
+
+    /*============================================================================================================*/
+    /**
+     * 通过config构造uuid数组加载
+     */
+    /*============================================================================================================*/
+    public LoadByConfigUseUuids(assets_config, progress_callback, complete_callback) {
+        // let uuids = [];
+        // let urls = [];
+        // let len = assets_config.length;
+        // for (let i = 0; i < len; i++) {
+        //     let config = assets_config[i];
+        //     let path = config.path;
+        //     let type = config.type;
+        //     let _uuids = this.GetBundle().getDirWithPath(path, type, urls);
+        //     uuids = uuids.concat(_uuids);
+        // }
+
+        // if (uuids.length === 0) return;
+
+        // let DoWithAssetItemOnProgress = function (completed_count, total_count, item) {
+        //     let asset = item.content;
+        //     if (asset instanceof JsonAsset) {
+        //         xx.Dict.LoadByAsset(asset);
+        //     }
+        //     progress_callback && progress_callback(completed_count, total_count);
+        // };
+
+        // let DoWithAssetOnComplete = function (errors, res_assets, res_urls) {
+        //     complete_callback && complete_callback(errors, res_assets, res_urls);
+        // };
+
+        // loader._loadResUuids(uuids, DoWithAssetItemOnProgress, DoWithAssetOnComplete, urls);
+    }
+
+    public LoadAssetsByConfig(assets_config, progress_callback, complete_callback) {
+        let total_count = 0;
+        let complete_count = 0;
+        for (let i = 0; i < assets_config.length; i++) {
+            let config = assets_config[i];
+            let path = config.path;
+            let type = config.type;
+
+            let urls = [];
+            this.GetBundle().getDirWithPath(path, type, urls);
+            total_count += urls.length;
+            cc.log('预加载资源:%o', urls);
+            let callback = config.cb;
+            for (let i = 0; i < urls.length; i++) {
+                let path = urls[i].path;
+                this.GetBundle().load(path, type, function (err, spriteFrame) {
+                    if (err) {
+                        cc.error(err.message || err);
+                        return;
+                    }
+                    ++complete_count;
+                    progress_callback && progress_callback(complete_count, total_count, spriteFrame);
+                    callback && callback(spriteFrame);
+
+                    if (complete_count === total_count) {
+                        complete_callback && complete_callback();
+                    }
+                });
+            }
+        }
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public ReleaseResByPathAndType(path = '', type) {
+        if (!path || !type) return;
+
+        let urls = this.GetDirUrlsRecursion(path, type);
+        let len = urls.length;
+        for (let i = 0; i < len; ++i) {
+            let url = urls[i];
+            let atlas = this.GetBundle().getRes(url, type);
+            let deps = this.GetBundle().getDependsRecursively(atlas);
+            // assetManager.releaseAsset(deps);
+        }
+        cc.sys.garbageCollect();
+    }
+
+    /*============================================================================================================*/
+    /**
+     * 同步获取已经预加载的图集中的spriteframe 此接口进入游戏后生效
+     */
+    /*============================================================================================================*/
+    public GetSpriteFrameFromAtlas(sprite_frame_name, path = '/Atlas') {
+        let urls = this.GetDirUrlsRecursion(path, cc.SpriteAtlas);
+        let len = urls.length;
+        for (let i = 0; i < len; i++) {
+            let url = urls[i];
+            let atlas: any = this.GetBundle().getRes(url, cc.SpriteAtlas);//resources.get
+            if (atlas) {
+                let sf = atlas.getSpriteFrame(sprite_frame_name);
+                if (sf) return sf;
+            }
+        }
+    }
+
+    /*============================================================================================================*/
+    /**
+     * @description 获取散图资源(需要在loading的时候首先加载)
+     * @param {string} sprite_frame_path 资源相对于resource下的路径
+     */
+    /*============================================================================================================*/
+    public GetSpriteFrame(sprite_frame_path) {
+        let res = this.GetBundle().getRes(sprite_frame_path, cc.SpriteFrame);
+        return res;
+    }
+
+    /*============================================================================================================*/
+    /**
+     * SpriteFrame有一个_uuid的属性,根据uuid去loader里面查找路径加载路径
+     */
+    /*============================================================================================================*/
+    public ParseUuidToUrl(uuid) {
+        let path_to_uuid = this.GetBundle()._pathToUuid;
+        for (let key in path_to_uuid) {
+            let entrys = path_to_uuid[key];
+            if (entrys instanceof Array) {
+                for (let entry of entrys) {
+                    if (entry.uuid === uuid) {
+                        return key;
+                    }
+                }
+            } else {
+                if (entrys.uuid === uuid) {
+                    return key;
+                }
+            }
+        }
+        return '';
+    }
+
+    public LoadRemoteTexture(url, role_id, callback) {
+        if (this._profile_res[role_id]) {
+            let spf = this._profile_res[role_id];
+            callback && callback(role_id, spf);
+            return;
+        }
+        if (!url) return;
+
+        if (!cc.sys.isNative) return;
+
+        this.GetBundle().load({ url: url, type: 'png' }, (err, tex) => {
+            cc.log('===get_texture:', role_id);
+            if (err) {
+                cc.log('===err:', err);
+                return;
+            }
+            let spf = new tex();//SpriteFrame(tex)
+            this._profile_res[role_id] = spf;
+            callback && callback(role_id, spf);
+        });
+    }
+    /** 获取图片纹理 by 图集 
+     * - sprite_frame_name:要获取的纹理名字
+     * - arr_atlas:图集列表
+    */
+    public GetSpriteFrameByArrAlst(sprite_frame_name: string, arr_atlas: Array<cc.SpriteAtlas>): cc.SpriteFrame {
+        let count = arr_atlas.length;
+        for (let i = 0; i < count; i++) {
+            let _atlas = arr_atlas[i];
+            let spf = _atlas.getSpriteFrame(sprite_frame_name);
+            if (spf) return spf;
+        }
+        return null;
+    }
+};
+// declare global {
+//     const LoaderMgr: LoaderMgr;
+// }
+// // window['LoaderMgr'] = new LoaderMgr();
+// mk.loader = new LoaderMgr();

+ 9 - 0
mk_framework/assets/MKLib/manager/LoaderMgr.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "e4865bae-efbf-40f6-a1c1-e5ecba9e2987",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 96 - 0
mk_framework/assets/MKLib/manager/LocalStorageMgr.ts

@@ -0,0 +1,96 @@
+/*============================================================================================================*/
+/**
+ * 用户本地存储模块
+ */
+/*============================================================================================================*/
+// import { sys } from 'cc';
+// window.xx = window.xx || {};
+export class LocalStorageMgr {
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public InitStorage(storage_file) {
+        // this._storage_config = require(storage_file);
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public Set(key, value) {
+        value = JSON.stringify(value);
+        cc.sys.localStorage.setItem(key, value);
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public Get(key) {
+        let v = cc.sys.localStorage.getItem(key);
+        v = JSON.parse(v);
+        return v;
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public SetNumber(key, value) {
+        value = JSON.stringify(value);
+        cc.sys.localStorage.setItem(key, value);
+    }
+
+    /*============================================================================================================*/
+    /**
+     * default: null => 0
+     */
+    /*============================================================================================================*/
+    public GetNumber(key) {
+        let value = cc.sys.localStorage.getItem(key);
+        value = JSON.parse(value) || 0;
+
+        return value;
+    }
+
+    public Remove(key) {
+        cc.sys.localStorage.removeItem(key)
+    }
+
+    /*============================================================================================================*/
+    /**
+     * 保存搜索路径
+     */
+    /*============================================================================================================*/
+    public Clear() {
+        cc.sys.localStorage.clear();
+    }
+
+    /*============================================================================================================*/
+    /**
+     */
+    /*============================================================================================================*/
+    public GetMusicVolume() {
+        let value = this.Get('music_volume');
+        (value === null) && (value = 1);
+        return value;
+    }
+
+    public SetMusicVolume(value) {
+        if (value < 0.03) value = 0;
+        this.Set('music_volume', value);
+    }
+
+    public GetEffectVolume() {
+        let value = this.Get('effect_volume');
+        (value === null) && (value = 1);
+        return value;
+    }
+
+    public SetEffectVolume(value) {
+        if (value < 0.03) value = 0;
+        this.Set('effect_volume', value);
+    }
+}

+ 9 - 0
mk_framework/assets/MKLib/manager/LocalStorageMgr.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "38899a3f-8a9e-4bd2-8184-f3abf5c8427c",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 19 - 0
mk_framework/assets/MKLib/manager/MKMgr.ts

@@ -0,0 +1,19 @@
+import { EventMgr } from "./EventMgr";
+import { LoaderMgr } from "./LoaderMgr";
+import { LocalStorageMgr } from "./LocalStorageMgr";
+
+// window.xx = window.xx || {};
+export class mk {
+    /** 动态加载模块 */
+    public loader: LoaderMgr = new LoaderMgr();
+    /** 事件模块 */
+    public event: EventMgr = new EventMgr();
+    /** 系统模块 */
+    public sys = {
+        localStorage: new LocalStorageMgr()
+    }
+};
+declare global {
+    const mk: mk;
+}
+window['mk'] = new mk();

+ 9 - 0
mk_framework/assets/MKLib/manager/MKMgr.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "993b20e6-4dc2-46f2-be12-5e551d84ec63",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 6 - 5
mk_framework/assets/resources/node_ui.prefab

@@ -229,13 +229,13 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        69.05498746113585,
-        168.97738178745215,
+        109.56818448940118,
+        -146.00260202029466,
         0,
         0,
         0,
-        0.19276234699412761,
-        -0.9812454726424553,
+        -0.948637392668517,
+        0.3163654488579276,
         1,
         1,
         1
@@ -245,7 +245,7 @@
       "__type__": "cc.Vec3",
       "x": 0,
       "y": 0,
-      "z": -382.2280713754916
+      "z": -143.1134712264177
     },
     "_skewX": 0,
     "_skewY": 0,
@@ -302,6 +302,7 @@
     "faceToTarget": true,
     "faceAxis": 3,
     "autoStart": true,
+    "isRotating": false,
     "_id": ""
   },
   {

+ 119 - 0
mk_framework/assets/resources/test_prefab.prefab

@@ -0,0 +1,119 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "test_prefab",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 2
+      }
+    ],
+    "_prefab": {
+      "__id__": 3
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 50,
+      "height": 50
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "06a57251-87c4-422d-b8f2-7b5984e6b903"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "62f3744d-7ad5-402b-a2ad-49d9d5a8ecb6"
+    },
+    "fileId": "",
+    "sync": false
+  }
+]

+ 8 - 0
mk_framework/assets/resources/test_prefab.prefab.meta

@@ -0,0 +1,8 @@
+{
+  "ver": "1.2.9",
+  "uuid": "62f3744d-7ad5-402b-a2ad-49d9d5a8ecb6",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

BIN
mk_framework/assets/resources/test_sf.jpg


+ 36 - 0
mk_framework/assets/resources/test_sf.jpg.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "9e7cead1-31cb-4cd6-8a72-e2068fd9596f",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 451,
+  "height": 600,
+  "platformSettings": {},
+  "subMetas": {
+    "test_sf": {
+      "ver": "1.0.4",
+      "uuid": "06a57251-87c4-422d-b8f2-7b5984e6b903",
+      "rawTextureUuid": "9e7cead1-31cb-4cd6-8a72-e2068fd9596f",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 451,
+      "height": 600,
+      "rawWidth": 451,
+      "rawHeight": 600,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 2 - 2
mk_framework/assets/scene/MainScene.fire

@@ -157,8 +157,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 960,
-      "height": 640
+      "width": 750,
+      "height": 1334
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 30 - 55
mk_framework/assets/scene/TestScene.fire

@@ -78,10 +78,13 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 15
+        "__id__": 12
       },
       {
-        "__id__": 16
+        "__id__": 13
+      },
+      {
+        "__id__": 14
       }
     ],
     "_prefab": null,
@@ -157,8 +160,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 960,
-      "height": 640
+      "width": 750,
+      "height": 1334
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -242,18 +245,16 @@
         "__id__": 6
       },
       {
-        "__id__": 9
+        "__id__": 8
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 13
+        "__id__": 11
       }
     ],
-    "_prefab": {
-      "__id__": 14
-    },
+    "_prefab": null,
     "_opacity": 255,
     "_color": {
       "__type__": "cc.Color",
@@ -315,9 +316,7 @@
         "__id__": 7
       }
     ],
-    "_prefab": {
-      "__id__": 8
-    },
+    "_prefab": null,
     "_opacity": 255,
     "_color": {
       "__type__": "cc.Color",
@@ -398,17 +397,6 @@
     "_id": "90hPwkZzNKErv3XxTwzl/i"
   },
   {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 5
-    },
-    "asset": {
-      "__uuid__": "add9cc48-3ed7-495c-8c68-a444d934ed16"
-    },
-    "fileId": "b8Co5mcH1GFacdnr3rvjBQ",
-    "sync": false
-  },
-  {
     "__type__": "cc.Node",
     "_name": "New Sprite(Splash)",
     "_objFlags": 0,
@@ -419,15 +407,13 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 10
+        "__id__": 9
       },
       {
-        "__id__": 11
+        "__id__": 10
       }
     ],
-    "_prefab": {
-      "__id__": 12
-    },
+    "_prefab": null,
     "_opacity": 255,
     "_color": {
       "__type__": "cc.Color",
@@ -450,8 +436,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        51.5109443211756,
-        175.1244399395491,
+        0,
+        0,
         0,
         0,
         0,
@@ -480,7 +466,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 9
+      "__id__": 8
     },
     "_enabled": true,
     "_materials": [
@@ -512,7 +498,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 9
+      "__id__": 8
     },
     "_enabled": true,
     "target": {
@@ -522,21 +508,11 @@
     "timePerRound": 10,
     "faceToTarget": false,
     "faceAxis": 3,
-    "autoStart": true,
+    "autoStart": false,
+    "isRotating": true,
     "_id": "dbdpH9wR1KHoAs1YpG0kli"
   },
   {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 5
-    },
-    "asset": {
-      "__uuid__": "add9cc48-3ed7-495c-8c68-a444d934ed16"
-    },
-    "fileId": "33EvNOdVpM2IYwsy5p/ksv",
-    "sync": false
-  },
-  {
     "__type__": "cc.Widget",
     "_name": "",
     "_objFlags": 0,
@@ -564,17 +540,6 @@
     "_id": "00nzuegwRD1qB0xGRK4WiC"
   },
   {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 5
-    },
-    "asset": {
-      "__uuid__": "add9cc48-3ed7-495c-8c68-a444d934ed16"
-    },
-    "fileId": "",
-    "sync": false
-  },
-  {
     "__type__": "cc.Canvas",
     "_name": "",
     "_objFlags": 0,
@@ -617,5 +582,15 @@
     "_originalWidth": 0,
     "_originalHeight": 0,
     "_id": "29zXboiXFBKoIV4PQ2liTe"
+  },
+  {
+    "__type__": "8c1e8i/Sk9Mrqf+IX0a/+fe",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "_id": "5fczz/o8VOLrz4yevv/nq4"
   }
 ]

+ 0 - 1
mk_framework/assets/script/component/RotateAround.ts

@@ -51,7 +51,6 @@ export default class RotateAround extends cc.Component {
     private isRotating: boolean = false; // 标志位,是否正在旋转
 
     protected start() {
-        cc.log('start')
         if (this.autoStart) this.run();
     }
 

+ 12 - 0
mk_framework/assets/script/scene.meta

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.2",
+  "uuid": "8b3815b0-482d-4b23-b6da-6079f6907a79",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

+ 44 - 0
mk_framework/assets/script/scene/TestScene.ts

@@ -0,0 +1,44 @@
+
+const { ccclass, property } = cc._decorator;
+
+@ccclass
+export default class NewClass extends cc.Component {
+
+    private test_prefab: cc.Prefab = null;
+    private test_node: cc.Node = null;
+    private test_sf: cc.SpriteFrame = null;
+    onLoad() {
+        mk.event.on('/1:2/3-4x', this.on1234, this);
+        cc.systemEvent.on('/1:2/3-4x2', this.on2222, this);
+        mk.sys.localStorage.Set('test', 'storage_test')
+    }
+
+    async start() {
+        // 动态加载应用Promise示例:
+        let path = 'test_prefab';
+        let asset = await mk.loader.LoadAssetByType(path, cc.Prefab)
+        this.test_prefab = asset;
+        let node = cc.instantiate(asset);
+        node.parent = this.node;
+        this.test_node = node;
+        cc.log(asset)
+        
+        // 事件示例:
+        mk.event.emit('/1:2/3-4x', this.on1234, this);
+        cc.systemEvent.emit('/1:2/3-4x2', this.on2222, this);
+
+        // 本地存储示例:
+        cc.log(mk.sys.localStorage.Get('test'))
+        cc.log(cc.sys.localStorage.getItem('test'))
+    }
+    /** 测试接口 */
+    private on1234() {
+        cc.log('1234')
+    }
+    /** 测试接口 */
+    private on2222() {
+        cc.log('2222')
+    }
+
+    // update (dt) {}
+}

+ 9 - 0
mk_framework/assets/script/scene/TestScene.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "8c1e88bf-4a4f-4cae-a7fe-217d1affe7de",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}