using CG.Framework; using CG.UTility; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; /******************************************************************************* *Create By CG *Function *******************************************************************************/ namespace ZXK.LouDiXvMuNiu { public class VideoShowPanel : UIBase { private VCRCustom _videoCtrl; private Action _exitEvent; protected override void Awake() { base.Awake(); _videoCtrl = GetWedage("VCRPanel_N").GetComponent(); AddEventListener("ExitVideoBtn_N", UIEventType.OnButtonClick, () => { FinishAction(); }); } public void PlayVideoClip(string clipName,Action exitEvent) { _exitEvent = exitEvent; string _videoPath = Application.streamingAssetsPath + ConstCtrl.VIDEO_CSDY_PATH+clipName+".mp4"; _videoCtrl.GetComponent().OnOpenVideoFile(_videoPath); _videoCtrl.GetComponent().SetFinishAction(FinishAction); } private void FinishAction() { _exitEvent?.Invoke(); UI_Manage.Instance.ClosePanel("VideoShowPanel"); UI_Manage.Instance.ClosePanel("VideoShowNoCtrlPanel"); } } }