PDFViewerLeftPanelScrollbar.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 PDFViewerLeftPanelScrollbar : UIBehaviour
  15. {
  16. private CanvasGroup m_CanvasGroup;
  17. private Scrollbar m_Scrollbar;
  18. void LateUpdate()
  19. {
  20. if (m_Scrollbar.size >= 0.98f && m_CanvasGroup.alpha != 0.0f)
  21. {
  22. m_CanvasGroup.alpha = 0.0f;
  23. }
  24. else if (m_Scrollbar.size < 0.98f && m_CanvasGroup.alpha != 1.0f)
  25. {
  26. m_CanvasGroup.alpha = 1.0f;
  27. }
  28. }
  29. protected override void OnEnable()
  30. {
  31. m_Scrollbar = GetComponent<Scrollbar>();
  32. m_CanvasGroup = GetComponent<CanvasGroup>();
  33. }
  34. }
  35. }