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.

CharacterPartCache.cs 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace UnityEditor.U2D.Animation
  5. {
  6. [Serializable]
  7. internal class CharacterGroupCache : SkinningObject, ICharacterOrder
  8. {
  9. [SerializeField]
  10. public int parentGroup;
  11. [SerializeField]
  12. bool m_IsVisible = true;
  13. [SerializeField]
  14. int m_Order = -1;
  15. public bool isVisible
  16. {
  17. get => m_IsVisible;
  18. set
  19. {
  20. m_IsVisible = value;
  21. skinningCache.GroupVisibilityChanged(this);
  22. }
  23. }
  24. public virtual int order
  25. {
  26. get => m_Order;
  27. set => m_Order = value;
  28. }
  29. }
  30. internal class CharacterPartCache : TransformCache, ICharacterOrder
  31. {
  32. [SerializeField]
  33. SpriteCache m_Sprite;
  34. [SerializeField]
  35. List<BoneCache> m_Bones = new List<BoneCache>();
  36. [SerializeField]
  37. bool m_IsVisible = true;
  38. [SerializeField]
  39. int m_ParentGroup = -1;
  40. [SerializeField]
  41. int m_Order = -1;
  42. public virtual int order
  43. {
  44. get => m_Order;
  45. set => m_Order = value;
  46. }
  47. public int parentGroup
  48. {
  49. get => m_ParentGroup;
  50. set => m_ParentGroup = value;
  51. }
  52. public virtual bool isVisible
  53. {
  54. get => m_IsVisible;
  55. set
  56. {
  57. m_IsVisible = value;
  58. if (skinningCache != null)
  59. skinningCache.SpriteVisibilityChanged(this);
  60. }
  61. }
  62. public int boneCount => m_Bones.Count;
  63. public virtual SpriteCache sprite
  64. {
  65. get => m_Sprite;
  66. set => m_Sprite = value;
  67. }
  68. public virtual BoneCache[] bones
  69. {
  70. get => m_Bones.ToArray();
  71. set => m_Bones = new List<BoneCache>(value);
  72. }
  73. public BoneCache GetBone(int index)
  74. {
  75. return m_Bones[index];
  76. }
  77. public int IndexOf(BoneCache bone)
  78. {
  79. return m_Bones.IndexOf(bone);
  80. }
  81. public bool Contains(BoneCache bone)
  82. {
  83. return m_Bones.Contains(bone);
  84. }
  85. }
  86. }