OvrCamera.cs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.VR;
  6. public class OvrCamera : CameraMain
  7. {
  8. public float MoveSpeedAccel
  9. {
  10. get
  11. {
  12. return (0.05f + 0.9f * GameMain.Instance.CMSystem.VRCameraMoveSpeedKey) / 0.5f * 1.5f;
  13. }
  14. }
  15. public float RotSpeedAccel
  16. {
  17. get
  18. {
  19. return (0.05f + 0.9f * GameMain.Instance.CMSystem.VRCameraRotSpeedKey) / 0.5f;
  20. }
  21. }
  22. public float RotMouseSpeedAccel
  23. {
  24. get
  25. {
  26. return (0.05f + 0.9f * GameMain.Instance.CMSystem.VRCameraRotSpeedMouse) / 0.5f;
  27. }
  28. }
  29. public override bool IsBloomEnabled
  30. {
  31. get
  32. {
  33. return this.m_BloomOVR.enabled;
  34. }
  35. }
  36. public AVRControllerButtons GetVRControllerButtons(bool f_bLeft)
  37. {
  38. return (!f_bLeft) ? this.m_VRCtrlRight.VRControllerButtons : this.m_VRCtrlLeft.VRControllerButtons;
  39. }
  40. public OvrTablet OvrTablet
  41. {
  42. get
  43. {
  44. return this.m_OvrTablet;
  45. }
  46. }
  47. public bool IsUIShow
  48. {
  49. get
  50. {
  51. return this.m_bUiToggle;
  52. }
  53. }
  54. public VREventText OvrEventText
  55. {
  56. get
  57. {
  58. return this.m_VREvnetText;
  59. }
  60. }
  61. public OvrEyeRay EyeRay
  62. {
  63. get
  64. {
  65. return this.m_EyeRay;
  66. }
  67. }
  68. public bool IsHandCameraMode
  69. {
  70. get
  71. {
  72. return this.m_VRCtrlLeft.IsHandCameraMode || this.m_VRCtrlRight.IsHandCameraMode;
  73. }
  74. }
  75. public bool IsHandPenMode
  76. {
  77. get
  78. {
  79. return this.m_VRCtrlLeft.IsHandPenMode || this.m_VRCtrlRight.IsHandPenMode;
  80. }
  81. }
  82. public virtual bool IsNoHandController
  83. {
  84. get
  85. {
  86. return GameMain.Instance.VRDeviceTypeID != GameMain.VRDeviceType.RIFT_TOUCH && GameMain.Instance.VRDeviceTypeID != GameMain.VRDeviceType.VIVE;
  87. }
  88. }
  89. public virtual AVRControllerBehavior.LIMIT_MODE HandLimitMode
  90. {
  91. get
  92. {
  93. return this.m_eHandLimitMode;
  94. }
  95. set
  96. {
  97. AVRController vrctrlLeft = this.m_VRCtrlLeft;
  98. this.m_eHandLimitMode = value;
  99. this.m_VRCtrlRight.HandLimitMode = value;
  100. vrctrlLeft.HandLimitMode = value;
  101. }
  102. }
  103. public virtual bool HandDanceMode
  104. {
  105. get
  106. {
  107. return this.m_VRCtrlLeft.HandDanceMode && this.m_VRCtrlRight.HandDanceMode;
  108. }
  109. set
  110. {
  111. AVRController vrctrlLeft = this.m_VRCtrlLeft;
  112. this.m_VRCtrlRight.HandDanceMode = value;
  113. vrctrlLeft.HandDanceMode = value;
  114. }
  115. }
  116. public virtual bool HandVRIKMode
  117. {
  118. get
  119. {
  120. return this.m_VRCtrlLeft.HandVRIKMode && this.m_VRCtrlRight.HandVRIKMode;
  121. }
  122. set
  123. {
  124. AVRController vrctrlLeft = this.m_VRCtrlLeft;
  125. this.m_VRCtrlRight.HandVRIKMode = value;
  126. vrctrlLeft.HandVRIKMode = value;
  127. }
  128. }
  129. public virtual bool HandYotogiMode
  130. {
  131. get
  132. {
  133. return this.m_VRCtrlLeft.HandYotogiMode && this.m_VRCtrlRight.HandYotogiMode;
  134. }
  135. set
  136. {
  137. AVRController vrctrlLeft = this.m_VRCtrlLeft;
  138. this.m_VRCtrlRight.HandYotogiMode = value;
  139. vrctrlLeft.HandYotogiMode = value;
  140. }
  141. }
  142. public bool IsForceRightClickUiToggle
  143. {
  144. get
  145. {
  146. return this.m_bIsForceRightClickUiToggle;
  147. }
  148. set
  149. {
  150. this.m_bIsForceRightClickUiToggle = value;
  151. }
  152. }
  153. public bool HandModelVisible
  154. {
  155. set
  156. {
  157. AVRController vrctrlLeft = this.m_VRCtrlLeft;
  158. this.m_VRCtrlRight.HandModelVisible = value;
  159. vrctrlLeft.HandModelVisible = value;
  160. }
  161. }
  162. public bool IsControllerModeNew
  163. {
  164. get
  165. {
  166. return this.m_bControllerModeNew;
  167. }
  168. }
  169. protected override void Awake()
  170. {
  171. this.m_goCenterEye = UTY.GetChildObject(base.gameObject, "TrackingSpace/CenterEyeAnchor", false);
  172. this.m_trCenterEye = this.m_goCenterEye.transform;
  173. this.m_trRealHead = this.m_trCenterEye;
  174. this.m_nBackCullingMask = this.m_goCenterEye.GetComponent<Camera>().cullingMask;
  175. this.m_FadeTargetCameraOVR = this.m_goCenterEye.GetComponent<ScreenOverlay>();
  176. this.m_BloomOVR = this.m_goCenterEye.GetComponent<Bloom>();
  177. this.m_fBloomDefIntensity = this.m_BloomOVR.bloomIntensity;
  178. this.m_trTarget = new GameObject("OVRCamTarget").transform;
  179. this.m_trTarget.SetParent(GameMain.Instance.transform, false);
  180. this.m_trVirtualMy = new GameObject("OVRCamMy").transform;
  181. this.m_trVirtualMy.SetParent(GameMain.Instance.transform, false);
  182. GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("OVR/OvrHeadScale")) as GameObject;
  183. gameObject.SetActive(true);
  184. GameObject gameObject2 = GameObject.Find("SystemUI Root");
  185. gameObject.transform.SetParent(gameObject2.transform, false);
  186. this.m_labelHeadScale = gameObject.GetComponentInChildren<UILabel>();
  187. this.m_labelHeadScale.enabled = false;
  188. this.m_goOvrUiScreen = UTY.GetChildObject(this.m_goCenterEye, "UI", false);
  189. this.m_goOvrUiTablet = UTY.GetChildObject(base.gameObject, "TrackingSpace/Odogu_TabletPC", false);
  190. this.m_trOvrUiTablet = this.m_goOvrUiTablet.transform;
  191. this.m_OvrTablet = this.m_goOvrUiTablet.GetComponent<OvrTablet>();
  192. this.m_OvrTablet.Init(this.m_goCenterEye);
  193. Vignetting vignetting = base.gameObject.AddComponent<Vignetting>();
  194. vignetting.enabled = false;
  195. Camera component = base.gameObject.GetComponent<Camera>();
  196. component.enabled = false;
  197. this.m_trBaseHead = new GameObject("OvrCamBaseHead").transform;
  198. this.m_trBaseHead.SetParent(GameMain.Instance.transform, false);
  199. this.m_trBaseRoomBase = new GameObject("BaseRoomBase").transform;
  200. this.m_trBaseRoomBase.SetParent(this.m_trBaseHead, false);
  201. this.m_trCursorLaserHit = this.m_goOvrUiScreen.transform.Find("ovr_screen/hit");
  202. NDebug.Assert(this.m_trCursorLaserHit != null, "UI Cursor Hit オブジェクトが見つかりません。");
  203. float ovrViveCursorLaserHitScale = GameMain.Instance.CMSystem.OvrViveCursorLaserHitScale;
  204. this.m_trCursorLaserHit.localScale = new Vector3(ovrViveCursorLaserHitScale, ovrViveCursorLaserHitScale, ovrViveCursorLaserHitScale);
  205. this.m_VREvnetText = this.m_trCenterEye.Find("VREventText").GetComponent<VREventText>();
  206. Transform transform = base.transform.Find("TrackingSpace/LeftHandAnchor");
  207. Transform transform2 = base.transform.Find("TrackingSpace/RightHandAnchor");
  208. this.m_VRCtrlLeft = transform.GetComponent<OvrController>();
  209. this.m_VRCtrlLeft.Init();
  210. this.m_VRCtrlRight = transform2.GetComponent<OvrController>();
  211. this.m_VRCtrlRight.Init();
  212. Transform transform3 = this.m_trCenterEye.Find("EyeRayCaster");
  213. this.m_EyeRay = transform3.GetComponent<OvrEyeRay>();
  214. NDebug.Assert(this.m_EyeRay != null, "視線検出機構がみつかりません。");
  215. this.m_DummyHand = base.transform.Find("HandPlayer").GetComponent<DummyVRHandAnimator>();
  216. NDebug.Assert(this.m_DummyHand != null, "HandPlayer が見つかりません。");
  217. this.m_DummyHand.gameObject.SetActive(false);
  218. this.UpdateHeadScale();
  219. }
  220. public override void Start()
  221. {
  222. this.ChangeControllerNew(GameMain.Instance.CMSystem.OvrUseNewControllerType);
  223. this.ReCallcOffset();
  224. }
  225. public virtual void Uninit()
  226. {
  227. if (this.m_labelHeadScale != null)
  228. {
  229. UnityEngine.Object.DestroyImmediate(this.m_labelHeadScale.gameObject);
  230. }
  231. if (this.m_trTarget != null)
  232. {
  233. UnityEngine.Object.DestroyImmediate(this.m_trTarget.gameObject);
  234. }
  235. if (this.m_trVirtualMy != null)
  236. {
  237. UnityEngine.Object.DestroyImmediate(this.m_trVirtualMy.gameObject);
  238. }
  239. if (this.m_trBaseHead != null)
  240. {
  241. UnityEngine.Object.DestroyImmediate(this.m_trBaseHead.gameObject);
  242. }
  243. }
  244. public virtual void ChangeControllerNew(bool f_bNew)
  245. {
  246. if (f_bNew)
  247. {
  248. this.m_VRCtrlLeft.ChangeControllerNew(true);
  249. this.m_VRCtrlRight.ChangeControllerNew(true);
  250. this.m_goOvrUiScreen.SetActive(false);
  251. this.m_goOvrUiTablet.SetActive(true);
  252. this.m_goOvrUiNow = this.m_goOvrUiTablet;
  253. }
  254. else
  255. {
  256. this.m_VRCtrlLeft.ChangeControllerNew(false);
  257. this.m_VRCtrlRight.ChangeControllerNew(false);
  258. this.m_goOvrUiScreen.SetActive(true);
  259. this.m_goOvrUiTablet.SetActive(false);
  260. this.m_goOvrUiNow = this.m_goOvrUiScreen;
  261. }
  262. this.m_bControllerModeNew = f_bNew;
  263. }
  264. public virtual void DefaultControllerMode(bool f_bEnable)
  265. {
  266. if (f_bEnable)
  267. {
  268. this.ChangeControllerNew(this.m_bControllerModeNew);
  269. }
  270. else
  271. {
  272. this.m_VRCtrlLeft.DefaultControllerMode(false);
  273. this.m_VRCtrlRight.DefaultControllerMode(false);
  274. this.m_goOvrUiScreen.SetActive(false);
  275. this.m_goOvrUiTablet.SetActive(false);
  276. }
  277. }
  278. public void ChangeToCameraMode(bool f_bStart)
  279. {
  280. if (!this.m_VRCtrlLeft.HandCameraMode && !this.m_VRCtrlRight.HandCameraMode)
  281. {
  282. this.m_VRCtrlRight.HandCameraMode = true;
  283. }
  284. }
  285. public void ChangeTouchUse(bool f_bTouchUse)
  286. {
  287. if (f_bTouchUse)
  288. {
  289. GameMain.Instance.VRDeviceTypeID = GameMain.VRDeviceType.RIFT_TOUCH;
  290. if (this.m_OvrTablet != null)
  291. {
  292. this.m_OvrTablet.UIStickyHead = false;
  293. }
  294. }
  295. else
  296. {
  297. GameMain.Instance.VRDeviceTypeID = GameMain.VRDeviceType.RIFT;
  298. if (this.m_OvrTablet != null)
  299. {
  300. this.m_OvrTablet.UIStickyHead = true;
  301. }
  302. }
  303. }
  304. public virtual void ReCallcOffset()
  305. {
  306. OVRManager.display.RecenterPose();
  307. }
  308. public override void SetCameraMask(CameraMain.CameraMask f_eMask, bool f_bVisible)
  309. {
  310. Camera component = this.m_goCenterEye.GetComponent<Camera>();
  311. if (f_bVisible)
  312. {
  313. component.cullingMask |= 1 << (int)f_eMask;
  314. }
  315. else
  316. {
  317. component.cullingMask &= ~(1 << (int)f_eMask);
  318. }
  319. }
  320. public override void CameraMaskReset()
  321. {
  322. Camera component = this.m_goCenterEye.GetComponent<Camera>();
  323. component.cullingMask = this.m_nBackCullingMask;
  324. }
  325. public override void SetCameraType(CameraMain.CameraType f_eType)
  326. {
  327. }
  328. public override CameraMain.CameraType GetCameraType()
  329. {
  330. return CameraMain.CameraType.Free;
  331. }
  332. public override void SetControl(bool f_bEnable)
  333. {
  334. }
  335. public override bool GetControl()
  336. {
  337. return true;
  338. }
  339. public override void SetTargetPos(Vector3 f_vecWorldPos, bool f_bSelf = true)
  340. {
  341. if (f_bSelf)
  342. {
  343. iTween.StopAndSkipToEnd(base.gameObject);
  344. }
  345. this.m_trTarget.position = f_vecWorldPos;
  346. this.SetTransform(this.m_trTarget.position, this.m_vRot, this.m_fDistance);
  347. }
  348. public override Vector3 GetTargetPos()
  349. {
  350. return this.m_trTarget.position;
  351. }
  352. public override void SetDistance(float f_fDistance, bool f_bSelf = true)
  353. {
  354. if (f_bSelf)
  355. {
  356. iTween.StopAndSkipToEnd(base.gameObject);
  357. }
  358. this.m_fDistance = f_fDistance;
  359. this.SetTransform(this.m_trTarget.position, this.m_vRot, this.m_fDistance);
  360. }
  361. public override float GetDistance()
  362. {
  363. return this.m_fDistance;
  364. }
  365. public override void SetAroundAngle(Vector2 f_vecAngle, bool f_bSelf = true)
  366. {
  367. if (f_bSelf)
  368. {
  369. iTween.StopAndSkipToEnd(base.gameObject);
  370. }
  371. this.SetTransform(this.m_trTarget.position, f_vecAngle, this.m_fDistance);
  372. }
  373. public override Vector2 GetAroundAngle()
  374. {
  375. return this.m_vRot;
  376. }
  377. public override void SetTargetOffset(Vector3 f_vOffs, bool f_bSelf = true)
  378. {
  379. }
  380. public override void SetPos(Vector3 f_vecWorldPos)
  381. {
  382. this.m_trBaseHead.position = f_vecWorldPos;
  383. this.UpdateRealPosRot();
  384. }
  385. public override Vector3 GetPos()
  386. {
  387. return this.m_trBaseHead.position;
  388. }
  389. public override void SetRotation(Vector3 f_vecWorldRot)
  390. {
  391. this.m_trBaseHead.rotation = Quaternion.Euler(0f, f_vecWorldRot.y, 0f);
  392. this.UpdateRealPosRot();
  393. }
  394. public override void SetRealHeadPos(Vector3 f_vecWorldPos, bool f_bYFromFloor = false)
  395. {
  396. if (f_bYFromFloor)
  397. {
  398. f_vecWorldPos.y = this.GetYfromFloor(f_vecWorldPos);
  399. }
  400. Vector3 position = this.m_trBaseRoomBase.position;
  401. this.m_trBaseHead.position = f_vecWorldPos;
  402. Vector3 b = f_vecWorldPos - this.GetRealHeadTransform().position;
  403. this.m_trBaseRoomBase.position = position + b;
  404. this.UpdateRealPosRot();
  405. }
  406. public override void SetRealHeadRot(Vector3 f_vecWorldRot, bool f_bRotYOnly = true)
  407. {
  408. Transform realHeadTransform = this.GetRealHeadTransform();
  409. this.m_trBaseHead.position = realHeadTransform.position;
  410. if (f_bRotYOnly)
  411. {
  412. this.m_trBaseHead.rotation = Quaternion.Euler(0f, realHeadTransform.rotation.eulerAngles.y, 0f);
  413. }
  414. else
  415. {
  416. this.m_trBaseHead.rotation = Quaternion.Euler(f_vecWorldRot);
  417. }
  418. this.m_trBaseRoomBase.position = base.transform.position;
  419. this.m_trBaseRoomBase.rotation = base.transform.rotation;
  420. float num = f_vecWorldRot.y - realHeadTransform.rotation.eulerAngles.y;
  421. f_vecWorldRot.y = realHeadTransform.rotation.eulerAngles.y + num;
  422. this.m_trBaseHead.rotation = Quaternion.Euler(f_vecWorldRot);
  423. this.UpdateRealPosRot();
  424. }
  425. public override void SetFootPos(Vector3 f_vecFootPos, CameraMain.STAND_SIT f_eState)
  426. {
  427. if (f_eState == CameraMain.STAND_SIT.STAND)
  428. {
  429. f_vecFootPos.y += GameMain.Instance.CMSystem.VRCameraHeightStandOffs;
  430. }
  431. else if (f_eState == CameraMain.STAND_SIT.SIT)
  432. {
  433. f_vecFootPos.y += GameMain.Instance.CMSystem.VRCameraHeightSitOffs;
  434. }
  435. else
  436. {
  437. f_vecFootPos.y += this.GetYfromFloor(this.GetRealHeadTransform().position);
  438. }
  439. this.SetRealHeadPos(f_vecFootPos, false);
  440. }
  441. public override Transform GetBaseHeadTransform()
  442. {
  443. return this.m_trBaseHead;
  444. }
  445. public override Transform GetRealHeadTransform()
  446. {
  447. return this.m_trRealHead;
  448. }
  449. private void SetTransform(Vector3 f_vecTargetPosWorld, Vector2 f_vecRot, float f_fDistance)
  450. {
  451. this.m_trTarget.position = f_vecTargetPosWorld;
  452. this.m_vRot = f_vecRot;
  453. this.m_trVirtualMy.rotation = Quaternion.identity;
  454. this.m_trVirtualMy.Rotate(new Vector3(0f, f_vecRot.x, 0f), Space.World);
  455. this.m_trVirtualMy.Rotate(new Vector3(f_vecRot.y, 0f, 0f), Space.Self);
  456. this.m_trVirtualMy.position = this.m_trVirtualMy.rotation * new Vector3(0f, 0f, -f_fDistance) + this.m_trTarget.position;
  457. this.m_trBaseHead.position = this.m_trVirtualMy.position + (this.m_trTarget.position - this.m_trVirtualMy.position) * 0.5f;
  458. Quaternion rotation = Quaternion.LookRotation(new Vector3(this.m_trTarget.position.x, 0f, this.m_trTarget.position.z) - new Vector3(this.m_trVirtualMy.position.x, 0f, this.m_trVirtualMy.position.z));
  459. this.m_trBaseHead.rotation = rotation;
  460. this.UpdateRealPosRot();
  461. }
  462. public override void StartAnimationTo(bool f_bStart, Vector3 f_vSCenter, float f_fSRadius, Vector2 f_vSRotate, Vector3 f_vCenter, float f_fRadius, Vector2 f_vRotate, float f_fTime, string f_strEaseType, bool f_bSkip, float f_fDelay)
  463. {
  464. iTween.EaseType easeType;
  465. if (string.IsNullOrEmpty(f_strEaseType))
  466. {
  467. easeType = iTween.EaseType.linear;
  468. }
  469. else
  470. {
  471. easeType = (iTween.EaseType)Enum.Parse(typeof(iTween.EaseType), f_strEaseType);
  472. }
  473. Vector3 vector;
  474. float num;
  475. Vector2 vector2;
  476. if (!f_bStart)
  477. {
  478. vector = this.GetTargetPos();
  479. num = this.GetDistance();
  480. vector2 = this.GetAroundAngle();
  481. }
  482. else
  483. {
  484. vector = f_vSCenter;
  485. num = f_fSRadius;
  486. vector2 = f_vSRotate;
  487. }
  488. this.m_bMoveSkip = f_bSkip;
  489. if (this.m_bMoveSkip && GameMain.Instance.IsForceSkip())
  490. {
  491. this.SetTargetPos(f_vCenter, true);
  492. this.SetDistance(f_fRadius, true);
  493. this.SetAroundAngle(f_vRotate, true);
  494. this.m_vCenter = f_vCenter;
  495. this.m_fRadius = f_fRadius;
  496. this.m_vRotate = f_vRotate;
  497. }
  498. else
  499. {
  500. iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
  501. {
  502. "easetype",
  503. easeType,
  504. "from",
  505. vector,
  506. "to",
  507. f_vCenter,
  508. "time",
  509. f_fTime,
  510. "delay",
  511. f_fDelay,
  512. "onUpdate",
  513. "UpdateCamTgt",
  514. "onComplete",
  515. "CompleteCam"
  516. }));
  517. iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
  518. {
  519. "easetype",
  520. easeType,
  521. "from",
  522. num,
  523. "to",
  524. f_fRadius,
  525. "time",
  526. f_fTime,
  527. "delay",
  528. f_fDelay,
  529. "onUpdate",
  530. "UpdateCamDistance",
  531. "onComplete",
  532. "CompleteCam"
  533. }));
  534. iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
  535. {
  536. "easetype",
  537. easeType,
  538. "from",
  539. vector2,
  540. "to",
  541. f_vRotate,
  542. "time",
  543. f_fTime,
  544. "delay",
  545. f_fDelay,
  546. "onUpdate",
  547. "UpdateCamAngle",
  548. "onComplete",
  549. "CompleteCam"
  550. }));
  551. }
  552. }
  553. public override void UpdateCamTgt(Vector3 f_vValue)
  554. {
  555. this.m_vCenter = f_vValue;
  556. }
  557. public override void UpdateCamDistance(float f_vValue)
  558. {
  559. this.m_fRadius = f_vValue;
  560. }
  561. public override void UpdateCamAngle(Vector2 f_vAngle)
  562. {
  563. this.m_vRotate = f_vAngle;
  564. }
  565. public override void CompleteCam()
  566. {
  567. this.SetTargetPos(this.m_vCenter, false);
  568. this.SetDistance(this.m_fRadius, false);
  569. this.SetAroundAngle(this.m_vRotate, false);
  570. }
  571. public override void Reset(CameraMain.CameraType f_eType, bool f_bControl)
  572. {
  573. iTween.StopAndSkipToEnd(base.gameObject);
  574. base.RemoveChaseCameraAll();
  575. this.SetTargetPos(new Vector3(0f, 1.5f, 0f), true);
  576. }
  577. public override void FadeOutNoUI(float f_fTime = 0.5f, bool f_bSkipable = true)
  578. {
  579. }
  580. public override void FadeInNoUI(float f_fTime = 0.5f, bool f_bSkipable = true)
  581. {
  582. }
  583. protected override float GetFadeIntensity()
  584. {
  585. return this.m_FadeTargetCameraOVR.intensity;
  586. }
  587. protected override void OnProcessFade(float f_fIntensity)
  588. {
  589. this.m_FadeTargetCameraOVR.intensity = f_fIntensity;
  590. }
  591. protected override void OnStartFadeIn()
  592. {
  593. if (this.m_bIsSceneYotogi)
  594. {
  595. this.PosToManHead(1f);
  596. this.m_OvrTablet.AvoidFloorAndChara();
  597. }
  598. }
  599. protected override void OnOverlayState(bool f_bEnable)
  600. {
  601. this.m_FadeTargetCameraOVR.enabled = f_bEnable;
  602. }
  603. public virtual Ray GetForwardRay()
  604. {
  605. return new Ray(this.m_trCenterEye.position, this.m_trCenterEye.rotation * Vector3.forward);
  606. }
  607. public virtual void UpdateHeadScale()
  608. {
  609. float ovrHeadScale = GameMain.Instance.CMSystem.OvrHeadScale;
  610. base.gameObject.transform.localScale = new Vector3(ovrHeadScale, ovrHeadScale, ovrHeadScale);
  611. }
  612. protected virtual void UpdateRealPosRot()
  613. {
  614. base.transform.position = this.m_trBaseRoomBase.position;
  615. base.transform.rotation = this.m_trBaseRoomBase.rotation;
  616. }
  617. public virtual void ToggleUI()
  618. {
  619. this.ShowUI(!this.m_bUiToggle);
  620. }
  621. public virtual void ShowUI(bool f_bShow)
  622. {
  623. if (this.m_bUIForceHide)
  624. {
  625. f_bShow = false;
  626. }
  627. this.m_bUiToggle = f_bShow;
  628. if (this.m_goOvrUiNow != null)
  629. {
  630. OvrTablet component = this.m_goOvrUiNow.GetComponent<OvrTablet>();
  631. if (component != null)
  632. {
  633. component.SetVisible(this.m_bUiToggle);
  634. }
  635. else
  636. {
  637. this.m_goOvrUiNow.SetActive(f_bShow);
  638. }
  639. }
  640. UICamera.InputEnable = f_bShow;
  641. }
  642. public virtual void ForceHideUI(bool f_bForceHide)
  643. {
  644. this.m_bUIForceHide = f_bForceHide;
  645. this.ShowUI(!f_bForceHide);
  646. }
  647. public virtual void UIPosReset(float f_fOffsetRotY = 0f)
  648. {
  649. if ((GameMain.Instance.VRDeviceTypeID == GameMain.VRDeviceType.RIFT_TOUCH || GameMain.Instance.VRDeviceTypeID == GameMain.VRDeviceType.VIVE) && this.m_OvrTablet != null)
  650. {
  651. this.m_OvrTablet.UIPosReset(f_fOffsetRotY);
  652. }
  653. }
  654. public virtual void PosToManHead(float f_fTime = 1f)
  655. {
  656. if (this.m_coToManHeadWait != null)
  657. {
  658. base.StopCoroutine(this.m_coToManHeadWait);
  659. this.m_coToManHeadWait = null;
  660. }
  661. this.m_coToManHeadWait = base.StartCoroutine(this.CoPosToManHead(f_fTime));
  662. }
  663. private IEnumerator CoPosToManHead(float f_fTime)
  664. {
  665. float fTimeBef = Time.realtimeSinceStartup;
  666. while (Time.realtimeSinceStartup - fTimeBef < f_fTime)
  667. {
  668. Maid man = GameMain.Instance.CharacterMgr.GetMan(0);
  669. if (man == null)
  670. {
  671. yield return null;
  672. }
  673. if (man.body0 == null)
  674. {
  675. yield return null;
  676. }
  677. if (!man.Visible)
  678. {
  679. break;
  680. }
  681. Transform trAttach = man.body0.trsHead.Find("OvrCamAttach");
  682. if (trAttach == null)
  683. {
  684. trAttach = new GameObject("OvrCamAttach").transform;
  685. trAttach.SetParent(man.body0.trsHead, false);
  686. trAttach.localPosition = new Vector3(-0.077f, 0.037f, 0f);
  687. }
  688. this.SetPos(trAttach.position);
  689. this.SetRotation(new Vector3(0f, man.body0.trsHead.rotation.eulerAngles.y + 90f, 0f));
  690. yield return null;
  691. }
  692. this.m_coToManHeadWait = null;
  693. yield break;
  694. }
  695. public override void OnLevelWasLoaded(int level)
  696. {
  697. if (!(GameMain.Instance.GetNowSceneName() == "SceneYotogi") && !(GameMain.Instance.GetNowSceneName() == "SceneYotogiWithChubLip"))
  698. {
  699. if (string.IsNullOrEmpty(GameMain.Instance.GetAddSceneName().Find((string a) => a == "SceneYotogi")))
  700. {
  701. if (string.IsNullOrEmpty(GameMain.Instance.GetAddSceneName().Find((string a) => a == "SceneYotogiWithChubLip")))
  702. {
  703. this.m_bIsSceneYotogi = false;
  704. goto IL_B1;
  705. }
  706. }
  707. }
  708. this.m_bIsSceneYotogi = true;
  709. IL_B1:
  710. base.OnLevelWasLoaded(level);
  711. }
  712. public virtual void CheckSwitchManHeadEnable(Vector3 f_vMyGlovalPos)
  713. {
  714. if (this.m_bIsSceneYotogi)
  715. {
  716. Maid man = GameMain.Instance.CharacterMgr.GetMan(0);
  717. if (man != null && man.body0 != null && man.body0.trsHead != null && man.Visible && !man.body0.IsManHide())
  718. {
  719. if (this.m_bBefManHeadEnable)
  720. {
  721. if ((man.body0.trsHead.position - f_vMyGlovalPos).sqrMagnitude < 0.2f)
  722. {
  723. SkinnedMeshRenderer componentInChildren = man.body0.trsHead.GetComponentInChildren<SkinnedMeshRenderer>(true);
  724. if (componentInChildren != null)
  725. {
  726. componentInChildren.enabled = false;
  727. this.m_bBefManHeadEnable = false;
  728. }
  729. }
  730. }
  731. else if ((man.body0.trsHead.position - f_vMyGlovalPos).sqrMagnitude >= 0.2f)
  732. {
  733. SkinnedMeshRenderer componentInChildren2 = man.body0.trsHead.GetComponentInChildren<SkinnedMeshRenderer>(true);
  734. if (componentInChildren2 != null)
  735. {
  736. componentInChildren2.enabled = true;
  737. this.m_bBefManHeadEnable = true;
  738. }
  739. }
  740. }
  741. }
  742. }
  743. public virtual void MirrorSwitch()
  744. {
  745. VRSettings.showDeviceView = !VRSettings.showDeviceView;
  746. }
  747. public virtual void ShowDummyHand(OvrCamera.DUMMY_HAND f_hand, Vector3 f_vWorldPos = default(Vector3), bool f_bGrab = false)
  748. {
  749. this.m_unDummyHandVisibleFlag |= (uint)f_hand;
  750. if (this.m_DummyHand != null)
  751. {
  752. this.m_DummyHand.Show = (this.m_unDummyHandVisibleFlag != 0u);
  753. this.m_DummyHand.Grab = f_bGrab;
  754. this.m_DummyHand.transform.position = f_vWorldPos;
  755. }
  756. }
  757. public virtual void HideDummyHand(OvrCamera.DUMMY_HAND f_hand)
  758. {
  759. this.m_unDummyHandVisibleFlag &= (uint)(~(uint)f_hand);
  760. if (this.m_DummyHand != null)
  761. {
  762. this.m_DummyHand.Show = (this.m_unDummyHandVisibleFlag != 0u);
  763. }
  764. }
  765. protected virtual void SnapShotOVR(bool f_bNoUI)
  766. {
  767. if (f_bNoUI)
  768. {
  769. if (!this.screen_shot_noui_)
  770. {
  771. this.screen_shot_noui_ = true;
  772. base.StartCoroutine(base.SaveScreenShotNoUI());
  773. GameMain.Instance.SoundMgr.PlaySe("SE022.ogg", false);
  774. }
  775. }
  776. else if (!this.screen_shot_normal_)
  777. {
  778. this.screen_shot_normal_ = true;
  779. base.StartCoroutine(base.SaveScreenShotNormal());
  780. GameMain.Instance.SoundMgr.PlaySe("SE022.ogg", false);
  781. }
  782. }
  783. protected virtual float MoveDashRate(KeyCode f_key)
  784. {
  785. float result = 1f;
  786. OvrCamera.PairKeyTime pairKeyTime;
  787. if (!this.m_dicKeyBack.TryGetValue(f_key, out pairKeyTime))
  788. {
  789. OvrCamera.PairKeyTime pairKeyTime2 = new OvrCamera.PairKeyTime();
  790. this.m_dicKeyBack[f_key] = pairKeyTime2;
  791. pairKeyTime = pairKeyTime2;
  792. }
  793. if (Input.GetKeyDown(f_key))
  794. {
  795. if (Time.realtimeSinceStartup - pairKeyTime.fBackTime < 0.2f)
  796. {
  797. pairKeyTime.bDown = true;
  798. }
  799. else
  800. {
  801. pairKeyTime.bDown = false;
  802. }
  803. pairKeyTime.fBackTime = Time.realtimeSinceStartup;
  804. }
  805. if (Input.GetKey(f_key) && pairKeyTime.bDown)
  806. {
  807. result = 2.3f;
  808. }
  809. else
  810. {
  811. pairKeyTime.bDown = false;
  812. }
  813. return result;
  814. }
  815. protected override void Update()
  816. {
  817. if (GameMain.Instance == null)
  818. {
  819. return;
  820. }
  821. if (!this.IsUIShow)
  822. {
  823. UICamera.InputEnable = false;
  824. }
  825. if (this.m_DummyHand != null)
  826. {
  827. this.m_DummyHand.Show = (this.m_unDummyHandVisibleFlag != 0u);
  828. }
  829. if (this.m_BloomOVR != null)
  830. {
  831. bool enabled = this.m_BloomOVR.enabled;
  832. this.m_BloomOVR.enabled = GameMain.Instance.CMSystem.Bloom;
  833. this.m_BloomOVR.bloomIntensity = this.m_fBloomDefIntensity * (float)GameMain.Instance.CMSystem.BloomValue * 0.01f;
  834. if (this.m_BloomOVR.bloomIntensity <= 0.01f)
  835. {
  836. this.m_BloomOVR.enabled = false;
  837. }
  838. else
  839. {
  840. this.m_BloomOVR.enabled = true;
  841. }
  842. if (this.m_BloomOVR.enabled != enabled)
  843. {
  844. GameMain.Instance.BroadcastMessage("OnChangeScreenSizeOrAA", SendMessageOptions.DontRequireReceiver);
  845. }
  846. }
  847. this.m_bSlideMoving = false;
  848. this.vFowerd = this.m_trCenterEye.rotation * Vector3.forward;
  849. this.vLeft = this.m_trCenterEye.rotation * Vector3.left;
  850. this.vUp = this.m_trCenterEye.rotation * Vector3.up;
  851. if (this.IsNoHandController && GameMain.Instance.CMSystem.VRCameraPlaneMove)
  852. {
  853. this.vLeft.y = (this.vFowerd.y = 0f);
  854. this.vLeft.Normalize();
  855. this.vFowerd.Normalize();
  856. this.vUp = Vector3.up;
  857. }
  858. this.v = this.m_trBaseHead.position;
  859. if (this.m_bFallThrough || !this.m_bUiToggle)
  860. {
  861. if (this.m_bWheelToZoom && !this.IsUIShow)
  862. {
  863. this.v += this.vFowerd * (NInput.GetAxis(this.mouseAxisZoom) * (this.m_MoveSpeed * 10f * Time.deltaTime));
  864. }
  865. if (NInput.GetMouseButton(2))
  866. {
  867. Vector3 vector = new Vector3(-NInput.GetAxis(this.mouseAxisX), -NInput.GetAxis(this.mouseAxisY), 0f);
  868. this.v += (this.vLeft * -1f * vector.x + this.vUp * vector.y) * (this.m_MoveSpeed * Time.deltaTime);
  869. this.m_bSlideMoving = true;
  870. }
  871. if (NInput.GetMouseButton(1))
  872. {
  873. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), NInput.GetAxis(this.mouseAxisX) * -1f * this.m_RotSpeed * Time.deltaTime);
  874. }
  875. }
  876. if (NInput.GetMouseButton(1))
  877. {
  878. this.vMouseMoving += new Vector2(Math.Abs(NInput.GetAxis("Mouse X")), Math.Abs(NInput.GetAxis("Mouse Y")));
  879. }
  880. else
  881. {
  882. if ((this.m_bFallThrough || this.m_bIsForceRightClickUiToggle) && NInput.GetMouseButtonUp(1) && this.vMouseMoving.magnitude < 3f && this.m_bRightClickUIToggle)
  883. {
  884. this.ToggleUI();
  885. }
  886. this.vMouseMoving = Vector2.zero;
  887. }
  888. Vector3 camMoveVelocity = this.m_VRCtrlLeft.GetCamMoveVelocity();
  889. Vector3 camMoveVelocity2 = this.m_VRCtrlRight.GetCamMoveVelocity();
  890. this.v += this.vLeft * (this.m_MoveSpeed * Time.deltaTime) * (camMoveVelocity.x + camMoveVelocity2.x);
  891. this.v += this.vFowerd * (this.m_MoveSpeed * Time.deltaTime) * (camMoveVelocity.z + camMoveVelocity2.z);
  892. this.v += this.vUp * (this.m_MoveSpeed * Time.deltaTime) * (camMoveVelocity.y + camMoveVelocity2.y);
  893. Vector3 vector2 = this.m_VRCtrlLeft.GetHandMoveVelocity() + this.m_VRCtrlRight.GetHandMoveVelocity();
  894. this.v += vector2;
  895. if (Input.GetKey(KeyCode.A))
  896. {
  897. this.v += this.vLeft * (this.m_MoveSpeed * this.MoveSpeedAccel * this.MoveDashRate(KeyCode.A) * Time.deltaTime);
  898. }
  899. if (Input.GetKey(KeyCode.D))
  900. {
  901. this.v -= this.vLeft * (this.m_MoveSpeed * this.MoveSpeedAccel * this.MoveDashRate(KeyCode.D) * Time.deltaTime);
  902. }
  903. if (Input.GetKey(KeyCode.W))
  904. {
  905. this.v += this.vFowerd * (this.m_MoveSpeed * this.MoveSpeedAccel * this.MoveDashRate(KeyCode.W) * Time.deltaTime);
  906. }
  907. if (!Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.S))
  908. {
  909. this.v -= this.vFowerd * (this.m_MoveSpeed * this.MoveSpeedAccel * this.MoveDashRate(KeyCode.S) * Time.deltaTime);
  910. }
  911. if (Input.GetKey(KeyCode.Z))
  912. {
  913. this.v -= this.vUp * (this.m_MoveSpeed * this.MoveSpeedAccel * Time.deltaTime);
  914. }
  915. if (Input.GetKey(KeyCode.X))
  916. {
  917. this.v += this.vUp * (this.m_MoveSpeed * this.MoveSpeedAccel * Time.deltaTime);
  918. }
  919. if (this.HandLimitMode != AVRControllerBehavior.LIMIT_MODE.HAND_ONLY)
  920. {
  921. this.m_trBaseHead.position = this.v;
  922. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), 40f * Time.deltaTime * (this.m_VRCtrlLeft.GetCamRotVelocityY() + this.m_VRCtrlRight.GetCamRotVelocityY()));
  923. }
  924. if (Vector3.zero == vector2)
  925. {
  926. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), this.m_VRCtrlLeft.GetHandRotVelocityY() + this.m_VRCtrlRight.GetHandRotVelocityY());
  927. }
  928. if (Input.GetKey(KeyCode.Q))
  929. {
  930. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), -40f * this.RotSpeedAccel * Time.deltaTime);
  931. }
  932. if (Input.GetKey(KeyCode.E))
  933. {
  934. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), 40f * this.RotSpeedAccel * Time.deltaTime);
  935. }
  936. if (this.IsNoHandController && GameMain.Instance.CMSystem.OvrMouseRot && !this.IsUIShow && !this.m_bSlideMoving)
  937. {
  938. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), 60f * NInput.GetAxis("Mouse X") * this.RotMouseSpeedAccel * Time.deltaTime);
  939. }
  940. if (Input.GetKeyUp(KeyCode.R))
  941. {
  942. this.ReCallcOffset();
  943. GameMain.Instance.OvrMgr.OvrCamera.ShowUI(true);
  944. GameMain.Instance.OvrMgr.OvrCamera.UIPosReset(0f);
  945. }
  946. if (Input.GetKeyUp(KeyCode.M))
  947. {
  948. this.MirrorSwitch();
  949. }
  950. if (Input.GetKeyUp(KeyCode.U))
  951. {
  952. GameMain.Instance.OvrMgr.OvrCamera.ShowUI(true);
  953. GameMain.Instance.OvrMgr.OvrCamera.UIPosReset(0f);
  954. }
  955. if (Input.GetKey(KeyCode.Tab))
  956. {
  957. this.m_labelHeadScale.enabled = true;
  958. if (Input.GetKey(KeyCode.C))
  959. {
  960. GameMain.Instance.CMSystem.OvrHeadScale += 0.1f * Time.deltaTime;
  961. this.UpdateHeadScale();
  962. }
  963. if (Input.GetKey(KeyCode.V))
  964. {
  965. GameMain.Instance.CMSystem.OvrHeadScale -= 0.1f * Time.deltaTime;
  966. this.UpdateHeadScale();
  967. }
  968. this.m_labelHeadScale.text = "Head Scale " + GameMain.Instance.CMSystem.OvrHeadScale;
  969. this.bTab = true;
  970. }
  971. else if (this.bTab)
  972. {
  973. this.m_labelHeadScale.enabled = false;
  974. this.bTab = false;
  975. }
  976. if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.SysReq))
  977. {
  978. if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
  979. {
  980. this.SnapShotOVR(false);
  981. }
  982. else if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt))
  983. {
  984. this.SnapShotOVR(true);
  985. }
  986. }
  987. if (this.IsNoHandController && Input.GetKeyUp(KeyCode.Space))
  988. {
  989. this.ToggleUI();
  990. }
  991. if (GameMain.Instance.IsForceSkip() && this.m_bMoveSkip)
  992. {
  993. iTween.StopAndSkipToEnd(base.gameObject);
  994. }
  995. this.UpdateRealPosRot();
  996. this.CheckSwitchManHeadEnable(this.m_trRealHead.position);
  997. }
  998. private void OnDrawGizmos()
  999. {
  1000. if (this.m_trTarget != null)
  1001. {
  1002. Gizmos.DrawIcon(this.m_trTarget.position, "gizmo_eye.png", true);
  1003. if (base.enabled)
  1004. {
  1005. Gizmos.color = Color.cyan;
  1006. Gizmos.DrawRay(this.m_trVirtualMy.position, this.m_trTarget.position - this.m_trVirtualMy.position);
  1007. Gizmos.DrawRay(this.m_trCenterEye.position, this.m_trCenterEye.rotation * Vector3.forward * 10f);
  1008. }
  1009. }
  1010. }
  1011. public float m_MoveSpeed = 0.5f;
  1012. public float m_RotSpeed = 30f;
  1013. public string mouseAxisX = "Mouse X";
  1014. public string mouseAxisY = "Mouse Y";
  1015. public string mouseAxisZoom = "Mouse ScrollWheel";
  1016. public bool m_bWheelToZoom = true;
  1017. public bool m_bRightClickUIToggle = true;
  1018. public GameObject m_goOvrUiNow;
  1019. public GameObject m_goOvrUiScreen;
  1020. public GameObject m_goOvrUiTablet;
  1021. public Transform m_trOvrUiTablet;
  1022. public GameObject m_goCenterEye;
  1023. public Transform m_trCenterEye;
  1024. protected AVRControllerBehavior.LIMIT_MODE m_eHandLimitMode;
  1025. protected ScreenOverlay m_FadeTargetCameraOVR;
  1026. protected Bloom m_BloomOVR;
  1027. protected bool m_bUiToggle = true;
  1028. protected bool m_bUiShowBack;
  1029. protected Vector2 m_vRot = default(Vector2);
  1030. protected UILabel m_labelHeadScale;
  1031. protected bool m_bIsSceneYotogi;
  1032. protected bool m_bIsForceRightClickUiToggle;
  1033. protected Transform m_trCursorLaserHit;
  1034. protected Transform m_trTarget;
  1035. protected Transform m_trVirtualMy;
  1036. protected float m_fDistance = 10f;
  1037. protected Vector3 vFowerd;
  1038. protected Vector3 vLeft;
  1039. protected Vector3 vUp;
  1040. protected Vector3 v;
  1041. protected Vector2 vMouseMoving = Vector2.zero;
  1042. protected bool bTab;
  1043. protected bool m_bBefManHeadEnable = true;
  1044. protected Transform m_trRealHead;
  1045. protected Transform m_trBaseHead;
  1046. protected Transform m_trBaseRoomBase;
  1047. protected AVRController m_VRCtrlLeft;
  1048. protected AVRController m_VRCtrlRight;
  1049. protected bool m_bControllerModeNew;
  1050. protected OvrTablet m_OvrTablet;
  1051. protected VREventText m_VREvnetText;
  1052. protected OvrEyeRay m_EyeRay;
  1053. protected bool m_bUIForceHide;
  1054. protected DummyVRHandAnimator m_DummyHand;
  1055. protected uint m_unDummyHandVisibleFlag;
  1056. protected bool m_bSlideMoving;
  1057. protected Coroutine m_coToManHeadWait;
  1058. private Dictionary<KeyCode, OvrCamera.PairKeyTime> m_dicKeyBack = new Dictionary<KeyCode, OvrCamera.PairKeyTime>();
  1059. public enum DUMMY_HAND
  1060. {
  1061. CHOICES_TOUCH = 1,
  1062. EVENT_GRAB
  1063. }
  1064. private enum MouseButtonDown
  1065. {
  1066. MBD_LEFT,
  1067. MBD_RIGHT,
  1068. MBD_MIDDLE
  1069. }
  1070. private class PairKeyTime
  1071. {
  1072. public float fBackTime;
  1073. public bool bDown;
  1074. }
  1075. }