BatchQuadsSprite.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using CommonUI.Cell;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using UnityEngine;
  7. namespace CommonUnity3D.UGUI
  8. {
  9. public class BatchQuadsSprite : DisplayNode
  10. {
  11. private readonly BatchQuadsGraphics mGFX;
  12. public BatchQuadsSprite(string name = "") : base(name)
  13. {
  14. this.mGFX = mGameObject.AddComponent<BatchQuadsGraphics>();
  15. this.Enable = false;
  16. this.EnableChildren = false;
  17. }
  18. public BatchQuadsGraphics Graphics { get { return mGFX; } }
  19. public CommonUI.Cell.CPJAtlas Atlas
  20. {
  21. get { return mGFX.Atlas; }
  22. set { mGFX.Atlas = value; }
  23. }
  24. public BatchQuadsGraphics.BatchImageQuad[] Quads
  25. {
  26. get { return mGFX.Quads; }
  27. }
  28. public int QuadsCount
  29. {
  30. get { return mGFX.QuadsCount; }
  31. }
  32. public BatchQuadsGraphics.BatchImageQuad GetQuad(int i)
  33. {
  34. return mGFX.GetQuad(i);
  35. }
  36. public void SetQuadVisible(int i, bool visible)
  37. {
  38. mGFX.SetQuadVisible(i, visible);
  39. }
  40. public void SetQuad(int i, BatchQuadsGraphics.BatchImageQuad quad)
  41. {
  42. mGFX.SetQuad(i, quad);
  43. }
  44. public int AddQuad(BatchQuadsGraphics.BatchImageQuad qd)
  45. {
  46. return mGFX.AddQuad(qd);
  47. }
  48. public int AddQuad(int index)
  49. {
  50. return mGFX.AddQuad(index);
  51. }
  52. public int AddQuad(int index, CommonUI.Data.ImageAnchor anchor, Vector2 pivot, Vector2 offset, Vector2 scale, float rotate)
  53. {
  54. return mGFX.AddQuad(index, anchor, pivot, offset, scale, rotate);
  55. }
  56. public int AddQuadImageFont(string text)
  57. {
  58. return mGFX.AddQuadImageFont(text);
  59. }
  60. public int AddQuadImageFont(string text, CommonUI.Data.ImageAnchor anchor, Vector2 pivot, Vector2 offset, Vector2 scale, float rotate)
  61. {
  62. return mGFX.AddQuadImageFont(text, anchor, pivot, offset, scale, rotate);
  63. }
  64. public int AddQuadByKey(string key, CommonUI.Data.ImageAnchor anchor, Vector2 pivot, Vector2 offset, Vector2 scale, float rotate)
  65. {
  66. return mGFX.AddQuadByKey(key, anchor, pivot, offset, scale, rotate);
  67. }
  68. public void ClearQuads()
  69. {
  70. mGFX.ClearQuads();
  71. }
  72. }
  73. }