diff --git a/assets/Game/prefabs/SlotScene.prefab b/assets/Game/prefabs/SlotScene.prefab index 0a4bdff..6878de0 100644 --- a/assets/Game/prefabs/SlotScene.prefab +++ b/assets/Game/prefabs/SlotScene.prefab @@ -2149,7 +2149,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "2fq9I2h89EiIRcjY859VeR" + "fileId": "35Ealdq0NJaLdLx2t+1rKL" }, { "__type__": "cc.PrefabInfo", @@ -2159,7 +2159,7 @@ "asset": { "__id__": 0 }, - "fileId": "f5njkQRGlISLReUK2BtuXO", + "fileId": "18anZzwQtMdbHj6kh1+mrK", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2190,7 +2190,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "aex9PY7ARCdagWMfkueHFz" + "fileId": "07dAHkgU1CFrs2xP4Sd24i" }, { "__type__": "cc.PrefabInfo", @@ -2200,7 +2200,7 @@ "asset": { "__id__": 0 }, - "fileId": "40TLiGR9VOz5J7P8dlD6/0", + "fileId": "55sag1xRBGgLApjMhJhaXe", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2231,7 +2231,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "8av3ou24FKgot5jJa1p543" + "fileId": "ccLL5xiF1HdYjd0D6ybh9D" }, { "__type__": "5fc10Zl7lVO97/rr2J1uxWH", @@ -2255,7 +2255,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "80khILv9FITZNCodfBRkKG" + "fileId": "5fUyfFToJIML63Pns78pdD" }, { "__type__": "5fd13+Xa69CZogb3Q/F1lnC", @@ -2428,7 +2428,7 @@ "asset": { "__id__": 0 }, - "fileId": "2boFLN/5NIwKQhmi6xzJ08", + "fileId": "11vIjwGn9HPK5DOCU4I+Da", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2453,7 +2453,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "3e2X5biC9Il5UaHHFDJP5w" + "fileId": "60o7KXKjpNR5uvSdrNojDM" }, { "__type__": "cc.UITransform", @@ -2481,7 +2481,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "778G7i/2NJ+ZmZbqI7TSCl" + "fileId": "10qjDFsRBEcJ645fqPrdKt" }, { "__type__": "cc.Sprite", @@ -2526,7 +2526,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "34quDKkwlE5oZGbsbUDFWw" + "fileId": "deH5lqIRpGdLudKkNaHO5w" }, { "__type__": "cc.PrefabInfo", @@ -2536,7 +2536,7 @@ "asset": { "__id__": 0 }, - "fileId": "f8Dwpn8DVAZbZSq/oHqoRA", + "fileId": "560+/MiVRDmJ3UebjYpUIk", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2791,7 +2791,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "0e4KvJRbtGtZnyURtj9RBp" + "fileId": "98L8fIYhJH562we05xo5LC" }, { "__type__": "cc.PrefabInfo", @@ -2801,7 +2801,7 @@ "asset": { "__id__": 0 }, - "fileId": "49sAVxtF9IzbYky2VL1Uwr", + "fileId": "c6BxYcJwhIfqDo7x62Oihi", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2832,7 +2832,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "36NmeywXRGzqlJnedPOViY" + "fileId": "c25KfNUItErq7X5sLVEmla" }, { "__type__": "cc.PrefabInfo", @@ -2842,7 +2842,7 @@ "asset": { "__id__": 0 }, - "fileId": "63lntwTzhDzqkBbjJqOAKp", + "fileId": "7f6K1Bt+NNOpOgvvHt1p3F", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2873,7 +2873,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "d5x1hdvpJLib7efaCi6IEu" + "fileId": "60XaYF1oNByoEjhgYhxYLy" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -2897,7 +2897,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "30+BRrRIhDbZ7Fe/PcwgNL" + "fileId": "e72dSOuahOxJrIkjRD+mOJ" }, { "__type__": "cc.PrefabInfo", @@ -2907,7 +2907,7 @@ "asset": { "__id__": 0 }, - "fileId": "2eb7l6UkJB6b0w73DpkZBs", + "fileId": "2d6lxh/gpE64Swtf6xo/Nz", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3090,7 +3090,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "3dpPNf4ERPPIGWDTYUBWn1" + "fileId": "a73E3Bb/tOXKYYLgm2g8vV" }, { "__type__": "cc.PrefabInfo", @@ -3100,7 +3100,7 @@ "asset": { "__id__": 0 }, - "fileId": "95Ih9kzItMmquic2Ps9Evm", + "fileId": "edCalFH/5ENbdxrMM/jKDR", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3131,7 +3131,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "e8Cqd5vgtFxJNGW6GhcUTL" + "fileId": "95a9WD2FdKZrzAi3rrEvTv" }, { "__type__": "cc.PrefabInfo", @@ -3141,7 +3141,7 @@ "asset": { "__id__": 0 }, - "fileId": "e3C0U7J2FGCKBxINeiQdUT", + "fileId": "a0YBiCchxLLofIjmO7KTFT", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3172,7 +3172,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "2b7y9UhRZEiongOzZbe9xW" + "fileId": "31PeBVaSdMBrNptM7QuyQx" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -3196,7 +3196,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "52CN7eRtdCXKHuGoO/kg6U" + "fileId": "7dN8Jboq9FIbsoN+ucFnjj" }, { "__type__": "cc.PrefabInfo", @@ -3206,7 +3206,7 @@ "asset": { "__id__": 0 }, - "fileId": "2dUzIZGGBGC5dCZLQnG5dY", + "fileId": "3cVgnqHsdM6redP604HazQ", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3389,7 +3389,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "abZ4e1o8FPWr46R2qoeJ0o" + "fileId": "80VGnYzJ1E3bcNbiO1QEKt" }, { "__type__": "cc.PrefabInfo", @@ -3399,7 +3399,7 @@ "asset": { "__id__": 0 }, - "fileId": "0esnT1XpBDZocPgpIP3IgW", + "fileId": "df6fKdcU1DX691fzZStzYx", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3430,7 +3430,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "d7xiXF6HpDXJlqA7MCRYC2" + "fileId": "e0jseW60xFULKbphp02pcR" }, { "__type__": "cc.PrefabInfo", @@ -3440,7 +3440,7 @@ "asset": { "__id__": 0 }, - "fileId": "29IzOxmFdAWqMx/xEU7TXf", + "fileId": "a73iuKZxBDRbAc4M5JTMFV", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3471,7 +3471,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "46pQc+s/pEDKaTqN32i54P" + "fileId": "adaxvlaOJHlJqixnnyIXFi" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -3495,7 +3495,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "01SWkhbzBJNIMc2sYscSjG" + "fileId": "86EzpWGhVDIbtW8h9oRdgq" }, { "__type__": "cc.PrefabInfo", @@ -3505,7 +3505,7 @@ "asset": { "__id__": 0 }, - "fileId": "2cnUEXTcJMGI5CgfYuL+8D", + "fileId": "54XDzKEIFG95LpDEp2CiWM", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3688,7 +3688,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "e7lKaJeMNLEpZRWUJNhkFq" + "fileId": "43fHDdqO9H8Z2S7VrOPE0u" }, { "__type__": "cc.PrefabInfo", @@ -3698,7 +3698,7 @@ "asset": { "__id__": 0 }, - "fileId": "9e1oUFzC9I9Ywo8EYWy9Qx", + "fileId": "d1UhjzP11A1o+6WFLABStF", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3729,7 +3729,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "7dbBJmPBVLkInXwna9Ws0C" + "fileId": "f79vgfKAlM3LoBVgt6baJJ" }, { "__type__": "cc.PrefabInfo", @@ -3739,7 +3739,7 @@ "asset": { "__id__": 0 }, - "fileId": "050dDVeWNLfpWFDxaFECpg", + "fileId": "b6eQC+wSxMc5sdzOwsud6x", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3770,7 +3770,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "12qYGOEWhLu5clcf7NgmKl" + "fileId": "c1LtMmM2ZB6ZKIl3lVgzTr" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -3794,7 +3794,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "68tjCizMdG5LFdltqnOLaQ" + "fileId": "afa3iGblRPn7Qoc2KypNQm" }, { "__type__": "cc.PrefabInfo", @@ -3804,7 +3804,7 @@ "asset": { "__id__": 0 }, - "fileId": "90Lcl+n2RDH7gCWohQhfzy", + "fileId": "43dcoN6cJGIKhDZKmOKBZD", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3987,7 +3987,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "12LqNAeE5Pob9K2i409AJQ" + "fileId": "83rA2uZwVFaK5yWEaR6eME" }, { "__type__": "cc.PrefabInfo", @@ -3997,7 +3997,7 @@ "asset": { "__id__": 0 }, - "fileId": "75508qO7pItLhuV+ssdGRo", + "fileId": "78rgMINrxFc49BiK/6Md8B", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4028,7 +4028,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "f7LneJTP9ESpvXgnzHv4Su" + "fileId": "d71jWBopBPc6RZrB5w/Ck/" }, { "__type__": "cc.PrefabInfo", @@ -4038,7 +4038,7 @@ "asset": { "__id__": 0 }, - "fileId": "f9dkjkmnJFebsLKV/hi/pe", + "fileId": "33FfS8N2hDw5UEe/OS9m5q", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4069,7 +4069,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "c3w+gGt7ZOrI7mRqZKTnEl" + "fileId": "e7tUIlnCNNXp1yPmkIcBAv" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -4093,7 +4093,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "efTt2u+6RCT663UgioniBI" + "fileId": "betoXJpCVKO6ChNp6ZjpKJ" }, { "__type__": "cc.PrefabInfo", @@ -4103,7 +4103,7 @@ "asset": { "__id__": 0 }, - "fileId": "15oYHxTxZAEL5wJ6frInbJ", + "fileId": "ady4gC9s9PWbg3HFpf76WK", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4286,7 +4286,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "9affhg7DpOLaqfVM5tmJn8" + "fileId": "aexBKnPlBEyad5qMWzqtYB" }, { "__type__": "cc.PrefabInfo", @@ -4296,7 +4296,7 @@ "asset": { "__id__": 0 }, - "fileId": "8bBas84INGfIQWpV34Pi4Q", + "fileId": "1a80FDuxZAoKrgRSzBkXzE", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4327,7 +4327,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "afpyq2EMxPbqjfqFR5p2Rm" + "fileId": "85+JBhCRJHJqms7YR4uiGD" }, { "__type__": "cc.PrefabInfo", @@ -4337,7 +4337,7 @@ "asset": { "__id__": 0 }, - "fileId": "fcgLIwfdNJOK5U8Jo4Fxzq", + "fileId": "b5qOlobaBD1LPV5EeZ7yvp", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4368,7 +4368,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "b4go/pzGNBYKzBmK7d/RFt" + "fileId": "95gow6/JxMlKFe2+UGgPm6" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -4392,7 +4392,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "09zvIJqvZLmZQU03mB7ssc" + "fileId": "69ZGj6/m1AtIwkJdfZ8Rax" }, { "__type__": "cc.PrefabInfo", @@ -4402,7 +4402,7 @@ "asset": { "__id__": 0 }, - "fileId": "86iwgp1IdLiLfCqCBt9aK2", + "fileId": "22GQgLhVpA05e4Bor942LJ", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4427,7 +4427,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "537/vxWxJCM5Iua+/yreV4" + "fileId": "abxnp14yBAnbKMInIRYcAf" }, { "__type__": "cc.UITransform", @@ -4455,7 +4455,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "eaK/wbf0RCF4ko+GDtmGJM" + "fileId": "95QjpYiKZMepRJXvnDGzXC" }, { "__type__": "cc.Sprite", @@ -4500,7 +4500,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "583DTg/d5Bar33ntOiSvBG" + "fileId": "2f9YuXNy1Ls7HLJT1L0h/m" }, { "__type__": "cc.PrefabInfo", @@ -4510,7 +4510,7 @@ "asset": { "__id__": 0 }, - "fileId": "07Z8nbsuFIB6zxBkNewiuS", + "fileId": "bcHACF9IpAcIG6PQflq6jj", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null diff --git a/assets/Loading/game.scene b/assets/Loading/game.scene index 2f4a0ec..cdbfa2e 100644 --- a/assets/Loading/game.scene +++ b/assets/Loading/game.scene @@ -23,7 +23,7 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 75 + "__id__": 77 }, "_lpos": { "__type__": "cc.Vec3", @@ -54,7 +54,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 76 + "__id__": 78 }, "_id": "6c29a3fe-b10e-44a5-98e3-55595b231767" }, @@ -77,14 +77,11 @@ "__id__": 8 }, { - "__id__": 56 + "__id__": 57 } ], "_active": true, "_components": [ - { - "__id__": 71 - }, { "__id__": 72 }, @@ -93,6 +90,12 @@ }, { "__id__": 74 + }, + { + "__id__": 75 + }, + { + "__id__": 76 } ], "_prefab": null, @@ -338,14 +341,11 @@ "__id__": 9 }, { - "__id__": 49 + "__id__": 50 } ], "_active": true, "_components": [ - { - "__id__": 52 - }, { "__id__": 53 }, @@ -354,6 +354,9 @@ }, { "__id__": 55 + }, + { + "__id__": 56 } ], "_prefab": null, @@ -423,10 +426,10 @@ "_active": true, "_components": [ { - "__id__": 47 + "__id__": 48 }, { - "__id__": 48 + "__id__": 49 } ], "_prefab": null, @@ -1797,6 +1800,9 @@ "clickEvents": [ { "__id__": 46 + }, + { + "__id__": 47 } ], "_interactable": true, @@ -1862,6 +1868,16 @@ "handler": "onStartBtnClick", "customEventData": "" }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 2 + }, + "component": "", + "_componentId": "66eb7bIH5FM/bp9/GSfNVSJ", + "handler": "clickStart", + "customEventData": "" + }, { "__type__": "cc.UITransform", "_name": "", @@ -1926,10 +1942,10 @@ "_active": true, "_components": [ { - "__id__": 50 + "__id__": 51 }, { - "__id__": 51 + "__id__": 52 } ], "_prefab": null, @@ -1968,7 +1984,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 49 + "__id__": 50 }, "_enabled": true, "__prefab": null, @@ -1990,7 +2006,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 49 + "__id__": 50 }, "_enabled": true, "__prefab": null, @@ -2132,22 +2148,22 @@ }, "_children": [ { - "__id__": 57 + "__id__": 58 }, { - "__id__": 61 + "__id__": 62 }, { - "__id__": 66 + "__id__": 67 } ], "_active": false, "_components": [ { - "__id__": 69 + "__id__": 70 }, { - "__id__": 70 + "__id__": 71 } ], "_prefab": null, @@ -2186,19 +2202,19 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 56 + "__id__": 57 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 58 - }, { "__id__": 59 }, { "__id__": 60 + }, + { + "__id__": 61 } ], "_prefab": null, @@ -2237,7 +2253,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 57 + "__id__": 58 }, "_enabled": true, "__prefab": null, @@ -2259,7 +2275,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 57 + "__id__": 58 }, "_enabled": true, "__prefab": null, @@ -2271,7 +2287,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 57 + "__id__": 58 }, "_enabled": true, "__prefab": null, @@ -2310,14 +2326,11 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 56 + "__id__": 57 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 62 - }, { "__id__": 63 }, @@ -2326,6 +2339,9 @@ }, { "__id__": 65 + }, + { + "__id__": 66 } ], "_prefab": null, @@ -2364,7 +2380,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 61 + "__id__": 62 }, "_enabled": true, "__prefab": null, @@ -2386,7 +2402,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 61 + "__id__": 62 }, "_enabled": true, "__prefab": null, @@ -2448,7 +2464,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 61 + "__id__": 62 }, "_enabled": true, "__prefab": null, @@ -2461,7 +2477,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 61 + "__id__": 62 }, "_enabled": true, "__prefab": null, @@ -2491,16 +2507,16 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 56 + "__id__": 57 }, "_children": [], "_active": true, "_components": [ { - "__id__": 67 + "__id__": 68 }, { - "__id__": 68 + "__id__": 69 } ], "_prefab": null, @@ -2539,7 +2555,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 66 + "__id__": 67 }, "_enabled": true, "__prefab": null, @@ -2561,7 +2577,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 66 + "__id__": 67 }, "_enabled": true, "__prefab": null, @@ -2600,7 +2616,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 56 + "__id__": 57 }, "_enabled": true, "__prefab": null, @@ -2622,7 +2638,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 56 + "__id__": 57 }, "_enabled": true, "__prefab": null, @@ -2716,7 +2732,7 @@ "__id__": 42 }, "GameNode": { - "__id__": 49 + "__id__": 50 }, "languageJson": { "__uuid__": "778fb4f7-5070-4fb1-b5aa-432865f396b9", @@ -2738,10 +2754,23 @@ "__id__": 5 }, "rotateNode": { - "__id__": 56 + "__id__": 57 }, "_id": "d8F/UwpTxNpZhwSJjDvnkk" }, + { + "__type__": "66eb7bIH5FM/bp9/GSfNVSJ", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": false, + "__prefab": null, + "btn_start": null, + "_id": "e0mFspN7JJYrq3HnAr6OO6" + }, { "__type__": "cc.PrefabInfo", "root": null, @@ -2753,29 +2782,29 @@ { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 77 - }, - "shadows": { - "__id__": 78 - }, - "_skybox": { "__id__": 79 }, - "fog": { + "shadows": { "__id__": 80 }, - "octree": { + "_skybox": { "__id__": 81 }, - "skin": { + "fog": { "__id__": 82 }, - "lightProbeInfo": { + "octree": { "__id__": 83 }, - "postSettings": { + "skin": { "__id__": 84 }, + "lightProbeInfo": { + "__id__": 85 + }, + "postSettings": { + "__id__": 86 + }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false }, diff --git a/assets/Loading/scripts/AntiSleepManager.ts b/assets/Loading/scripts/AntiSleepManager.ts new file mode 100644 index 0000000..d6019f1 --- /dev/null +++ b/assets/Loading/scripts/AntiSleepManager.ts @@ -0,0 +1,66 @@ +import { _decorator, Component, Node } from 'cc'; +import NoSleep from 'nosleep.js'; +const { ccclass,property } = _decorator; + +@ccclass('AntiSleepManager') +export class AntiSleepManager extends Component { + private noSleep: NoSleep | null = null; + private wakeLock: any = null; + _enabled: boolean = false; + + @property(Node) + btn_start: Node = null + + onLoad() { + this.noSleep = new NoSleep(); + } + + clickStart(){ + if(this._enabled) return + + this.enableWakeLock(); + } + + async enableWakeLock() { + + this._enabled = true + + try { + if ('wakeLock' in navigator) { + this.wakeLock = await (navigator as any).wakeLock.request('screen'); + // console.log('✅ 屏幕常亮已启用 (Wake Lock API)'); + + // 处理页面切换时丢失锁 + document.addEventListener('visibilitychange', async () => { + if (document.visibilityState === 'visible') { + this.wakeLock = await (navigator as any).wakeLock.request('screen'); + } + }); + } else { + this.noSleep?.enable(); + // console.log('✅ 屏幕常亮已启用 (NoSleep.js)'); + } + } catch (err) { + this._enabled = false + // console.error('❌ 启用屏幕常亮失败:', err); + } + } + + disableWakeLock() { + if (this.wakeLock) { + this.wakeLock.release(); + this.wakeLock = null; + // console.log('🔒 Wake Lock 已关闭'); + } + if (this.noSleep) { + this.noSleep.disable(); + // console.log('🔒 NoSleep 已关闭'); + } + } + + onDestroy() { + // this.disableWakeLock(); + } +} + + diff --git a/assets/Loading/scripts/AntiSleepManager.ts.meta b/assets/Loading/scripts/AntiSleepManager.ts.meta new file mode 100644 index 0000000..fcc149b --- /dev/null +++ b/assets/Loading/scripts/AntiSleepManager.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.24", + "importer": "typescript", + "imported": true, + "uuid": "66eb76c8-1f91-4cfd-ba7d-fc649f355489", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ba3e81d --- /dev/null +++ b/package-lock.json @@ -0,0 +1,22 @@ +{ + "name": "rp_10012", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "rp_10012", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "nosleep.js": "^0.12.0" + } + }, + "node_modules/nosleep.js": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz", + "integrity": "sha512-9d1HbpKLh3sdWlhXMhU6MMH+wQzKkrgfRkYV0EBdvt99YJfj0ilCJrWRDYG2130Tm4GXbEoTCx5b34JSaP+HhA==", + "license": "MIT" + } + } +} diff --git a/package.json b/package.json index 1dcdc82..dd50639 100755 --- a/package.json +++ b/package.json @@ -3,5 +3,17 @@ "uuid": "bc831e5b-ba7f-40d1-bde2-b198d973d149", "creator": { "version": "3.8.5" + }, + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "nosleep.js": "^0.12.0" } }