-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIntro.cs
More file actions
27 lines (23 loc) · 717 Bytes
/
Intro.cs
File metadata and controls
27 lines (23 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Video;
public class Intro : MonoBehaviour
{
[SerializeField] private Dialogue dialogue;
[SerializeField] private RawImage video;
[SerializeField] private VideoPlayer videoPlayer;
[SerializeField] private Button continueButton;
private float time = 0f;
private void Update() {
if (dialogue == null) {
video.gameObject.SetActive(true);
videoPlayer.gameObject.SetActive(true);
time += Time.deltaTime;
}
if (time >= videoPlayer.length) {
continueButton.gameObject.SetActive(true);
}
}
}