Advertisement
NPSF3000

CachedMB

Apr 1st, 2012
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class CachedMB : MonoBehaviour
  4. {
  5.  
  6.  
  7. Transform _transform;
  8. public Transform transform
  9. {
  10. get { return _transform ?? (_transform = base.transform); }
  11. }
  12.  
  13.  
  14. //for testing
  15. public Transform uncachedTransform
  16. {
  17. get { return base.transform; }
  18. }
  19.  
  20. Rigidbody _rigidbody;
  21. public Rigidbody rigidbody
  22. {
  23. get { return _rigidbody ?? (_rigidbody = base.rigidbody); }
  24. }
  25.  
  26. Camera _camera;
  27. public Camera camera
  28. {
  29. get { return _camera ?? (_camera = base.camera); }
  30. }
  31.  
  32. Light _light;
  33. public Light light
  34. {
  35. get { return _light ?? (_light = base.light); }
  36. }
  37.  
  38. private Animation _animation;
  39. public Animation animation
  40. {
  41. get { return _animation ?? (_animation = base.animation); }
  42. }
  43.  
  44.  
  45. private ConstantForce _constantForce;
  46. public ConstantForce constantForce
  47. {
  48. get { return _constantForce ?? (_constantForce = base.constantForce); }
  49. }
  50.  
  51. private Renderer _renderer;
  52. public Renderer renderer
  53. {
  54. get { return _renderer ?? (_renderer = base.renderer); }
  55. }
  56.  
  57. private AudioSource _audio;
  58. public AudioSource audio
  59. {
  60. get { return _audio ?? (_audio = base.audio); }
  61. }
  62.  
  63.  
  64. private GUIText _guiText;
  65. public GUIText guiText
  66. {
  67. get { return _guiText ?? (_guiText = base.guiText); }
  68. }
  69.  
  70.  
  71. private GUITexture _guiTexture;
  72. public GUITexture guiTexture
  73. {
  74. get { return _guiTexture ?? (_guiTexture = base.guiTexture); }
  75. }
  76.  
  77.  
  78. private NetworkView _networkView;
  79. public NetworkView networkView
  80. {
  81. get { return _networkView ?? (_networkView = base.networkView); }
  82. }
  83.  
  84.  
  85. private Collider _collider;
  86. public Collider collider
  87. {
  88. get { return _collider ?? (_collider = base.collider); }
  89. }
  90.  
  91.  
  92. private HingeJoint _hingeJoint;
  93. public HingeJoint hingeJoint
  94. {
  95. get { return _hingeJoint ?? (_hingeJoint = base.hingeJoint); }
  96. }
  97.  
  98.  
  99. private ParticleEmitter _particleEmitter;
  100. public ParticleEmitter particleEmitter
  101. {
  102. get { return _particleEmitter ?? (_particleEmitter = base.particleEmitter); }
  103. }
  104.  
  105.  
  106. private ParticleSystem _particleSystem;
  107. public ParticleSystem particleSystem
  108. {
  109. get { return _particleSystem ?? (_particleSystem = base.particleSystem); }
  110. }
  111.  
  112.  
  113. private GameObject _gameObject;
  114. public GameObject gameObject
  115. {
  116. get { return _gameObject ?? (_gameObject = base.gameObject); }
  117. }
  118.  
  119.  
  120. private string _tag;
  121. public string tag
  122. {
  123. get { return _tag ?? (_tag = base.tag); }
  124. set { _tag = value; base.tag = value; }
  125. }
  126.  
  127.  
  128. private string _name;
  129. public string name
  130. {
  131. get { return _name ?? (_name = base.name); }
  132. set { _tag = value; base.tag = value; }
  133. }
  134.  
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement