PDFThumbnailItem.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 PDFThumbnailItem : UIBehaviour
  15. {
  16. public AspectRatioFitter m_AspectRatioFitter;
  17. public Image m_Highlighted;
  18. public LayoutElement m_LayoutElement;
  19. public Text m_PageIndexLabel;
  20. public RawImage m_PageThumbnailRawImage;
  21. public RectTransform m_RectTransform;
  22. public void LateUpdate()
  23. {
  24. m_LayoutElement.preferredHeight = 180.0f*(m_RectTransform.sizeDelta.x/320.0f);
  25. }
  26. public void OnThumbnailClicked()
  27. {
  28. GetComponentInParent<PDFViewer>().GoToPage(int.Parse(m_PageIndexLabel.text) - 1);
  29. }
  30. }
  31. }