No Description
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.

TestableImage.cs 788B

12345678910111213141516171819202122232425262728
  1. using NUnit.Framework;
  2. using UnityEngine.UI;
  3. using System.Reflection;
  4. public class TestableImage : Image
  5. {
  6. public bool isOnPopulateMeshCalled = false;
  7. public bool isGeometryUpdated = false;
  8. // Hook into the mesh generation so we can do our check.
  9. protected override void OnPopulateMesh(VertexHelper toFill)
  10. {
  11. base.OnPopulateMesh(toFill);
  12. Assert.That(toFill.currentVertCount, Is.GreaterThan(0), "Expected the mesh to be filled but it was not. Should not have a mesh with zero vertices.");
  13. isOnPopulateMeshCalled = true;
  14. }
  15. protected override void UpdateGeometry()
  16. {
  17. base.UpdateGeometry();
  18. isGeometryUpdated = true;
  19. }
  20. public void GenerateImageData(VertexHelper vh)
  21. {
  22. OnPopulateMesh(vh);
  23. }
  24. }