赞
踩
using UnityEngine;
using UnityEngine.Video;
public class Welcome1 : MonoBehaviour
{
//string video_Path = “http://yuzhicai.boyaokj.cn/upload/fenjingyuyan.mp4”;//网络加载视频播放
string video_Path = “”;
public VideoPlayer videoplayer;//从场景中拖入挂载VideoPlayer组件的RawImage
public GameObject Moves; public GameObject Modle; //检测视频是否播放完毕 void Awake() { videoplayer.loopPointReached += test; //设置委托 } //视频加载完成执行的条件 void test(VideoPlayer video)//videoplayer = video2 { Debug.Log("播放完毕"); Moves.SetActive(false); Modle.SetActive(true); } //开始加载视频播放 void Start() { //video_Path = Path.Combine(Application.streamingAssetsPath, "example.mp4"); video_Path = Application.streamingAssetsPath + "/example.mp4";//本地视频加载,视频放在StreamingAssets文件夹下 videoplayer.url = video_Path; } //点击按钮播放视频 public void Play_Moves() { videoplayer.Play(); } //点击按钮暂停视频播放 public void Play_Stop() { videoplayer.Stop(); }
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。