I have 26 video files which I have to put in an array and play for different objects. So far I have written this from what I know:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
public class videomanager : MonoBehaviour {
public VideoClip[] vids;
private VideoPlayer vp;
// Use this for initialization
void Start () {
vids = new VideoClip[25];
vp = gameObject.GetComponent<VideoPlayer> ();
}
// Update is called once per frame
void Update () {
}
}
I have attached this script on a plane on which I am playing the video.
Before that, I had 26 different planes, one for each different video, but I think it would be better if I could play them on a single plane and change the video according to logic.
I am not sure how I should load them into my player and play them.