[插件]_AVPro Video插件-点击按钮播放相应视频

1.在按钮上挂脚本ClickOpenVideo,注册点击事件

 

using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using RenderHeads.Media.AVProVideo.Demos;

public class ClickOpenVideo : MonoBehaviour {


    public VCR vcr;

    //点击按钮
    public void OnClick()
    {

        var sender = EventSystem.current.currentSelectedGameObject;
        switch (sender.name)
        {
            case "BigBuckBunny_720p30.mp4":
                Jump(0);
                break;
            case "SampleSphere.mp4":
                Jump(1);
                break;
            case "《新三世情缘》官方mv.mp4":
                Jump(2);
                break;
            default:
                break;
        }
        Debug.Log("video play");
    }
    public void Jump(int aa)
    {
        VCR._VideoIndex = aa;
        GameObject.Find("VCR").GetComponent().OnOpenVideoFile();

    }
}

[插件]_AVPro Video插件-点击按钮播放相应视频_第1张图片

 

[插件]_AVPro Video插件-点击按钮播放相应视频_第2张图片

[插件]_AVPro Video插件-点击按钮播放相应视频_第3张图片

 

 void Awake()
        {
            OnPauseButton ();
        }

 

 

 

 

 


 

你可能感兴趣的:(插件使用)