diff --git a/assets/demo/loader.meta b/assets/demo/loader.meta new file mode 100644 index 0000000..5947216 --- /dev/null +++ b/assets/demo/loader.meta @@ -0,0 +1,12 @@ +{ + "ver": "1.1.0", + "importer": "directory", + "imported": true, + "uuid": "79b4904f-0bfe-47af-b5cf-6e884866c468", + "files": [], + "subMetas": {}, + "userData": { + "compressionType": {}, + "isRemoteBundle": {} + } +} diff --git a/assets/demo/loader/Main.ts b/assets/demo/loader/Main.ts new file mode 100644 index 0000000..95f53cd --- /dev/null +++ b/assets/demo/loader/Main.ts @@ -0,0 +1,18 @@ +/* + * @Author: dgflash + * @Date: 2022-07-14 10:57:43 + * @LastEditors: dgflash + * @LastEditTime: 2022-07-14 16:28:43 + */ +import { _decorator } from 'cc'; +import { Root } from '../../../extensions/oops-framework/assets/core/Root'; + +const { ccclass, property } = _decorator; + +/** 音乐管理模块功能演示 oops-framework/assets/core/common/audio */ +@ccclass('Main') +export class Main extends Root { + start() { + + } +} \ No newline at end of file diff --git a/assets/demo/loader/Main.ts.meta b/assets/demo/loader/Main.ts.meta new file mode 100644 index 0000000..43dac22 --- /dev/null +++ b/assets/demo/loader/Main.ts.meta @@ -0,0 +1 @@ +{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"11548f95-dc8d-40b5-a243-d8ea4737a579","files":[],"subMetas":{},"userData":{}} diff --git a/assets/demo/loader/main.scene b/assets/demo/loader/main.scene new file mode 100644 index 0000000..e01c29b --- /dev/null +++ b/assets/demo/loader/main.scene @@ -0,0 +1,507 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_native": "", + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_name": "main", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_active": true, + "_components": [], + "_prefab": null, + "autoReleaseAssets": false, + "_globals": { + "__id__": 14 + }, + "_id": "984e383b-d959-4558-aeb1-4ceb5fabbd10" + }, + { + "__type__": "cc.Node", + "_name": "root", + "_objFlags": 512, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 4 + } + ], + "_active": true, + "_components": [ + { + "__id__": 13 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "51KEOywK1E4akKtZVxf+Lk" + }, + { + "__type__": "cc.Node", + "_name": "game", + "_objFlags": 512, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "72HkSn751F86VoFGmJXpeo" + }, + { + "__type__": "cc.Node", + "_name": "gui", + "_objFlags": 512, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 5 + } + ], + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 9 + }, + { + "__id__": 11 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 640, + "y": 375, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "04HVz/X+dO/KoC2LOzh7O1" + }, + { + "__type__": "cc.Node", + "_name": "UICamera", + "_objFlags": 512, + "_parent": { + "__id__": 4 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 1000 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "e73tUR45BNpa1z9e8ecKdC" + }, + { + "__type__": "cc.Camera", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "__prefab": null, + "_projection": 0, + "_priority": 1073741824, + "_fov": 45, + "_fovAxis": 0, + "_orthoHeight": 413.1905781584582, + "_near": 1, + "_far": 2000, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 0 + }, + "_depth": 1, + "_stencil": 0, + "_clearFlags": 7, + "_rect": { + "__type__": "cc.Rect", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + "_aperture": 19, + "_shutter": 7, + "_iso": 0, + "_screenScale": 1, + "_visibility": 33554432, + "_targetTexture": null, + "_id": "58hTt8B3tKnZaTs3OzCwkE" + }, + { + "__type__": "cc.UITransform", + "_name": "Canvas", + "_objFlags": 0, + "node": { + "__id__": 4 + }, + "_enabled": true, + "__prefab": { + "__id__": 8 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1280, + "height": 750 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "9b8MclXbNFz593SPtnWKrD" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "03ZMhNEpRK75Hmdzr8ZGhG" + }, + { + "__type__": "cc.Canvas", + "_name": "Canvas", + "_objFlags": 0, + "node": { + "__id__": 4 + }, + "_enabled": true, + "__prefab": { + "__id__": 10 + }, + "_cameraComponent": { + "__id__": 6 + }, + "_alignCanvasWithScreen": true, + "_id": "1dz15JMmpAgKNYspEOuXh6" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7acBC/yU9N05fc6HGd8fZS" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 4 + }, + "_enabled": true, + "__prefab": { + "__id__": 12 + }, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 1280, + "_alignMode": 2, + "_lockFlags": 45, + "_id": "94hxkzOX9ClLtqc63q0wsQ" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "1chkRDp1xCFqsnwJh1NVq1" + }, + { + "__type__": "11548+V3I1AtaJD2OpHN6V5", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": null, + "game": { + "__id__": 3 + }, + "gui": { + "__id__": 4 + }, + "sliderMusic": null, + "sliderMusicVolume": null, + "sliderMusicHandle": null, + "_id": "acg8HsU4NPupH9BY36RBkz" + }, + { + "__type__": "cc.SceneGlobals", + "ambient": { + "__id__": 15 + }, + "shadows": { + "__id__": 16 + }, + "_skybox": { + "__id__": 17 + }, + "fog": { + "__id__": 18 + }, + "octree": { + "__id__": 19 + } + }, + { + "__type__": "cc.AmbientInfo", + "_skyColorHDR": { + "__type__": "cc.Vec4", + "x": 0.242613, + "y": 0.362617, + "z": 0.798746, + "w": 0.520833125 + }, + "_skyColor": { + "__type__": "cc.Vec4", + "x": 0.242613, + "y": 0.362617, + "z": 0.798746, + "w": 0.520833125 + }, + "_skyIllumHDR": 20000, + "_skyIllum": 20000, + "_groundAlbedoHDR": { + "__type__": "cc.Vec4", + "x": 0.241814, + "y": 0.361945, + "z": 0.798799, + "w": 0 + }, + "_groundAlbedo": { + "__type__": "cc.Vec4", + "x": 0.241814, + "y": 0.361945, + "z": 0.798799, + "w": 0 + }, + "_skyColorLDR": { + "__type__": "cc.Vec4", + "x": 0.519964, + "y": 0.630786, + "z": 0.905039, + "w": 0.5208 + }, + "_skyIllumLDR": 0.5208, + "_groundAlbedoLDR": { + "__type__": "cc.Vec4", + "x": 0.519544, + "y": 0.630484, + "z": 0.905069, + "w": 0 + } + }, + { + "__type__": "cc.ShadowsInfo", + "_enabled": false, + "_type": 0, + "_normal": { + "__type__": "cc.Vec3", + "x": 0, + "y": 1, + "z": 0 + }, + "_distance": 0, + "_shadowColor": { + "__type__": "cc.Color", + "r": 76, + "g": 76, + "b": 76, + "a": 255 + }, + "_maxReceived": 4, + "_size": { + "__type__": "cc.Vec2", + "x": 1024, + "y": 1024 + } + }, + { + "__type__": "cc.SkyboxInfo", + "_envLightingType": 0, + "_envmapHDR": { + "__uuid__": "d032ac98-05e1-4090-88bb-eb640dcb5fc1@b47c0", + "__expectedType__": "cc.TextureCube" + }, + "_envmap": { + "__uuid__": "d032ac98-05e1-4090-88bb-eb640dcb5fc1@b47c0", + "__expectedType__": "cc.TextureCube" + }, + "_envmapLDR": { + "__uuid__": "6f01cf7f-81bf-4a7e-bd5d-0afc19696480@b47c0", + "__expectedType__": "cc.TextureCube" + }, + "_diffuseMapHDR": null, + "_diffuseMapLDR": null, + "_enabled": true, + "_useHDR": true, + "_editableMaterial": null + }, + { + "__type__": "cc.FogInfo", + "_type": 0, + "_fogColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_enabled": false, + "_fogDensity": 0.3, + "_fogStart": 0.5, + "_fogEnd": 300, + "_fogAtten": 5, + "_fogTop": 1.5, + "_fogRange": 1.2, + "_accurate": false + }, + { + "__type__": "cc.OctreeInfo", + "_enabled": false, + "_minPos": { + "__type__": "cc.Vec3", + "x": -1024, + "y": -1024, + "z": -1024 + }, + "_maxPos": { + "__type__": "cc.Vec3", + "x": 1024, + "y": 1024, + "z": 1024 + }, + "_depth": 8 + } +] \ No newline at end of file diff --git a/assets/demo/loader/main.scene.meta b/assets/demo/loader/main.scene.meta new file mode 100644 index 0000000..f995636 --- /dev/null +++ b/assets/demo/loader/main.scene.meta @@ -0,0 +1 @@ +{"ver":"1.1.39","importer":"scene","imported":true,"uuid":"984e383b-d959-4558-aeb1-4ceb5fabbd10","files":[".json"],"subMetas":{},"userData":{}} diff --git a/assets/main.scene b/assets/main.scene index b923e62..a2a1958 100644 --- a/assets/main.scene +++ b/assets/main.scene @@ -227,7 +227,7 @@ "_priority": 1073741824, "_fov": 45, "_fovAxis": 0, - "_orthoHeight": 403.5536294691224, + "_orthoHeight": 375, "_near": 1, "_far": 2000, "_color": { diff --git a/assets/script/game/demo/Demo.ts b/assets/script/game/demo/Demo.ts index 96d4bf3..15f59b7 100644 --- a/assets/script/game/demo/Demo.ts +++ b/assets/script/game/demo/Demo.ts @@ -2,7 +2,7 @@ * @Author: dgflash * @Date: 2021-07-03 16:13:17 * @LastEditors: dgflash - * @LastEditTime: 2022-06-21 15:31:05 + * @LastEditTime: 2022-07-14 18:18:09 */ import { Component, dynamicAtlasManager, EventTouch, _decorator } from "cc"; import { tips } from "../common/prompt/TipsManager"; @@ -123,11 +123,10 @@ export class Demo extends Component { private btn_audio_open1(event: EventTouch, data: any) { oops.audio.musicVolume = 0.5; - oops.audio.playMusic("audios/Gravel", () => { - oops.audio.playMusic("audios/nocturne", () => { - - }); + oops.audio.setMusicComplete(() => { + oops.audio.playMusic("audios/nocturne"); }); + oops.audio.playMusic("audios/Gravel"); } /** 背景音效 */