暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Reflection;
  4. using UnityEngine;
  5. namespace UnityEngine.UI.Tests
  6. {
  7. // Hook into the graphic callback so we can do our check.
  8. public class ImageHook : Image
  9. {
  10. public bool isGeometryUpdated;
  11. public bool isLayoutRebuild;
  12. public bool isMaterialRebuilt;
  13. public Rect cachedClipRect;
  14. public void ResetTest()
  15. {
  16. isGeometryUpdated = false;
  17. isLayoutRebuild = false;
  18. isMaterialRebuilt = false;
  19. }
  20. public override void SetLayoutDirty()
  21. {
  22. base.SetLayoutDirty();
  23. isLayoutRebuild = true;
  24. }
  25. public override void SetMaterialDirty()
  26. {
  27. base.SetMaterialDirty();
  28. isMaterialRebuilt = true;
  29. }
  30. protected override void UpdateGeometry()
  31. {
  32. base.UpdateGeometry();
  33. isGeometryUpdated = true;
  34. }
  35. public override void SetClipRect(Rect clipRect, bool validRect)
  36. {
  37. cachedClipRect = clipRect;
  38. if (validRect)
  39. canvasRenderer.EnableRectClipping(clipRect);
  40. else
  41. canvasRenderer.DisableRectClipping();
  42. }
  43. }
  44. }