Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1.  
  2.  
  3. // MENU THUMBNAILS.Cs
  4. public void PrintButton(MagazineResourcesManager mrm)
  5. {
  6. var url = mrm.ReturnPDFUrl ();
  7. if (url.Equals (""))
  8. Debug.Log ("No se ha especificado la URL del pdf a imprimir");
  9. else
  10. Application.OpenURL(url); //URL DEL VIDEO
  11. }
  12. public void ToggleVideoPages(MagazineResourcesManager mrm)
  13. {
  14. int children = thumb.gameObject.transform.childCount;
  15.  
  16.  
  17. List<GameObject> videopages = mrm.ReturnVideoPages ();
  18. if (!_onlyvid) {
  19. //Desactivamos todos
  20. for (int i = 0; i < children; i++)
  21. {
  22. thumb.gameObject.transform.GetChild(i).gameObject.SetActive(false);
  23. }
  24. //Activamos los que tengamos el indice
  25. for(int vid = 0; vid < videopages.Count; vid++)
  26. {
  27. int index = int.Parse(videopages[vid].name.Substring(4));
  28. thumb.gameObject.transform.GetChild(index).gameObject.SetActive(true);
  29.  
  30. }
  31.  
  32.  
  33. _onlyvid = true;
  34. videoImg.color = _on;
  35. // Mostrar solo las paginas con videos
  36.  
  37. } else {
  38. for (int i = 0; i < children; i++)
  39. {
  40. thumb.gameObject.transform.GetChild(i).gameObject.SetActive(true);
  41. }
  42. _onlyvid = false;
  43. videoImg.color = _off;
  44.  
  45. //Mostrar todas las paginas
  46.  
  47. }
  48. }
  49.  
  50. MAGAZINE RESOUCESMANAGER
  51.  
  52. Line 220:
  53. videopages.Add(p.gameObject);
  54. // <summary>
  55. /// Devuelve la URL del PDF a Imprimir
  56. /// </summary>
  57. /// <returns>The PDF URL.</returns>
  58. public string ReturnPDFUrl()
  59. {
  60. return Application.persistentDataPath + issueName + "/Resources/" + issueName + ".pdf";
  61. }
  62.  
  63.  
  64. /// <summary>
  65. /// Devuelve una lista con las paginas 'hijo' que tiene el recurso video.
  66. /// </summary>
  67. /// <returns>The video pages.</returns>
  68. public List<GameObject> ReturnVideoPages()
  69. {
  70. return videopages;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement