NRTrackableBehaviour.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /****************************************************************************
  2. * Copyright 2019 Nreal Techonology Limited. All rights reserved.
  3. *
  4. * This file is part of NRSDK.
  5. *
  6. * https://www.nreal.ai/
  7. *
  8. *****************************************************************************/
  9. namespace NRKernal
  10. {
  11. using UnityEngine;
  12. /// <summary> Base classes for all trackable monobehaviour objects. </summary>
  13. public class NRTrackableBehaviour : MonoBehaviour
  14. {
  15. /// <summary> The trackable. </summary>
  16. public NRTrackable Trackable;
  17. /// <summary> Initializes this object. </summary>
  18. /// <param name="trackable"> The trackable.</param>
  19. public void Initialize(NRTrackable trackable)
  20. {
  21. Trackable = trackable;
  22. }
  23. /// <summary> Name of the trackable. </summary>
  24. [HideInInspector, SerializeField]
  25. protected string m_TrackableName = "";
  26. /// <summary> True to preserve child size. </summary>
  27. [HideInInspector, SerializeField]
  28. protected bool m_PreserveChildSize;
  29. /// <summary> True to initialized in editor. </summary>
  30. [HideInInspector, SerializeField]
  31. protected bool m_InitializedInEditor;
  32. /// <summary> Zero-based index of the database. </summary>
  33. [HideInInspector, SerializeField]
  34. protected int m_DatabaseIndex = -1;
  35. /// <summary> Gets or sets the name of the trackable. </summary>
  36. /// <value> The name of the trackable. </value>
  37. public string TrackableName
  38. {
  39. get
  40. {
  41. return m_TrackableName;
  42. }
  43. set
  44. {
  45. m_TrackableName = value;
  46. }
  47. }
  48. /// <summary> Gets or sets a value indicating whether the preserve child size. </summary>
  49. /// <value> True if preserve child size, false if not. </value>
  50. public bool PreserveChildSize
  51. {
  52. get
  53. {
  54. return m_PreserveChildSize;
  55. }
  56. set
  57. {
  58. m_PreserveChildSize = value;
  59. }
  60. }
  61. /// <summary> Gets or sets a value indicating whether the initialized in editor. </summary>
  62. /// <value> True if initialized in editor, false if not. </value>
  63. public bool InitializedInEditor
  64. {
  65. get
  66. {
  67. return m_InitializedInEditor;
  68. }
  69. set
  70. {
  71. m_InitializedInEditor = value;
  72. }
  73. }
  74. /// <summary> Gets or sets the zero-based index of the database. </summary>
  75. /// <value> The database index. </value>
  76. public int DatabaseIndex
  77. {
  78. get
  79. {
  80. return m_DatabaseIndex;
  81. }
  82. set
  83. {
  84. m_DatabaseIndex = value;
  85. }
  86. }
  87. }
  88. }