Advertisement
Guest User

hello skye yuval masiaasasas

a guest
Feb 24th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class PlayVideo : MonoBehaviour {
  6.  
  7. public GameObject videoPlayer;
  8. public int timeToStop;
  9.  
  10. void Start () {
  11. videoPlayer.SetActive (false);
  12. }
  13.  
  14. void OnTriggerEnter(Collider player){
  15. if (player.gameObject.tag == "Player")
  16. {
  17. videoPlayer.SetActive (true);
  18. Destroy (videoPlayer, timeToStop);
  19. }
  20. }
  21. public void Update()
  22. {
  23. if (Input.GetKey (KeyCode.X)) {
  24. Debug.Log ("hello there");
  25. Destroy (videoPlayer);
  26.  
  27. }
  28. if (Input.GetKey (KeyCode.Escape)) {
  29. Debug.Log ("hello there");
  30.  
  31. Application.Quit();
  32. Debug.Log ("General Konobi");
  33.  
  34. }
  35.  
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement