OnaholeChuBlipDevice.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class OnaholeChuBlipDevice : MonoBehaviour
  5. {
  6. public long rawArrowUp { get; private set; }
  7. public long rawArrowDown { get; private set; }
  8. public long rawArrowRight { get; private set; }
  9. public long rawArrowLeft { get; private set; }
  10. public long beforeRawArrowUp { get; private set; }
  11. public long beforeRawArrowDown { get; private set; }
  12. public long beforeRawArrowRight { get; private set; }
  13. public long beforeRawArrowLeft { get; private set; }
  14. public float arrowKeyFierceRate
  15. {
  16. get
  17. {
  18. return this.m_ArrowKeyFierceRate;
  19. }
  20. private set
  21. {
  22. this.m_ArrowKeyFierceRate = Mathf.Clamp(value, 0f, 1f);
  23. }
  24. }
  25. public float arrowUp
  26. {
  27. get
  28. {
  29. return (float)this.rawArrowUp * 1.52590219E-05f;
  30. }
  31. }
  32. public float arrowDown
  33. {
  34. get
  35. {
  36. return (float)this.rawArrowDown * 1.52590219E-05f;
  37. }
  38. }
  39. public float arrowRight
  40. {
  41. get
  42. {
  43. return (float)this.rawArrowRight * 1.52590219E-05f;
  44. }
  45. }
  46. public float arrowLeft
  47. {
  48. get
  49. {
  50. return (float)this.rawArrowLeft * 1.52590219E-05f;
  51. }
  52. }
  53. public long rawVertical
  54. {
  55. get
  56. {
  57. return this.rawArrowUp - this.rawArrowDown;
  58. }
  59. }
  60. public long rawHorizontal
  61. {
  62. get
  63. {
  64. return this.rawArrowRight - this.rawArrowLeft;
  65. }
  66. }
  67. public float vertical
  68. {
  69. get
  70. {
  71. return (float)this.rawVertical * 1.52590219E-05f;
  72. }
  73. }
  74. public float horizontal
  75. {
  76. get
  77. {
  78. return (float)this.rawHorizontal * 1.52590219E-05f;
  79. }
  80. }
  81. public Vector2 inputVec
  82. {
  83. get
  84. {
  85. return new Vector2(this.vertical, this.horizontal);
  86. }
  87. }
  88. public float beforeArrowUp
  89. {
  90. get
  91. {
  92. return (float)this.beforeRawArrowUp * 1.52590219E-05f;
  93. }
  94. }
  95. public float beforeArrowDown
  96. {
  97. get
  98. {
  99. return (float)this.beforeRawArrowDown * 1.52590219E-05f;
  100. }
  101. }
  102. public float beforeArrowRight
  103. {
  104. get
  105. {
  106. return (float)this.beforeRawArrowRight * 1.52590219E-05f;
  107. }
  108. }
  109. public float beforeArrowLeft
  110. {
  111. get
  112. {
  113. return (float)this.beforeRawArrowLeft * 1.52590219E-05f;
  114. }
  115. }
  116. public long beforeRawVertical
  117. {
  118. get
  119. {
  120. return this.beforeRawArrowUp - this.beforeRawArrowDown;
  121. }
  122. }
  123. public long beforeRawHorizontal
  124. {
  125. get
  126. {
  127. return this.beforeRawArrowRight - this.beforeRawArrowLeft;
  128. }
  129. }
  130. public float beforeVertical
  131. {
  132. get
  133. {
  134. return (float)this.beforeRawVertical * 1.52590219E-05f;
  135. }
  136. }
  137. public float beforeHorizontal
  138. {
  139. get
  140. {
  141. return (float)this.beforeRawHorizontal * 1.52590219E-05f;
  142. }
  143. }
  144. public Vector2 beforeInputVec
  145. {
  146. get
  147. {
  148. return new Vector2(this.beforeVertical, this.beforeHorizontal);
  149. }
  150. }
  151. private Dictionary<string, float> data_dic_ = new Dictionary<string, float>();
  152. private float insertDepth;
  153. private float pistonSpeed;
  154. private float pistonSpeedUpdateTime;
  155. private float calcPistonSpeed;
  156. private float beforeInsertDepth;
  157. private float beforeInsertDir;
  158. private float updateStroke;
  159. private float stroke;
  160. private float pistonSmooth = 0.75f;
  161. private int dir;
  162. private float decisionInsertDepth;
  163. private float testDepth;
  164. private bool buttonA;
  165. private bool buttonB;
  166. private bool buttonC;
  167. private bool beforeButtonA;
  168. private bool beforeButtonB;
  169. private bool beforeButtonC;
  170. private float m_ArrowKeyFierceRate;
  171. public const float RECIPROCAL_ARROW_VALUE = 1.52590219E-05f;
  172. public static readonly float ArrowThreshold = 0.5f;
  173. }