ProgressVideo.cs 750 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using SC.InputSystem;
  4. using UnityEngine;
  5. using UnityEngine.Video;
  6. public class ProgressVideo : ProgressEdit
  7. {
  8. public VideoPlayer vp;
  9. public void Update()
  10. {
  11. if(!isClick&& vp!=null&& !isDelay)
  12. {
  13. float f = float.Parse(vp.frame.ToString()) / float.Parse(vp.frameCount.ToString());
  14. setValue(f);
  15. }
  16. }
  17. private bool isDelay;
  18. public override void ChangeValue(float f)
  19. {
  20. isDelay = true;
  21. vp.frame = long.Parse((f * vp.frameCount).ToString("0."));
  22. vp.Play();
  23. Invoke("isEnd",1f);
  24. base.ChangeValue(f);
  25. }
  26. void isEnd()
  27. {
  28. isDelay = false;
  29. }
  30. }