FoveCamera.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. using System;
  2. using UnityEngine;
  3. public class FoveCamera : OvrCamera
  4. {
  5. public override bool IsBloomEnabled
  6. {
  7. get
  8. {
  9. return this.m_BloomOVR.enabled;
  10. }
  11. }
  12. public override bool IsNoHandController
  13. {
  14. get
  15. {
  16. return true;
  17. }
  18. }
  19. public override AVRControllerBehavior.LIMIT_MODE HandLimitMode
  20. {
  21. get
  22. {
  23. return AVRControllerBehavior.LIMIT_MODE.NORMAL;
  24. }
  25. set
  26. {
  27. }
  28. }
  29. protected override void Awake()
  30. {
  31. this.m_goCenterEye = UTY.GetChildObject(base.gameObject, "Fove Interface", false);
  32. this.m_trCenterEye = this.m_goCenterEye.transform;
  33. this.m_trRealHead = this.m_trCenterEye;
  34. this.m_camMonitor = UTY.GetChildObject(base.gameObject, "Fove Interface/MonitorCamera", false).GetComponent<Camera>();
  35. this.m_FadeTargetCameraOVR = this.m_camMonitor.GetComponent<ScreenOverlay>();
  36. this.m_BloomOVR = this.m_camMonitor.GetComponent<Bloom>();
  37. this.m_fBloomDefIntensity = this.m_BloomOVR.bloomIntensity;
  38. this.m_trTarget = new GameObject("OVRCamTarget").transform;
  39. this.m_trTarget.SetParent(GameMain.Instance.transform, false);
  40. this.m_trVirtualMy = new GameObject("OVRCamMy").transform;
  41. this.m_trVirtualMy.SetParent(GameMain.Instance.transform, false);
  42. GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("OVR/OvrHeadScale")) as GameObject;
  43. gameObject.SetActive(true);
  44. GameObject gameObject2 = GameObject.Find("SystemUI Root");
  45. gameObject.transform.SetParent(gameObject2.transform, false);
  46. this.m_labelHeadScale = gameObject.GetComponentInChildren<UILabel>();
  47. this.m_labelHeadScale.enabled = false;
  48. this.m_goOvrUiScreen = UTY.GetChildObject(this.m_goCenterEye, "UI", false);
  49. this.m_goOvrUiTablet = UTY.GetChildObject(base.gameObject, "Odogu_TabletPC", false);
  50. this.m_OvrTablet = this.m_goOvrUiTablet.GetComponent<OvrTablet>();
  51. this.m_OvrTablet.Init(this.m_goCenterEye);
  52. Vignetting vignetting = base.gameObject.AddComponent<Vignetting>();
  53. vignetting.enabled = false;
  54. Camera component = base.gameObject.GetComponent<Camera>();
  55. component.enabled = false;
  56. this.m_trBaseHead = new GameObject("FoveCamBaseHead").transform;
  57. this.m_trBaseHead.SetParent(GameMain.Instance.transform, false);
  58. this.m_trBaseRoomBase = new GameObject("BaseRoomBase").transform;
  59. this.m_trBaseRoomBase.SetParent(this.m_trBaseHead, false);
  60. this.m_goEyeTargetMgr = UTY.GetChildObject(base.gameObject, "EyeTargetMgr", false);
  61. this.m_VREvnetText = this.m_trCenterEye.Find("VREventText").GetComponent<VREventText>();
  62. Transform transform = this.m_trCenterEye.Find("EyeRayCaster");
  63. this.m_EyeRay = transform.GetComponent<OvrEyeRay>();
  64. NDebug.Assert(this.m_EyeRay != null, "視線検出機構がみつかりません。");
  65. this.m_DummyHand = base.transform.Find("HandPlayer").GetComponent<DummyVRHandAnimator>();
  66. NDebug.Assert(this.m_DummyHand != null, "HandPlayer が見つかりません。");
  67. this.m_DummyHand.gameObject.SetActive(false);
  68. Transform transform2 = base.transform.Find("Controller (left)");
  69. Transform transform3 = base.transform.Find("Controller (right)");
  70. this.m_VRCtrlLeft = transform2.GetComponent<DummyVRController>();
  71. this.m_VRCtrlLeft.Init();
  72. this.m_VRCtrlRight = transform3.GetComponent<DummyVRController>();
  73. this.m_VRCtrlRight.Init();
  74. }
  75. public override void Start()
  76. {
  77. this.m_camLeftEye = UTY.GetChildObject(base.gameObject, "Fove Interface/FOVE Eye (Left)", false).GetComponent<Camera>();
  78. this.m_camRightEye = UTY.GetChildObject(base.gameObject, "Fove Interface/FOVE Eye (Right)", false).GetComponent<Camera>();
  79. this.m_FadeLeft = this.m_camLeftEye.GetComponent<ScreenOverlay>();
  80. this.m_FadeRight = this.m_camRightEye.GetComponent<ScreenOverlay>();
  81. this.m_BloomLeft = this.m_camLeftEye.GetComponent<Bloom>();
  82. this.m_BloomRight = this.m_camRightEye.GetComponent<Bloom>();
  83. this.m_BloomLeft.bloomIntensity = this.m_fBloomDefIntensity;
  84. this.m_BloomRight.bloomIntensity = this.m_fBloomDefIntensity;
  85. this.m_camMonitor.gameObject.SetActive(true);
  86. this.ChangeControllerNew(GameMain.Instance.CMSystem.OvrUseNewControllerType);
  87. this.m_OvrTablet.UIStickyHead = true;
  88. this.UpdateHeadScale();
  89. }
  90. public override void ChangeControllerNew(bool f_bNew)
  91. {
  92. if (f_bNew)
  93. {
  94. this.m_goOvrUiScreen.SetActive(false);
  95. this.m_goOvrUiTablet.SetActive(true);
  96. this.m_goOvrUiNow = this.m_goOvrUiTablet;
  97. }
  98. else
  99. {
  100. this.m_goOvrUiScreen.SetActive(true);
  101. this.m_goOvrUiTablet.SetActive(false);
  102. this.m_goOvrUiNow = this.m_goOvrUiScreen;
  103. }
  104. this.m_bControllerModeNew = f_bNew;
  105. }
  106. public override void DefaultControllerMode(bool f_bEnable)
  107. {
  108. }
  109. public override void ReCallcOffset()
  110. {
  111. Vector3 position = this.m_trBaseHead.position;
  112. Quaternion rotation = this.m_trBaseHead.rotation;
  113. this.m_trBaseHead.position = this.m_trRealHead.position;
  114. Vector3 eulerAngles = this.m_trRealHead.rotation.eulerAngles;
  115. this.m_trBaseHead.rotation = Quaternion.Euler(0f, eulerAngles.y, 0f);
  116. this.m_trBaseRoomBase.position = base.transform.position;
  117. this.m_trBaseRoomBase.rotation = base.transform.rotation;
  118. this.m_trBaseHead.position = position;
  119. Vector3 eulerAngles2 = rotation.eulerAngles;
  120. this.m_trBaseHead.rotation = Quaternion.Euler(0f, eulerAngles2.y, 0f);
  121. }
  122. public override void SetCameraMask(CameraMain.CameraMask f_eMask, bool f_bVisible)
  123. {
  124. if (f_bVisible)
  125. {
  126. }
  127. }
  128. public override void CameraMaskReset()
  129. {
  130. }
  131. public override void SetCameraType(CameraMain.CameraType f_eType)
  132. {
  133. }
  134. public override CameraMain.CameraType GetCameraType()
  135. {
  136. return CameraMain.CameraType.Free;
  137. }
  138. public override void SetControl(bool f_bEnable)
  139. {
  140. }
  141. public override bool GetControl()
  142. {
  143. return true;
  144. }
  145. public override void SetTargetPos(Vector3 f_vecWorldPos, bool f_bSelf = true)
  146. {
  147. if (f_bSelf)
  148. {
  149. iTween.StopAndSkipToEnd(base.gameObject);
  150. }
  151. this.m_trTarget.position = f_vecWorldPos;
  152. this.SetTransform(this.m_trTarget.position, this.m_vRot, this.m_fDistance);
  153. }
  154. public override Vector3 GetTargetPos()
  155. {
  156. return this.m_trTarget.position;
  157. }
  158. public override void SetDistance(float f_fDistance, bool f_bSelf = true)
  159. {
  160. if (f_bSelf)
  161. {
  162. iTween.StopAndSkipToEnd(base.gameObject);
  163. }
  164. this.m_fDistance = f_fDistance;
  165. this.SetTransform(this.m_trTarget.position, this.m_vRot, this.m_fDistance);
  166. }
  167. public override float GetDistance()
  168. {
  169. return this.m_fDistance;
  170. }
  171. public override void SetAroundAngle(Vector2 f_vecAngle, bool f_bSelf = true)
  172. {
  173. if (f_bSelf)
  174. {
  175. iTween.StopAndSkipToEnd(base.gameObject);
  176. }
  177. this.SetTransform(this.m_trTarget.position, f_vecAngle, this.m_fDistance);
  178. }
  179. public override Vector2 GetAroundAngle()
  180. {
  181. return this.m_vRot;
  182. }
  183. public override void SetTargetOffset(Vector3 f_vOffs, bool f_bSelf = true)
  184. {
  185. }
  186. public override void SetPos(Vector3 f_vecWorldPos)
  187. {
  188. this.m_trBaseHead.position = f_vecWorldPos;
  189. }
  190. public override Vector3 GetPos()
  191. {
  192. return this.m_trBaseHead.position;
  193. }
  194. public override void SetRotation(Vector3 f_vecWorldRot)
  195. {
  196. this.m_trBaseHead.rotation = Quaternion.Euler(f_vecWorldRot);
  197. }
  198. public override void SetRealHeadPos(Vector3 f_vecWorldPos, bool f_bYFromFloor = false)
  199. {
  200. if (f_bYFromFloor)
  201. {
  202. f_vecWorldPos.y = this.GetYfromFloor(f_vecWorldPos);
  203. }
  204. Vector3 position = this.m_trBaseRoomBase.position;
  205. this.m_trBaseHead.position = f_vecWorldPos;
  206. Vector3 b = f_vecWorldPos - this.GetRealHeadTransform().position;
  207. this.m_trBaseRoomBase.position = position + b;
  208. }
  209. public override void SetRealHeadRot(Vector3 f_vecWorldRot, bool f_bRotYOnly = true)
  210. {
  211. Transform realHeadTransform = this.GetRealHeadTransform();
  212. this.m_trBaseHead.position = realHeadTransform.position;
  213. if (f_bRotYOnly)
  214. {
  215. this.m_trBaseHead.rotation = Quaternion.Euler(0f, realHeadTransform.rotation.eulerAngles.y, 0f);
  216. }
  217. else
  218. {
  219. this.m_trBaseHead.rotation = Quaternion.Euler(f_vecWorldRot);
  220. }
  221. this.m_trBaseRoomBase.position = base.transform.position;
  222. this.m_trBaseRoomBase.rotation = base.transform.rotation;
  223. float num = f_vecWorldRot.y - realHeadTransform.rotation.eulerAngles.y;
  224. f_vecWorldRot.y = realHeadTransform.rotation.eulerAngles.y + num;
  225. this.SetRotation(f_vecWorldRot);
  226. }
  227. public override void SetFootPos(Vector3 f_vecFootPos, CameraMain.STAND_SIT f_eState)
  228. {
  229. if (f_eState == CameraMain.STAND_SIT.STAND)
  230. {
  231. f_vecFootPos.y += GameMain.Instance.CMSystem.VRCameraHeightStandOffs;
  232. }
  233. else if (f_eState == CameraMain.STAND_SIT.SIT)
  234. {
  235. f_vecFootPos.y += GameMain.Instance.CMSystem.VRCameraHeightSitOffs;
  236. }
  237. else
  238. {
  239. f_vecFootPos.y += this.GetYfromFloor(this.GetRealHeadTransform().position);
  240. }
  241. this.SetRealHeadPos(f_vecFootPos, false);
  242. }
  243. public override Transform GetBaseHeadTransform()
  244. {
  245. return this.m_trBaseHead;
  246. }
  247. public override Transform GetRealHeadTransform()
  248. {
  249. return this.m_trRealHead;
  250. }
  251. private void SetTransform(Vector3 f_vecTargetPosWorld, Vector2 f_vecRot, float f_fDistance)
  252. {
  253. this.m_trTarget.position = f_vecTargetPosWorld;
  254. this.m_vRot = f_vecRot;
  255. this.m_trVirtualMy.rotation = Quaternion.identity;
  256. this.m_trVirtualMy.Rotate(new Vector3(0f, f_vecRot.x, 0f), Space.World);
  257. this.m_trVirtualMy.Rotate(new Vector3(f_vecRot.y, 0f, 0f), Space.Self);
  258. this.m_trVirtualMy.position = this.m_trVirtualMy.rotation * new Vector3(0f, 0f, -f_fDistance) + this.m_trTarget.position;
  259. this.m_trBaseHead.position = this.m_trVirtualMy.position + (this.m_trTarget.position - this.m_trVirtualMy.position) * 0.5f;
  260. 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));
  261. this.m_trBaseHead.rotation = rotation;
  262. }
  263. public override void Reset(CameraMain.CameraType f_eType, bool f_bControl)
  264. {
  265. iTween.StopAndSkipToEnd(base.gameObject);
  266. base.RemoveChaseCameraAll();
  267. this.SetTargetPos(new Vector3(0f, 1.5f, 0f), true);
  268. }
  269. public override void FadeOutNoUI(float f_fTime = 0.5f, bool f_bSkipable = true)
  270. {
  271. }
  272. public override void FadeInNoUI(float f_fTime = 0.5f, bool f_bSkipable = true)
  273. {
  274. }
  275. protected override float GetFadeIntensity()
  276. {
  277. return this.m_FadeTargetCameraOVR.intensity;
  278. }
  279. protected override void OnProcessFade(float f_fIntensity)
  280. {
  281. this.m_FadeTargetCameraOVR.intensity = f_fIntensity;
  282. this.m_FadeLeft.intensity = f_fIntensity;
  283. this.m_FadeRight.intensity = f_fIntensity;
  284. }
  285. protected override void OnOverlayState(bool f_bEnable)
  286. {
  287. this.m_FadeTargetCameraOVR.enabled = f_bEnable;
  288. this.m_FadeLeft.enabled = f_bEnable;
  289. this.m_FadeRight.enabled = f_bEnable;
  290. }
  291. public override Ray GetForwardRay()
  292. {
  293. return new Ray(this.m_trCenterEye.position, this.m_trCenterEye.rotation * Vector3.forward);
  294. }
  295. public override void UpdateHeadScale()
  296. {
  297. float ovrHeadScale = GameMain.Instance.CMSystem.OvrHeadScale;
  298. base.gameObject.transform.localScale = new Vector3(ovrHeadScale, ovrHeadScale, ovrHeadScale);
  299. }
  300. public override void CheckSwitchManHeadEnable(Vector3 f_vMyGlovalPos)
  301. {
  302. if (this.m_bIsSceneYotogi)
  303. {
  304. Maid man = GameMain.Instance.CharacterMgr.GetMan(0);
  305. if (man != null && man.body0 != null && man.body0.trsHead != null && man.Visible)
  306. {
  307. if (this.m_bBefManHeadEnable)
  308. {
  309. if ((man.body0.trsHead.position - f_vMyGlovalPos).sqrMagnitude < 0.2f)
  310. {
  311. SkinnedMeshRenderer componentInChildren = man.body0.trsHead.GetComponentInChildren<SkinnedMeshRenderer>(true);
  312. if (componentInChildren != null)
  313. {
  314. componentInChildren.enabled = false;
  315. this.m_bBefManHeadEnable = false;
  316. }
  317. }
  318. }
  319. else if ((man.body0.trsHead.position - f_vMyGlovalPos).sqrMagnitude >= 0.2f)
  320. {
  321. SkinnedMeshRenderer componentInChildren2 = man.body0.trsHead.GetComponentInChildren<SkinnedMeshRenderer>(true);
  322. if (componentInChildren2 != null)
  323. {
  324. componentInChildren2.enabled = true;
  325. this.m_bBefManHeadEnable = true;
  326. }
  327. }
  328. }
  329. }
  330. }
  331. protected override void Update()
  332. {
  333. if (GameMain.Instance == null)
  334. {
  335. return;
  336. }
  337. if (!base.IsUIShow)
  338. {
  339. UICamera.InputEnable = false;
  340. }
  341. if (this.m_BloomOVR != null)
  342. {
  343. bool enabled = this.m_BloomOVR.enabled;
  344. this.m_BloomOVR.enabled = GameMain.Instance.CMSystem.Bloom;
  345. this.m_BloomOVR.bloomIntensity = this.m_fBloomDefIntensity * (float)GameMain.Instance.CMSystem.BloomValue * 0.01f;
  346. if (this.m_BloomOVR.bloomIntensity <= 0.01f)
  347. {
  348. this.m_BloomOVR.enabled = false;
  349. }
  350. else
  351. {
  352. this.m_BloomOVR.enabled = true;
  353. }
  354. if (this.m_BloomOVR.enabled != enabled)
  355. {
  356. GameMain.Instance.BroadcastMessage("OnChangeScreenSizeOrAA", SendMessageOptions.DontRequireReceiver);
  357. }
  358. if (this.m_BloomLeft != null)
  359. {
  360. this.m_BloomLeft.enabled = this.m_BloomOVR.enabled;
  361. this.m_BloomLeft.bloomIntensity = this.m_BloomOVR.bloomIntensity;
  362. }
  363. if (this.m_BloomRight != null)
  364. {
  365. this.m_BloomRight.enabled = this.m_BloomOVR.enabled;
  366. this.m_BloomRight.bloomIntensity = this.m_BloomOVR.bloomIntensity;
  367. }
  368. }
  369. this.vFowerd = this.m_trCenterEye.rotation * Vector3.forward;
  370. this.vLeft = this.m_trCenterEye.rotation * Vector3.left;
  371. this.vUp = this.m_trCenterEye.rotation * Vector3.up;
  372. if (this.IsNoHandController && GameMain.Instance.CMSystem.VRCameraPlaneMove)
  373. {
  374. this.vLeft.y = (this.vFowerd.y = 0f);
  375. this.vLeft.Normalize();
  376. this.vFowerd.Normalize();
  377. this.vUp = Vector3.up;
  378. }
  379. this.v = this.m_trBaseHead.position;
  380. if (this.m_bFallThrough || !this.m_bUiToggle)
  381. {
  382. if (this.m_bWheelToZoom && !base.IsUIShow)
  383. {
  384. this.v += this.vFowerd * (NInput.GetAxis(this.mouseAxisZoom) * (this.m_MoveSpeed * 10f * Time.deltaTime));
  385. }
  386. if (NInput.GetMouseButton(2))
  387. {
  388. Vector3 vector = new Vector3(-NInput.GetAxis(this.mouseAxisX), -NInput.GetAxis(this.mouseAxisY), 0f);
  389. this.v += (this.vLeft * -1f * vector.x + this.vUp * vector.y) * (this.m_MoveSpeed * Time.deltaTime);
  390. }
  391. if (NInput.GetMouseButton(1))
  392. {
  393. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), NInput.GetAxis(this.mouseAxisX) * -1f * this.m_RotSpeed * Time.deltaTime);
  394. }
  395. }
  396. if (NInput.GetMouseButton(1))
  397. {
  398. this.vMouseMoving += new Vector2(Math.Abs(NInput.GetAxis("Mouse X")), Math.Abs(NInput.GetAxis("Mouse Y")));
  399. }
  400. else
  401. {
  402. if ((this.m_bFallThrough || this.m_bIsForceRightClickUiToggle) && NInput.GetMouseButtonUp(1) && this.vMouseMoving.magnitude < 3f && this.m_bRightClickUIToggle)
  403. {
  404. this.ToggleUI();
  405. }
  406. this.vMouseMoving = Vector2.zero;
  407. }
  408. if (Input.GetKey(KeyCode.A))
  409. {
  410. this.v += this.vLeft * (this.m_MoveSpeed * base.MoveSpeedAccel * this.MoveDashRate(KeyCode.A) * Time.deltaTime);
  411. }
  412. if (Input.GetKey(KeyCode.D))
  413. {
  414. this.v -= this.vLeft * (this.m_MoveSpeed * base.MoveSpeedAccel * this.MoveDashRate(KeyCode.D) * Time.deltaTime);
  415. }
  416. if (Input.GetKey(KeyCode.W))
  417. {
  418. this.v += this.vFowerd * (this.m_MoveSpeed * base.MoveSpeedAccel * this.MoveDashRate(KeyCode.W) * Time.deltaTime);
  419. }
  420. if (!Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.S))
  421. {
  422. this.v -= this.vFowerd * (this.m_MoveSpeed * base.MoveSpeedAccel * this.MoveDashRate(KeyCode.S) * Time.deltaTime);
  423. }
  424. if (Input.GetKey(KeyCode.Z))
  425. {
  426. this.v -= this.vUp * (this.m_MoveSpeed * base.MoveSpeedAccel * Time.deltaTime);
  427. }
  428. if (Input.GetKey(KeyCode.X))
  429. {
  430. this.v += this.vUp * (this.m_MoveSpeed * base.MoveSpeedAccel * Time.deltaTime);
  431. }
  432. if (this.HandLimitMode != AVRControllerBehavior.LIMIT_MODE.HAND_ONLY)
  433. {
  434. this.m_trBaseHead.position = this.v;
  435. }
  436. if (Input.GetKey(KeyCode.Q))
  437. {
  438. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), -40f * base.RotSpeedAccel * Time.deltaTime);
  439. }
  440. if (Input.GetKey(KeyCode.E))
  441. {
  442. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), 40f * base.RotSpeedAccel * Time.deltaTime);
  443. }
  444. if (this.IsNoHandController && !base.IsUIShow && GameMain.Instance.CMSystem.OvrMouseRot)
  445. {
  446. this.m_trBaseHead.Rotate(new Vector3(0f, 1f, 0f), 60f * NInput.GetAxis("Mouse X") * base.RotMouseSpeedAccel * Time.deltaTime);
  447. }
  448. if (Input.GetKeyUp(KeyCode.R))
  449. {
  450. this.ReCallcOffset();
  451. }
  452. if (Input.GetKeyUp(KeyCode.M))
  453. {
  454. this.m_camMonitor.gameObject.SetActive(!this.m_camMonitor.gameObject.activeSelf);
  455. Debug.Log("モニター表示切替=" + this.m_camMonitor.gameObject.activeSelf);
  456. }
  457. if (Input.GetKeyUp(KeyCode.T))
  458. {
  459. this.m_goEyeTargetMgr.SetActive(!this.m_goEyeTargetMgr.activeSelf);
  460. Debug.Log("視線ターゲット表示切替=" + this.m_goEyeTargetMgr.activeSelf);
  461. }
  462. if (Input.GetKeyUp(KeyCode.U))
  463. {
  464. GameMain.Instance.OvrMgr.OvrCamera.ShowUI(true);
  465. GameMain.Instance.OvrMgr.OvrCamera.UIPosReset(0f);
  466. }
  467. if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.SysReq))
  468. {
  469. if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
  470. {
  471. this.SnapShotOVR(false);
  472. }
  473. else if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt))
  474. {
  475. this.SnapShotOVR(true);
  476. }
  477. }
  478. if (Input.GetKey(KeyCode.Tab))
  479. {
  480. this.m_labelHeadScale.enabled = true;
  481. if (Input.GetKey(KeyCode.C))
  482. {
  483. GameMain.Instance.CMSystem.OvrHeadScale += 0.1f * Time.deltaTime;
  484. this.UpdateHeadScale();
  485. }
  486. if (Input.GetKey(KeyCode.V))
  487. {
  488. GameMain.Instance.CMSystem.OvrHeadScale -= 0.1f * Time.deltaTime;
  489. this.UpdateHeadScale();
  490. }
  491. this.m_labelHeadScale.text = "Head Scale " + GameMain.Instance.CMSystem.OvrHeadScale;
  492. this.bTab = true;
  493. }
  494. else if (this.bTab)
  495. {
  496. this.m_labelHeadScale.enabled = false;
  497. this.bTab = false;
  498. }
  499. if (this.IsNoHandController && Input.GetKeyUp(KeyCode.Space))
  500. {
  501. this.ToggleUI();
  502. }
  503. base.transform.position = this.m_trBaseRoomBase.position;
  504. base.transform.rotation = this.m_trBaseRoomBase.rotation;
  505. this.CheckSwitchManHeadEnable(this.m_trRealHead.position);
  506. }
  507. private void OnDrawGizmos()
  508. {
  509. if (this.m_trTarget != null)
  510. {
  511. Gizmos.DrawIcon(this.m_trTarget.position, "gizmo_eye.png", true);
  512. if (base.enabled)
  513. {
  514. Gizmos.color = Color.cyan;
  515. Gizmos.DrawRay(this.m_trVirtualMy.position, this.m_trTarget.position - this.m_trVirtualMy.position);
  516. Gizmos.DrawRay(this.m_trCenterEye.position, this.m_trCenterEye.rotation * Vector3.forward * 10f);
  517. }
  518. }
  519. }
  520. private Camera m_camMonitor;
  521. private Camera m_camLeftEye;
  522. private Camera m_camRightEye;
  523. private ScreenOverlay m_FadeLeft;
  524. private ScreenOverlay m_FadeRight;
  525. private Bloom m_BloomLeft;
  526. private Bloom m_BloomRight;
  527. private GameObject m_goEyeTargetMgr;
  528. private enum MouseButtonDown
  529. {
  530. MBD_LEFT,
  531. MBD_RIGHT,
  532. MBD_MIDDLE
  533. }
  534. }