AttachEntityInfo.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 loyalsoft. All rights reserved.
  4. // Homepage: http://www.game7000.com/
  5. // Feedback: http://www.game7000.com/
  6. //------------------------------------------------------------
  7. using GameFramework;
  8. using UnityEngine;
  9. namespace UnityGameFramework.Runtime
  10. {
  11. internal sealed class AttachEntityInfo : IReference
  12. {
  13. private Transform m_ParentTransform;
  14. private object m_UserData;
  15. public AttachEntityInfo()
  16. {
  17. m_ParentTransform = null;
  18. m_UserData = null;
  19. }
  20. public Transform ParentTransform
  21. {
  22. get
  23. {
  24. return m_ParentTransform;
  25. }
  26. }
  27. public object UserData
  28. {
  29. get
  30. {
  31. return m_UserData;
  32. }
  33. }
  34. public static AttachEntityInfo Create(Transform parentTransform, object userData)
  35. {
  36. AttachEntityInfo attachEntityInfo = ReferencePool.Acquire<AttachEntityInfo>();
  37. attachEntityInfo.m_ParentTransform = parentTransform;
  38. attachEntityInfo.m_UserData = userData;
  39. return attachEntityInfo;
  40. }
  41. public void Clear()
  42. {
  43. m_ParentTransform = null;
  44. m_UserData = null;
  45. }
  46. }
  47. }