Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class PlayVideo : MonoBehaviour {
- public GameObject videoPlayer;
- public int timeToStop;
- void Start () {
- videoPlayer.SetActive (false);
- }
- void OnTriggerEnter(Collider player){
- if (player.gameObject.tag == "Player")
- {
- videoPlayer.SetActive (true);
- Destroy (videoPlayer, timeToStop);
- }
- }
- public void Update()
- {
- if (Input.GetKey (KeyCode.X)) {
- Debug.Log ("hello there");
- Destroy (videoPlayer);
- }
- if (Input.GetKey (KeyCode.Escape)) {
- Debug.Log ("hello there");
- Application.Quit();
- Debug.Log ("General Konobi");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement