basically nothing happens when i press space…
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class code : MonoBehaviour {
void Start ()
{
GameObject camera = GameObject.Find ("Main Camera");
var videoPlayer = camera.AddComponent<UnityEngine.Video.VideoPlayer> ();
videoPlayer.renderMode = UnityEngine.Video.VideoRenderMode.CameraFarPlane;
videoPlayer.url = "C:\\Users\\msi\\Desktop\\Finalmajor\\FinalStuff\\FinalStuff\\4x4\\Start.mp4";
videoPlayer.isLooping = true;
}
IEnumerator TimerRoutine() {
if (Input.GetKeyDown ("space")) {
var chose = Random.Range (0, 3);
if (chose == (1)) {
{
GameObject camera = GameObject.Find ("Main Camera");
var videoPlayer = camera.AddComponent<UnityEngine.Video.VideoPlayer> ();
videoPlayer.renderMode = UnityEngine.Video.VideoRenderMode.CameraFarPlane;
videoPlayer.url = "C:\\Users\\msi\\Desktop\\Finalmajor\\FinalStuff\\FinalStuff\\4x4\\1st animation.mp4";
yield return new WaitForSeconds (40);
videoPlayer.url = "C:\\Users\\msi\\Desktop\\Finalmajor\\FinalStuff\\FinalStuff\\4x4\\Start.mp4";
videoPlayer.isLooping = true;
}
}
if (chose == (2)) {
GameObject camera = GameObject.Find ("Main Camera");
var videoPlayer = camera.AddComponent<UnityEngine.Video.VideoPlayer> ();
videoPlayer.renderMode = UnityEngine.Video.VideoRenderMode.CameraFarPlane;
videoPlayer.url = "C:\\Users\\msi\\Desktop\\Finalmajor\\FinalStuff\\FinalStuff\\4x4\\2nd animation.mp4";
yield return new WaitForSeconds (40);
videoPlayer.url = "C:\\Users\\msi\\Desktop\\Finalmajor\\FinalStuff\\FinalStuff\\4x4\\Start.mp4";
videoPlayer.isLooping = true;
}
}
}
}