MedaiPlayerSampleSphereGUI.cs 963 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using UnityEngine;
  2. using System.Collections;
  3. public class MedaiPlayerSampleSphereGUI : MonoBehaviour {
  4. public MediaPlayerCtrl scrMedia;
  5. // Use this for initialization
  6. void Start () {
  7. }
  8. // Update is called once per frame
  9. void Update () {
  10. foreach(Touch touch in Input.touches)
  11. {
  12. transform.localEulerAngles = new Vector3(
  13. transform.localEulerAngles.x, transform.localEulerAngles.y + touch.deltaPosition.x, transform.localEulerAngles.z);
  14. }
  15. }
  16. #if !UNITY_WEBGL
  17. void OnGUI() {
  18. if( GUI.Button(new Rect(50,50,100,100),"Load"))
  19. {
  20. scrMedia.Load("EasyMovieTexture.mp4");
  21. }
  22. if( GUI.Button(new Rect(50,200,100,100),"Play"))
  23. {
  24. scrMedia.Play();
  25. }
  26. if( GUI.Button(new Rect(50,350,100,100),"stop"))
  27. {
  28. scrMedia.Stop();
  29. }
  30. if( GUI.Button(new Rect(50,500,100,100),"pause"))
  31. {
  32. scrMedia.Pause();
  33. }
  34. if( GUI.Button(new Rect(50,650,100,100),"Unload"))
  35. {
  36. scrMedia.UnLoad();
  37. }
  38. }
  39. #endif
  40. }