PlaySoundInfo.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 PlaySoundInfo : IReference
  12. {
  13. private Entity m_BindingEntity;
  14. private Vector3 m_WorldPosition;
  15. private object m_UserData;
  16. public PlaySoundInfo()
  17. {
  18. m_BindingEntity = null;
  19. m_WorldPosition = Vector3.zero;
  20. m_UserData = null;
  21. }
  22. public Entity BindingEntity
  23. {
  24. get
  25. {
  26. return m_BindingEntity;
  27. }
  28. }
  29. public Vector3 WorldPosition
  30. {
  31. get
  32. {
  33. return m_WorldPosition;
  34. }
  35. }
  36. public object UserData
  37. {
  38. get
  39. {
  40. return m_UserData;
  41. }
  42. }
  43. public static PlaySoundInfo Create(Entity bindingEntity, Vector3 worldPosition, object userData)
  44. {
  45. PlaySoundInfo playSoundInfo = ReferencePool.Acquire<PlaySoundInfo>();
  46. playSoundInfo.m_BindingEntity = bindingEntity;
  47. playSoundInfo.m_WorldPosition = worldPosition;
  48. playSoundInfo.m_UserData = userData;
  49. return playSoundInfo;
  50. }
  51. public void Clear()
  52. {
  53. m_BindingEntity = null;
  54. m_WorldPosition = Vector3.zero;
  55. m_UserData = null;
  56. }
  57. }
  58. }