Question by
Hunterduke05 · Nov 10, 2019 at 05:26 PM ·
buttonvideohidescene-changeshow
Wait until video is over to show canvas,Wait until Video is over to show canvas
I have a video that I want to play, and when it finishes (Or after a certain time) , I want a canvas to show, but I cant script. Please help.
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Video;
using UnityEngine;
public class ShowOptions : MonoBehaviour {
public void ShowOption()
{
Renderer rend = gameObject.GetComponent<Renderer>();
if (rend.enabled)
rend.enabled = false;
else
rend.enabled = true;
}
public VideoPlayer vid;
void Start() { vid.loopPointReached += CheckOver; }
void CheckOver(UnityEngine.Video.VideoPlayer vp)
{
Renderer.enabled = true;
}
}
,I have a video that plays In my game and after the video is over (or after a certain time), I want a canvas with two buttons to show, which will then change the scene. I'm not very good at coding sand my script is pretty bad. Please help. using System.Collections; using System.Collections.Generic; using UnityEngine.Video; using UnityEngine;
public class ShowOptions : MonoBehaviour {
public void ShowOption()
{
Renderer rend = gameObject.GetComponent<Renderer>();
if (rend.enabled)
rend.enabled = false;
else
rend.enabled = true;
}
public VideoPlayer vid;
void Start() { vid.loopPointReached += CheckOver; }
void CheckOver(UnityEngine.Video.VideoPlayer vp)
{
Renderer.enabled = true;
}
}
wait-video-show1.png
(188.4 kB)
wait-video-show2.png
(158.5 kB)
Comment