CartoonNode.cs 590 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. namespace WXB
  6. {
  7. public class CartoonNode : RectNode
  8. {
  9. public Cartoon cartoon;
  10. public override float getWidth()
  11. {
  12. return (int)((width + cartoon.space));
  13. }
  14. protected override void OnRectRender(RenderCache cache, Line line, Rect rect)
  15. {
  16. float space = cartoon.space;
  17. rect.x += space / 2f;
  18. rect.width -= space;
  19. cache.cacheCartoon(line, this, cartoon, rect);
  20. }
  21. };
  22. }