Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. public IEnumerator LoadClick(RaycastResult result, VRTK_UIPointer pointer)
  2. {
  3. float time = 0;
  4. while (time < loadingTime)
  5. {
  6. time += Time.deltaTime;
  7. progressBar.GetComponent<Image>().fillAmount = time / loadingTime;
  8. yield return null;
  9. }
  10. m(result, pointer);
  11.  
  12. }
  13.  
  14. private void m(RaycastResult result, VRTK_UIPointer pointer)
  15. {
  16. progressBar.GetComponent<Image>().fillAmount = 1;
  17. var target = ExecuteEvents.ExecuteHierarchy(result.gameObject, pointer.pointerEventData, ExecuteEvents.pointerDownHandler);
  18. m2(result, pointer, target);
  19. progressBar.GetComponent<Image>().fillAmount = 0;
  20. }
  21.  
  22. private static void m2(RaycastResult result, VRTK_UIPointer pointer, GameObject target)
  23. {
  24. if (target != null)
  25. {
  26. pointer.pointerEventData.pressPosition = pointer.pointerEventData.position;
  27. pointer.pointerEventData.pointerPressRaycast = result;
  28. pointer.pointerEventData.pointerPress = target;
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement