InspectableReactiveProperty.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. using System;
  2. using System.Collections.Generic;
  3. using UniRx.InternalUtil;
  4. using UnityEngine;
  5. namespace UniRx
  6. {
  7. /// <summary>
  8. /// Inspectable ReactiveProperty.
  9. /// </summary>
  10. [Serializable]
  11. public class IntReactiveProperty : ReactiveProperty<int>
  12. {
  13. public IntReactiveProperty()
  14. : base()
  15. {
  16. }
  17. public IntReactiveProperty(int initialValue)
  18. : base(initialValue)
  19. {
  20. }
  21. }
  22. /// <summary>
  23. /// Inspectable ReactiveProperty.
  24. /// </summary>
  25. [Serializable]
  26. public class LongReactiveProperty : ReactiveProperty<long>
  27. {
  28. public LongReactiveProperty()
  29. : base()
  30. {
  31. }
  32. public LongReactiveProperty(long initialValue)
  33. : base(initialValue)
  34. {
  35. }
  36. }
  37. /// <summary>
  38. /// Inspectable ReactiveProperty.
  39. /// </summary>
  40. [Serializable]
  41. public class ByteReactiveProperty : ReactiveProperty<byte>
  42. {
  43. public ByteReactiveProperty()
  44. : base()
  45. {
  46. }
  47. public ByteReactiveProperty(byte initialValue)
  48. : base(initialValue)
  49. {
  50. }
  51. }
  52. /// <summary>
  53. /// Inspectable ReactiveProperty.
  54. /// </summary>
  55. [Serializable]
  56. public class FloatReactiveProperty : ReactiveProperty<float>
  57. {
  58. public FloatReactiveProperty()
  59. : base()
  60. {
  61. }
  62. public FloatReactiveProperty(float initialValue)
  63. : base(initialValue)
  64. {
  65. }
  66. }
  67. /// <summary>
  68. /// Inspectable ReactiveProperty.
  69. /// </summary>
  70. [Serializable]
  71. public class DoubleReactiveProperty : ReactiveProperty<double>
  72. {
  73. public DoubleReactiveProperty()
  74. : base()
  75. {
  76. }
  77. public DoubleReactiveProperty(double initialValue)
  78. : base(initialValue)
  79. {
  80. }
  81. }
  82. /// <summary>
  83. /// Inspectable ReactiveProperty.
  84. /// </summary>
  85. [Serializable]
  86. public class StringReactiveProperty : ReactiveProperty<string>
  87. {
  88. public StringReactiveProperty()
  89. : base()
  90. {
  91. }
  92. public StringReactiveProperty(string initialValue)
  93. : base(initialValue)
  94. {
  95. }
  96. }
  97. /// <summary>
  98. /// Inspectable ReactiveProperty.
  99. /// </summary>
  100. [Serializable]
  101. public class BoolReactiveProperty : ReactiveProperty<bool>
  102. {
  103. public BoolReactiveProperty()
  104. : base()
  105. {
  106. }
  107. public BoolReactiveProperty(bool initialValue)
  108. : base(initialValue)
  109. {
  110. }
  111. }
  112. /// <summary>Inspectable ReactiveProperty.</summary>
  113. [Serializable]
  114. public class Vector2ReactiveProperty : ReactiveProperty<Vector2>
  115. {
  116. public Vector2ReactiveProperty()
  117. {
  118. }
  119. public Vector2ReactiveProperty(Vector2 initialValue)
  120. : base(initialValue)
  121. {
  122. }
  123. protected override IEqualityComparer<Vector2> EqualityComparer
  124. {
  125. get
  126. {
  127. return UnityEqualityComparer.Vector2;
  128. }
  129. }
  130. }
  131. /// <summary>Inspectable ReactiveProperty.</summary>
  132. [Serializable]
  133. public class Vector3ReactiveProperty : ReactiveProperty<Vector3>
  134. {
  135. public Vector3ReactiveProperty()
  136. {
  137. }
  138. public Vector3ReactiveProperty(Vector3 initialValue)
  139. : base(initialValue)
  140. {
  141. }
  142. protected override IEqualityComparer<Vector3> EqualityComparer
  143. {
  144. get
  145. {
  146. return UnityEqualityComparer.Vector3;
  147. }
  148. }
  149. }
  150. /// <summary>Inspectable ReactiveProperty.</summary>
  151. [Serializable]
  152. public class Vector4ReactiveProperty : ReactiveProperty<Vector4>
  153. {
  154. public Vector4ReactiveProperty()
  155. {
  156. }
  157. public Vector4ReactiveProperty(Vector4 initialValue)
  158. : base(initialValue)
  159. {
  160. }
  161. protected override IEqualityComparer<Vector4> EqualityComparer
  162. {
  163. get
  164. {
  165. return UnityEqualityComparer.Vector4;
  166. }
  167. }
  168. }
  169. /// <summary>Inspectable ReactiveProperty.</summary>
  170. [Serializable]
  171. public class ColorReactiveProperty : ReactiveProperty<Color>
  172. {
  173. public ColorReactiveProperty()
  174. {
  175. }
  176. public ColorReactiveProperty(Color initialValue)
  177. : base(initialValue)
  178. {
  179. }
  180. protected override IEqualityComparer<Color> EqualityComparer
  181. {
  182. get
  183. {
  184. return UnityEqualityComparer.Color;
  185. }
  186. }
  187. }
  188. /// <summary>Inspectable ReactiveProperty.</summary>
  189. [Serializable]
  190. public class RectReactiveProperty : ReactiveProperty<Rect>
  191. {
  192. public RectReactiveProperty()
  193. {
  194. }
  195. public RectReactiveProperty(Rect initialValue)
  196. : base(initialValue)
  197. {
  198. }
  199. protected override IEqualityComparer<Rect> EqualityComparer
  200. {
  201. get
  202. {
  203. return UnityEqualityComparer.Rect;
  204. }
  205. }
  206. }
  207. /// <summary>Inspectable ReactiveProperty.</summary>
  208. [Serializable]
  209. public class AnimationCurveReactiveProperty : ReactiveProperty<AnimationCurve>
  210. {
  211. public AnimationCurveReactiveProperty()
  212. {
  213. }
  214. public AnimationCurveReactiveProperty(AnimationCurve initialValue)
  215. : base(initialValue)
  216. {
  217. }
  218. }
  219. /// <summary>Inspectable ReactiveProperty.</summary>
  220. [Serializable]
  221. public class BoundsReactiveProperty : ReactiveProperty<Bounds>
  222. {
  223. public BoundsReactiveProperty()
  224. {
  225. }
  226. public BoundsReactiveProperty(Bounds initialValue)
  227. : base(initialValue)
  228. {
  229. }
  230. protected override IEqualityComparer<Bounds> EqualityComparer
  231. {
  232. get
  233. {
  234. return UnityEqualityComparer.Bounds;
  235. }
  236. }
  237. }
  238. /// <summary>Inspectable ReactiveProperty.</summary>
  239. [Serializable]
  240. public class QuaternionReactiveProperty : ReactiveProperty<Quaternion>
  241. {
  242. public QuaternionReactiveProperty()
  243. {
  244. }
  245. public QuaternionReactiveProperty(Quaternion initialValue)
  246. : base(initialValue)
  247. {
  248. }
  249. protected override IEqualityComparer<Quaternion> EqualityComparer
  250. {
  251. get
  252. {
  253. return UnityEqualityComparer.Quaternion;
  254. }
  255. }
  256. }
  257. }