MedaiPlayerSampleSphereGUI.cs 937 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. void OnGUI() {
  17. if( GUI.Button(new Rect(50,50,100,100),"Load"))
  18. {
  19. scrMedia.Load("EasyMovieTexture.mp4");
  20. }
  21. if( GUI.Button(new Rect(50,200,100,100),"Play"))
  22. {
  23. scrMedia.Play();
  24. }
  25. if( GUI.Button(new Rect(50,350,100,100),"stop"))
  26. {
  27. scrMedia.Stop();
  28. }
  29. if( GUI.Button(new Rect(50,500,100,100),"pause"))
  30. {
  31. scrMedia.Pause();
  32. }
  33. if( GUI.Button(new Rect(50,650,100,100),"Unload"))
  34. {
  35. scrMedia.UnLoad();
  36. }
  37. }
  38. }