52 lines
1.1 KiB
C#
52 lines
1.1 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.Video;
|
|
using Yoga;
|
|
|
|
[RequireComponent(typeof(VideoPlayer))]
|
|
public class ActionGuideVideoPanel : UIPopupBase
|
|
{
|
|
public VideoPlayer _video;
|
|
|
|
private void Awake()
|
|
{
|
|
_video = GetComponent<VideoPlayer>();
|
|
}
|
|
|
|
public override void Init(object[] pageData)
|
|
{
|
|
base.Init(pageData);
|
|
_video.clip = pageData[0] as VideoClip;
|
|
|
|
_video.isLooping = true;
|
|
_video.playOnAwake = false;
|
|
_video.Prepare();
|
|
}
|
|
|
|
public void OnOKClicked()
|
|
{
|
|
PageDispose();
|
|
//MotionCaptureManager.Instance.gameObject.SetActive(true);
|
|
//EventManager.Instance.DispatchEvent("StartMotionCapture");
|
|
UIManager.Instance.ShowPanel<GuideUI>();
|
|
}
|
|
|
|
private void PageDispose()
|
|
{
|
|
_video.Stop();
|
|
UIManager.Instance.CloseCurrent();
|
|
}
|
|
|
|
public void OnReturnClicked()
|
|
{
|
|
PageDispose();
|
|
LoadingManager.Instance.Load("Boot");
|
|
}
|
|
|
|
public override void OnEnter()
|
|
{
|
|
base.OnEnter();
|
|
_video.Play();
|
|
}
|
|
} |