RectSpriteNode.cs 750 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. namespace WXB
  4. {
  5. public class RectSpriteNode : NodeBase
  6. {
  7. public Rect rect;
  8. public Sprite sprite;
  9. public Color color;
  10. public override float getHeight()
  11. {
  12. return rect.height;
  13. }
  14. public override float getWidth()
  15. {
  16. return rect.width;
  17. }
  18. public override void render(float maxWidth, RenderCache cache, ref float x, ref uint yline, List<Line> lines, float offsetX, float offsetY)
  19. {
  20. cache.cacheSprite(null, this, sprite, rect);
  21. }
  22. public override void fill(ref Vector2 currentpos, List<Line> Lines, float maxWidth, float pixelsPerUnit)
  23. {
  24. }
  25. };
  26. }