43 lines
1.4 KiB
C#

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<VCRCustom>();
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<VCRCustom>().OnOpenVideoFile(_videoPath);
_videoCtrl.GetComponent<VCRCustom>().SetFinishAction(FinishAction);
}
private void FinishAction()
{
_exitEvent?.Invoke();
UI_Manage.Instance.ClosePanel("VideoShowPanel");
UI_Manage.Instance.ClosePanel("VideoShowNoCtrlPanel");
}
}
}