diff --git a/assets/Scenes/MainScene.scene b/assets/Scenes/MainScene.scene index 702e31ac..b3375ea8 100644 --- a/assets/Scenes/MainScene.scene +++ b/assets/Scenes/MainScene.scene @@ -23,7 +23,7 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 83 + "__id__": 82 }, "_lpos": { "__type__": "cc.Vec3", @@ -54,7 +54,7 @@ }, "autoReleaseAssets": false, "_globals": { - "__id__": 88 + "__id__": 87 }, "_id": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4" }, @@ -79,15 +79,15 @@ ], "_active": true, "_components": [ + { + "__id__": 79 + }, { "__id__": 80 }, { "__id__": 81 }, - { - "__id__": 82 - }, { "__id__": 42 } @@ -1613,7 +1613,7 @@ "__id__": 43 }, "UILayerMod": { - "__id__": 60 + "__id__": 59 }, "MainCamera": { "__id__": 4 @@ -1632,10 +1632,10 @@ "_active": true, "_components": [ { - "__id__": 78 + "__id__": 77 }, { - "__id__": 79 + "__id__": 78 } ], "_prefab": null, @@ -1684,22 +1684,22 @@ "__id__": 43 }, { - "__id__": 60 + "__id__": 59 }, { - "__id__": 63 + "__id__": 62 }, { - "__id__": 66 + "__id__": 65 } ], "_active": true, "_components": [ { - "__id__": 76 + "__id__": 75 }, { - "__id__": 77 + "__id__": 76 } ], "_prefab": null, @@ -1745,22 +1745,22 @@ "__id__": 46 }, { - "__id__": 51 + "__id__": 50 }, { - "__id__": 54 + "__id__": 53 } ], "_active": true, "_components": [ + { + "__id__": 56 + }, { "__id__": 57 }, { "__id__": 58 - }, - { - "__id__": 59 } ], "_prefab": null, @@ -1809,9 +1809,6 @@ }, { "__id__": 48 - }, - { - "__id__": 50 } ], "_prefab": null, @@ -1904,18 +1901,6 @@ "handler": "onVideoEvent", "customEventData": "" }, - { - "__type__": "72cc36txkdCsYwmehDVnUGe", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 46 - }, - "_enabled": true, - "__prefab": null, - "_id": "a2xQSbqBtDhpcLiyQWux8B" - }, { "__type__": "cc.Node", "_name": "DetailvideoArea", @@ -1928,10 +1913,10 @@ "_active": true, "_components": [ { - "__id__": 52 + "__id__": 51 }, { - "__id__": 53 + "__id__": 52 } ], "_prefab": null, @@ -1970,7 +1955,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 50 }, "_enabled": true, "__prefab": null, @@ -1992,7 +1977,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 51 + "__id__": 50 }, "_enabled": true, "__prefab": null, @@ -2028,10 +2013,10 @@ "_active": true, "_components": [ { - "__id__": 55 + "__id__": 54 }, { - "__id__": 56 + "__id__": 55 } ], "_prefab": null, @@ -2070,7 +2055,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 54 + "__id__": 53 }, "_enabled": true, "__prefab": null, @@ -2092,7 +2077,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 54 + "__id__": 53 }, "_enabled": true, "__prefab": null, @@ -2193,10 +2178,10 @@ "_active": true, "_components": [ { - "__id__": 61 + "__id__": 60 }, { - "__id__": 62 + "__id__": 61 } ], "_prefab": null, @@ -2235,7 +2220,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 60 + "__id__": 59 }, "_enabled": true, "__prefab": null, @@ -2257,7 +2242,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 60 + "__id__": 59 }, "_enabled": true, "__prefab": null, @@ -2293,10 +2278,10 @@ "_active": false, "_components": [ { - "__id__": 64 + "__id__": 63 }, { - "__id__": 65 + "__id__": 64 } ], "_prefab": null, @@ -2335,7 +2320,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 63 + "__id__": 62 }, "_enabled": true, "__prefab": null, @@ -2357,7 +2342,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 63 + "__id__": 62 }, "_enabled": true, "__prefab": null, @@ -2380,13 +2365,13 @@ }, "_children": [ { - "__id__": 67 + "__id__": 66 } ], "_active": false, "_components": [ { - "__id__": 75 + "__id__": 74 } ], "_prefab": null, @@ -2425,15 +2410,18 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 66 + "__id__": 65 }, "_children": [ { - "__id__": 68 + "__id__": 67 } ], "_active": true, "_components": [ + { + "__id__": 70 + }, { "__id__": 71 }, @@ -2442,9 +2430,6 @@ }, { "__id__": 73 - }, - { - "__id__": 74 } ], "_prefab": null, @@ -2483,16 +2468,16 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 67 + "__id__": 66 }, "_children": [], "_active": true, "_components": [ { - "__id__": 69 + "__id__": 68 }, { - "__id__": 70 + "__id__": 69 } ], "_prefab": null, @@ -2531,7 +2516,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 68 + "__id__": 67 }, "_enabled": true, "__prefab": null, @@ -2553,7 +2538,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 68 + "__id__": 67 }, "_enabled": true, "__prefab": null, @@ -2615,7 +2600,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 67 + "__id__": 66 }, "_enabled": true, "__prefab": null, @@ -2637,7 +2622,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 67 + "__id__": 66 }, "_enabled": true, "__prefab": null, @@ -2676,7 +2661,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 67 + "__id__": 66 }, "_enabled": true, "__prefab": null, @@ -2730,7 +2715,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 67 + "__id__": 66 }, "_id": "f22A3TNbFMvbuNfDD/K03a" }, @@ -2740,12 +2725,12 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 67 + "__id__": 66 }, "_enabled": true, "__prefab": null, "startTestButton": { - "__id__": 73 + "__id__": 72 }, "statusLabel": null, "resultLabel": null, @@ -2757,7 +2742,7 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 66 + "__id__": 65 }, "_enabled": true, "__prefab": null, @@ -2953,10 +2938,10 @@ "instance": null, "targetOverrides": [ { - "__id__": 84 + "__id__": 83 }, { - "__id__": 86 + "__id__": 85 } ] }, @@ -2973,7 +2958,7 @@ "__id__": 44 }, "targetInfo": { - "__id__": 85 + "__id__": 84 } }, { @@ -2995,7 +2980,7 @@ "__id__": 44 }, "targetInfo": { - "__id__": 87 + "__id__": 86 } }, { @@ -3007,28 +2992,28 @@ { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 89 + "__id__": 88 }, "shadows": { - "__id__": 90 + "__id__": 89 }, "_skybox": { - "__id__": 91 + "__id__": 90 }, "fog": { - "__id__": 92 + "__id__": 91 }, "octree": { - "__id__": 93 + "__id__": 92 }, "skin": { - "__id__": 94 + "__id__": 93 }, "lightProbeInfo": { - "__id__": 95 + "__id__": 94 }, "postSettings": { - "__id__": 96 + "__id__": 95 }, "bakedWithStationaryMainLight": false, "bakedWithHighpLightmap": false diff --git a/assets/Scripts/Main/Channel/BgVideo.ts b/assets/Scripts/Main/Channel/BgVideo.ts deleted file mode 100644 index 7dc2648e..00000000 --- a/assets/Scripts/Main/Channel/BgVideo.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { _decorator, Component, Node, tween, UIOpacity, Vec3, VideoPlayer } from 'cc'; -import Utils from '../Common/Utils'; -import { VideoRoleType } from '../Common/GlobalValue'; -import { logger } from "db://assets/Scripts/Main/Common/Logger"; - -const { ccclass, property } = _decorator; - -/**背景视频 */ -@ccclass('BgVideo') -export class BgVideo extends Component { - - private vp: VideoPlayer = null!; - - private _isPlaying: boolean = false; - public get isPlaying(): boolean { - return this._isPlaying; - } - - private _vtype: VideoRoleType = VideoRoleType.None; - public get vtype(): VideoRoleType { - return this._vtype; - } - public set vtype(v: VideoRoleType) { - this._vtype = v; - } - - private _remoteUrl: string = ''; - public set remoteUrl(url: string) { - this._remoteUrl = url; - this.vp.remoteURL = url; - } - - private _cbReady: Function | undefined = null; - public set cbReady(cb: Function | undefined) { - this._cbReady = cb; - } - - private _cbEnd: Function | undefined = null; - public set cbEnd(cb: Function | undefined) { - this._cbEnd = cb; - } - - protected onLoad(): void { - this.vp = this.node.getComponent(VideoPlayer)!; - this.moveOut(); - } - - start() { - - } - - update(deltaTime: number) { - // if (this._isPlaying && this.vtype == VideoRoleType.Idle) { - // logger.log("BgVideo 主视频时长:", this.vp.currentTime, this.vp.duration); - // } - } - - - /**播放视频 */ - playVideo(remoteUrl:string, loop:boolean = false, autoIn:boolean = true) { - logger.log("BgVideo 播放视频:", this.node.position) - this.vp.remoteURL = remoteUrl - this.vp.loop = loop - this.vp.stop() - this.vp.play() - this._isPlaying = true - if (autoIn) { - this.moveIn() - } - } - - /**暂停视频 */ - pauseVideo() { - logger.log("BgVideo 暂停视频:", this._vtype) - this.vp.pause() - } - /**继续播放 */ - replayVideo() { - this.vp.play() - } - - moveIn() { - this.node.position = new Vec3(0, 0, 0) - // //测试代码 - // if (this._vtype == VideoRoleType.emo) { - // this.node.position = new Vec3(0, -500, 0) - // } - } - moveOut() { - this.node.position = new Vec3(1000, 1000, 0) - } - - /**回收视频 */ - recycleVideo() { - this.vp.stop() - this.vp.remoteURL = "" - this._isPlaying = false - this.moveOut() - // this.node.destroy() - } - - - onVideoEvent(event1:any, event2:any) { - // logger.log("bgvideo BgVideo组件 event", event2, this._vtype) - if (event2 == "ready-to-play") { - // if (!this._emoShow) { - // this._emoShow = true; - // this.removeEmoAudioNext() - // } - // this.setEmoReadyAudio(this.emo1) - if (this._cbReady) { - this._cbReady() - } - } else if (event2 == "completed") { - if (this._cbEnd) { - this._cbEnd() - } - } else if (event2 == "playing") { - if (this._vtype == VideoRoleType.Idle) { - if (this._cbEnd) { //主视频是循环播放的,没有completed事件,所以用playing事件来处理 - this._cbEnd() - } - } - } - } -} - - diff --git a/assets/Scripts/Main/Channel/BgVideo.ts.meta b/assets/Scripts/Main/Channel/BgVideo.ts.meta deleted file mode 100644 index 7ed20ba2..00000000 --- a/assets/Scripts/Main/Channel/BgVideo.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.24", - "importer": "typescript", - "imported": true, - "uuid": "72cc3ead-c647-42b1-8c26-7a10d59d419e", - "files": [], - "subMetas": {}, - "userData": {} -}