PDFViewerInternal.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. http://www.cgsoso.com/forum-211-1.html
  3. CG搜搜 Unity3d 每日Unity3d插件免费更新 更有VIP资源!
  4. CGSOSO 主打游戏开发,影视设计等CG资源素材。
  5. 插件如若商用,请务必官网购买!
  6. daily assets update for try.
  7. U should buy the asset from home store if u use it in your project!
  8. */
  9. using UnityEngine;
  10. using UnityEngine.EventSystems;
  11. using UnityEngine.UI;
  12. namespace Paroxe.PdfRenderer.Internal.Viewer
  13. {
  14. public class PDFViewerInternal : UIBehaviour
  15. {
  16. [SerializeField] public RectTransform m_DownloadDialog;
  17. [SerializeField] public Text m_DownloadSourceLabel;
  18. [SerializeField] public bool m_DrawDefaultInspector = false;
  19. [SerializeField] public RectTransform m_HorizontalScrollBar;
  20. [SerializeField] public Image m_InvalidPasswordImage;
  21. [SerializeField] public PDFViewerLeftPanel m_LeftPanel = null;
  22. [SerializeField] public CanvasGroup m_Overlay;
  23. [SerializeField] public RectTransform m_PageContainer;
  24. [SerializeField] public Text m_PageCountLabel;
  25. [SerializeField] public Button m_PageDownButton;
  26. [SerializeField] public InputField m_PageInputField;
  27. [SerializeField] public RawImage m_PageSample;
  28. [SerializeField] public Button m_PageUpButton;
  29. [SerializeField] public Text m_PageZoomLabel;
  30. [SerializeField] public RectTransform m_PasswordDialog;
  31. [SerializeField] public InputField m_PasswordInputField;
  32. [SerializeField] public Text m_ProgressLabel;
  33. [SerializeField] public RectTransform m_ProgressRect;
  34. [SerializeField] public RectTransform m_ScrollCorner;
  35. [SerializeField] public ScrollRect m_ScrollRect;
  36. [SerializeField] public RectTransform m_TopPanel;
  37. [SerializeField] public string m_Version = "2.0";
  38. [SerializeField] public RectTransform m_VerticalScrollBar;
  39. [SerializeField] public RectTransform m_Viewport;
  40. [SerializeField] public RectTransform m_SearchPanel;
  41. #if UNITY_EDITOR
  42. [SerializeField] public bool m_BannerIsOpened = true;
  43. [SerializeField] public bool m_UiShowLoadOptions = true;
  44. [SerializeField] public bool m_UiShowPasswordOptions = true;
  45. [SerializeField] public bool m_UiShowViewerSettings = true;
  46. [SerializeField] public bool m_UiShowSearchSettings = true;
  47. [SerializeField] public bool m_UiShowOtherSettings = true;
  48. [SerializeField] public bool m_UiShowRenderSettings = true;
  49. [SerializeField] public bool m_UiShowDebugSettings = true;
  50. #endif
  51. public PDFViewer m_PDFViewer = null;
  52. public void OnDownloadCancelButtonClicked()
  53. {
  54. if (m_PDFViewer != null)
  55. {
  56. m_PDFViewer.OnDownloadCancelButtonClicked();
  57. }
  58. }
  59. public void OnNextPageButtonClicked()
  60. {
  61. if (m_PDFViewer != null)
  62. {
  63. m_PDFViewer.GoToNextPage();
  64. }
  65. }
  66. public void OnPageIndexEditEnd()
  67. {
  68. if (m_PDFViewer != null)
  69. {
  70. m_PDFViewer.OnPageEditEnd();
  71. }
  72. }
  73. public void OnPasswordDialogCancelButtonClicked()
  74. {
  75. if (m_PDFViewer != null)
  76. {
  77. m_PDFViewer.OnPasswordDialogCancelButtonClicked();
  78. }
  79. }
  80. public void OnPasswordDialogOkButtonClicked()
  81. {
  82. if (m_PDFViewer != null)
  83. {
  84. m_PDFViewer.OnPasswordDialogOkButtonClicked();
  85. }
  86. }
  87. public void OnPreviousPageButtonClicked()
  88. {
  89. if (m_PDFViewer != null)
  90. {
  91. m_PDFViewer.GoToPreviousPage();
  92. }
  93. }
  94. public void OnZoomInButtonClicked()
  95. {
  96. if (m_PDFViewer != null)
  97. {
  98. m_PDFViewer.ZoomIn();
  99. }
  100. }
  101. public void OnZoomOutButtonClicked()
  102. {
  103. if (m_PDFViewer != null)
  104. {
  105. m_PDFViewer.ZoomOut();
  106. }
  107. }
  108. }
  109. }