PS4PlayVideo.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. public class PS4PlayVideo : BaseBehaviour, IPlayVideo
  5. {
  6. public Renderer VideoRenderer { get; private set; }
  7. public static PS4PlayVideo CreateVideo(Renderer videoRenderer)
  8. {
  9. PS4PlayVideo ps4PlayVideo = R.Camera.AddComponent<PS4PlayVideo>();
  10. ps4PlayVideo.VideoRenderer = videoRenderer;
  11. return ps4PlayVideo;
  12. }
  13. public static PS4PlayVideo CreateFullScreenVideo(Renderer videoRenderer = null)
  14. {
  15. PS4PlayVideo ps4PlayVideo = R.Ui.CameraGO.AddComponent<PS4PlayVideo>();
  16. if (videoRenderer == null)
  17. {
  18. GameObject original = Asset.LoadFromResources<GameObject>("Prefab/Scene/VideoPlane", "FullScreenVideoPlane");
  19. ps4PlayVideo.VideoRenderer = UnityEngine.Object.Instantiate<GameObject>(original).GetComponent<Renderer>();
  20. }
  21. else
  22. {
  23. ps4PlayVideo.VideoRenderer = videoRenderer;
  24. }
  25. return ps4PlayVideo;
  26. }
  27. public Coroutine Play(string moviePath, string moiveName, bool isLooping = false)
  28. {
  29. return base.StartCoroutine(this.PlayCoroutine(moviePath, moiveName, isLooping));
  30. }
  31. private IEnumerator PlayCoroutine(string moviePath, string moiveName, bool isLooping = false)
  32. {
  33. yield return null;
  34. yield break;
  35. }
  36. public void Pause()
  37. {
  38. }
  39. public void Resume()
  40. {
  41. }
  42. public void Stop()
  43. {
  44. }
  45. public void Destroy()
  46. {
  47. UnityEngine.Object.Destroy(this);
  48. }
  49. }