Guest User

CM3D2CameraUtility.Plugin

a guest
Aug 20th, 2015
1,097
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 22.27 KB | None | 0 0
  1. using System;
  2. using System.Reflection;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using UnityEngine;
  7. using UnityInjector;
  8. using UnityInjector.Attributes;
  9.  
  10. namespace CM3D2CameraUtility
  11. {
  12.     [PluginFilter("CM3D2x64"),
  13.     PluginFilter("CM3D2x86"),
  14.     PluginFilter("CM3D2VRx64"),
  15.     PluginName("Camera Utility"),
  16.     PluginVersion("2.0.1.0")]
  17.  
  18.     public class CameraUtility : PluginBase
  19.     {
  20.         //移動関係キー設定
  21.         private KeyCode bgLeftMoveKey = KeyCode.LeftArrow;
  22.         private KeyCode bgRightMoveKey = KeyCode.RightArrow;
  23.         private KeyCode bgForwardMoveKey = KeyCode.UpArrow;
  24.         private KeyCode bgBackMoveKey = KeyCode.DownArrow;
  25.         private KeyCode bgUpMoveKey = KeyCode.PageUp;
  26.         private KeyCode bgDownMoveKey = KeyCode.PageDown;
  27.         private KeyCode bgLeftRotateKey = KeyCode.Delete;
  28.         private KeyCode bgRightRotateKey = KeyCode.End;
  29.         private KeyCode bgLeftPitchKey = KeyCode.Insert;
  30.         private KeyCode bgRightPitchKey = KeyCode.Home;
  31.         private KeyCode bgInitializeKey = KeyCode.Backspace;
  32.  
  33.         //VR用移動関係キー設定
  34.         private KeyCode bgLeftMoveKeyVR = KeyCode.J;
  35.         private KeyCode bgRightMoveKeyVR = KeyCode.L;
  36.         private KeyCode bgForwardMoveKeyVR = KeyCode.I;
  37.         private KeyCode bgBackMoveKeyVR = KeyCode.K;
  38.         private KeyCode bgUpMoveKeyVR = KeyCode.Alpha0;
  39.         private KeyCode bgDownMoveKeyVR = KeyCode.P;
  40.         private KeyCode bgLeftRotateKeyVR = KeyCode.U;
  41.         private KeyCode bgRightRotateKeyVR = KeyCode.O;
  42.         private KeyCode bgLeftPitchKeyVR = KeyCode.Alpha8;
  43.         private KeyCode bgRightPitchKeyVR = KeyCode.Alpha9;
  44.         private KeyCode bgInitializeKeyVR = KeyCode.Backspace;
  45.  
  46.         //カメラ操作関係キー設定
  47.         private KeyCode cameraLeftPitchKey = KeyCode.Period;
  48.         private KeyCode cameraRightPitchKey = KeyCode.Backslash;
  49.         private KeyCode cameraPitchInitializeKey = KeyCode.Slash;
  50.         private KeyCode cameraFoVPlusKey = KeyCode.RightBracket;
  51.         //Equalsになっているが日本語キーボードだとセミコロン
  52.         private KeyCode cameraFoVMinusKey = KeyCode.Equals;
  53.         //Semicolonになっているが日本語キーボードだとコロン
  54.         private KeyCode cameraFoVInitializeKey = KeyCode.Semicolon;
  55.  
  56.         //こっち見てキー設定
  57.         private KeyCode eyetoCamToggleKey = KeyCode.G;
  58.         private KeyCode eyetoCamChangeKey = KeyCode.T;
  59.  
  60.         //夜伽UI消しキー設定
  61.         private KeyCode hideUIToggleKey = KeyCode.Tab;
  62.  
  63.         //FPSモード切替キー設定
  64.         private KeyCode cameraFPSModeToggleKey = KeyCode.F;
  65.  
  66.         //TimeScale変更関係キー設定
  67.         private KeyCode timeScalePlusKey = KeyCode.LeftBracket;
  68.         private KeyCode timeScaleMinusKey = KeyCode.P;
  69.         private KeyCode timeScaleInitialize = KeyCode.BackQuote;
  70.         private KeyCode timeScaleZero = KeyCode.O;
  71.  
  72.         private enum modKey
  73.         {
  74.             Shift,
  75.             Alt,
  76.             Ctrl
  77.         }
  78.  
  79.         private Maid maid;
  80.         private CameraMain mainCamera;
  81.         private Transform mainCameraTransform;
  82.         private Transform maidTransform;
  83.         private Transform bg;
  84.         private GameObject manHead;
  85.         private GameObject uiObject;
  86.  
  87.         private float defaultFOV = 35f;
  88.         private bool allowUpdate = false;
  89.         private bool occulusVR = false;
  90.         private bool fpsMode = false;
  91.         private bool eyetoCamToggle = false;
  92.  
  93.         private float cameraRotateSpeed = 1f;
  94.         private float cameraFOVChangeSpeed = 0.25f;
  95.         private float floorMoveSpeed = 0.05f;
  96.         private float maidRotateSpeed = 2f;
  97.         private float fpsModeFoV = 60f;
  98.  
  99.         private int sceneLevel;
  100.         private int frameCount = 0;
  101.  
  102.         private float fpsOffsetForward = 0.02f;
  103.         private float fpsOffsetUp = -0.06f;
  104.         private float fpsOffsetRight = 0f;
  105.  
  106.         //private float fpsOffsetForward = 0.02f;
  107.         //private float fpsOffsetUp = 0.06f;
  108.  
  109.         ////以下の数値だと男の目の付近にカメラが移動しますが
  110.         ////うちのメイドはデフォで顔ではなく喉元見てるのであんまりこっち見てくれません
  111.         //private float fpsOffsetForward = 0.1f;
  112.         //private float fpsOffsetUp = 0.12f;
  113.  
  114.         private Vector3 oldPos;
  115.         private Vector3 oldTargetPos;
  116.         private float oldDistance;
  117.         private float oldFoV;
  118.         private Quaternion oldRotation;
  119.  
  120.         private bool oldEyetoCamToggle;
  121.         private int eyeToCamIndex = 0;
  122.  
  123.         private bool uiVisible = true;
  124.         private GameObject profilePanel;
  125.  
  126.         public void Awake()
  127.         {
  128.             GameObject.DontDestroyOnLoad(this);
  129.  
  130.             string path = Application.dataPath;
  131.             occulusVR = path.Contains("CM3D2VRx64");
  132.             if (occulusVR)
  133.             {
  134.                 bgLeftMoveKey = bgLeftMoveKeyVR;
  135.                 bgRightMoveKey = bgRightMoveKeyVR;
  136.                 bgForwardMoveKey = bgForwardMoveKeyVR;
  137.                 bgBackMoveKey = bgBackMoveKeyVR;
  138.                 bgUpMoveKey = bgUpMoveKeyVR;
  139.                 bgDownMoveKey = bgDownMoveKeyVR;
  140.                 bgLeftRotateKey = bgLeftRotateKeyVR;
  141.                 bgRightRotateKey = bgRightRotateKeyVR;
  142.                 bgLeftPitchKey = bgLeftPitchKeyVR;
  143.                 bgRightPitchKey = bgRightPitchKeyVR;
  144.                 bgInitializeKey = bgInitializeKeyVR;
  145.             }
  146.         }
  147.  
  148.         public void Start()
  149.         {
  150.             mainCameraTransform = Camera.main.gameObject.transform;
  151.         }
  152.  
  153.         public void OnLevelWasLoaded(int level)
  154.         {
  155.             sceneLevel = level;
  156.  
  157.             maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  158.  
  159.             if (maid)
  160.             {
  161.                 maidTransform = maid.body0.transform;
  162.             }
  163.  
  164.             bg = GameObject.Find("__GameMain__/BG").transform;
  165.  
  166.             mainCamera = GameMain.Instance.MainCamera;
  167.  
  168.             if (maid && bg && maidTransform)
  169.             {
  170.                 allowUpdate = true;
  171.             }
  172.             else
  173.             {
  174.                 allowUpdate = false;
  175.             }
  176.  
  177.             if (occulusVR)
  178.             {
  179.                 uiObject = GameObject.Find("ovr_screen");
  180.             }
  181.             else
  182.             {
  183.                 uiObject = GameObject.Find("/UI Root/Camera");
  184.                 defaultFOV = Camera.main.fieldOfView;
  185.             }
  186.  
  187.             if (level == 5)
  188.             {
  189.                 GameObject uiRoot = GameObject.Find("/UI Root");
  190.                 profilePanel = uiRoot.transform.Find("ProfilePanel").gameObject;
  191.             }
  192.             else if (level == 12)
  193.             {
  194.                 GameObject uiRoot = GameObject.Find("/UI Root");
  195.                 profilePanel = uiRoot.transform.Find("UserEditPanel").gameObject;
  196.             }
  197.             fpsMode = false;
  198.         }
  199.  
  200.         private bool getModKeyPressing(modKey key)
  201.         {
  202.             switch (key)
  203.             {
  204.                 case modKey.Shift:
  205.                     return (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift));
  206.                 case modKey.Alt:
  207.                     return (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt));
  208.                 case modKey.Ctrl:
  209.                     return (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl));
  210.                 default:
  211.                     return false;
  212.             }
  213.         }
  214.  
  215.         private void SaveCameraPos()
  216.         {
  217.             oldPos = mainCamera.GetPos();
  218.             oldTargetPos = mainCamera.GetTargetPos();
  219.             oldDistance = mainCamera.GetDistance();
  220.             oldRotation = mainCameraTransform.rotation;
  221.             oldFoV = Camera.main.fieldOfView;
  222.         }
  223.  
  224.         private void LoadCameraPos()
  225.         {
  226.             mainCameraTransform.rotation = oldRotation;
  227.             mainCamera.SetPos(oldPos);
  228.             mainCamera.SetTargetPos(oldTargetPos, true);
  229.             mainCamera.SetDistance(oldDistance, true);
  230.             Camera.main.fieldOfView = oldFoV;
  231.         }
  232.  
  233.         private Vector3 GetYotogiPlayPosition()
  234.         {
  235.             var field = mainCamera.GetType().GetField("m_vCenter", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance);
  236.             return (Vector3)field.GetValue(mainCamera);
  237.         }
  238.  
  239.         private void FirstPersonCamera()
  240.         {
  241.             if (sceneLevel == 14)
  242.             {
  243.                 if (!manHead)
  244.                 {
  245.                     if (frameCount == 60)
  246.                     {
  247.                         manHead = GameObject.Find("__GameMain__/Character/Active/AllOffset/Man[0]/Offset/_BO_mbody/ManBip/ManBip Spine/ManBip Spine1/ManBip Spine2/ManBip Neck/ManBip Head/_SM_mhead002/ManHead002");
  248.                         frameCount = 0;
  249.                     }
  250.                     else
  251.                     {
  252.                         frameCount++;
  253.                     }
  254.                 }
  255.                 else
  256.                 {
  257.                     if (occulusVR)
  258.                     {
  259.                         if (Input.GetKeyDown(cameraFPSModeToggleKey))
  260.                         {
  261.                             //    eyetoCamToggle = false;
  262.                             //    maid.EyeToCamera(Maid.EyeMoveType.無し, 0f);
  263.                             Vector3 localPos = uiObject.transform.localPosition;
  264.                             mainCamera.SetPos(manHead.transform.position);
  265.                             uiObject.transform.position = manHead.transform.position;
  266.                             uiObject.transform.localPosition = localPos;
  267.  
  268.                         }
  269.                     }
  270.                     else
  271.                     {
  272.                         if (Input.GetKeyDown(cameraFPSModeToggleKey))
  273.                         {
  274.                             fpsMode = !fpsMode;
  275.                             Console.WriteLine("fpsmode = " + fpsMode.ToString());
  276.                             if (fpsMode)
  277.                             {
  278.                                 SaveCameraPos();
  279.  
  280.                                 Camera.main.fieldOfView = fpsModeFoV;
  281.                                 eyetoCamToggle = false;
  282.                                 maid.EyeToCamera(Maid.EyeMoveType.無し, 0f);
  283.  
  284.                                 mainCameraTransform.rotation = Quaternion.LookRotation(-manHead.transform.up);
  285.  
  286.                                     manHead.renderer.enabled = false;
  287.                             }
  288.                             else
  289.                             {
  290.                                 Vector3 cameraTargetPosFromScript = GetYotogiPlayPosition();
  291.  
  292.                                 if (oldTargetPos != cameraTargetPosFromScript)
  293.                                 {
  294.                                     Console.WriteLine("Position Changed!");
  295.                                     oldTargetPos = cameraTargetPosFromScript;
  296.                                 }
  297.                                 manHead.renderer.enabled = true;
  298.  
  299.                                 LoadCameraPos();
  300.  
  301.                                 eyetoCamToggle = oldEyetoCamToggle;
  302.                                 oldEyetoCamToggle = eyetoCamToggle;
  303.                             }
  304.                         }
  305.                         if (fpsMode)
  306.                         {
  307.                             Vector3 cameraTargetPosFromScript = GetYotogiPlayPosition();
  308.                             if (oldTargetPos != cameraTargetPosFromScript)
  309.                             {
  310.                                 Console.WriteLine("Position Changed!");
  311.                                 mainCameraTransform.rotation = Quaternion.LookRotation(-manHead.transform.up);
  312.                                 oldTargetPos = cameraTargetPosFromScript;
  313.  
  314.                             }
  315.  
  316.                             mainCamera.SetPos(manHead.transform.position + manHead.transform.up * fpsOffsetUp + manHead.transform.right * fpsOffsetRight + manHead.transform.forward * fpsOffsetForward);
  317.                             mainCamera.SetTargetPos(manHead.transform.position + manHead.transform.up * fpsOffsetUp + manHead.transform.right * fpsOffsetRight + manHead.transform.forward * fpsOffsetForward, true);
  318.                             mainCamera.SetDistance(0f, true);
  319.                         }
  320.                     }
  321.                 }
  322.             }
  323.         }
  324.  
  325.         private void ExtendedCameraHandle()
  326.         {
  327.             if (!occulusVR)
  328.             {
  329.                 if (mainCameraTransform)
  330.                 {
  331.                     if (Input.GetKey(cameraFoVMinusKey))
  332.                     {
  333.                         Camera.main.fieldOfView += -cameraFOVChangeSpeed;
  334.                     }
  335.                     if (Input.GetKey(cameraFoVInitializeKey))
  336.                     {
  337.                         Camera.main.fieldOfView = defaultFOV;
  338.                     }
  339.                     if (Input.GetKey(cameraFoVPlusKey))
  340.                     {
  341.                         Camera.main.fieldOfView += cameraFOVChangeSpeed;
  342.                     }
  343.                     if (Input.GetKey(cameraLeftPitchKey))
  344.                     {
  345.                         mainCameraTransform.Rotate(0, 0, cameraRotateSpeed);
  346.                     }
  347.                     if (Input.GetKey(cameraPitchInitializeKey))
  348.                     {
  349.                         mainCameraTransform.eulerAngles = new Vector3(
  350.                             mainCameraTransform.rotation.eulerAngles.x,
  351.                             mainCameraTransform.rotation.eulerAngles.y,
  352.                             0f);
  353.                     }
  354.                     if (Input.GetKey(cameraRightPitchKey))
  355.                     {
  356.                         mainCameraTransform.Rotate(0, 0, -cameraRotateSpeed);
  357.                     }
  358.                 }
  359.             }
  360.         }
  361.  
  362.         private void FloorMover(float moveSpeed, float rotateSpeed)
  363.         {
  364.             if (bg)
  365.             {
  366.                 Vector3 cameraForward = mainCameraTransform.TransformDirection(Vector3.forward);
  367.                 Vector3 cameraRight = mainCameraTransform.TransformDirection(Vector3.right);
  368.                 Vector3 cameraUp = mainCameraTransform.TransformDirection(Vector3.up);
  369.  
  370.                 Vector3 direction = Vector3.zero;
  371.  
  372.                 if (Input.GetKey(bgLeftMoveKey))
  373.                 {
  374.                     direction += new Vector3(cameraRight.x, 0f, cameraRight.z) * moveSpeed;
  375.                 }
  376.                 if (Input.GetKey(bgRightMoveKey))
  377.                 {
  378.                     direction += new Vector3(cameraRight.x, 0f, cameraRight.z) * -moveSpeed;
  379.                 }
  380.                 if (Input.GetKey(bgBackMoveKey))
  381.                 {
  382.                     direction += new Vector3(cameraForward.x, 0f, cameraForward.z) * moveSpeed;
  383.                 }
  384.                 if (Input.GetKey(bgForwardMoveKey))
  385.                 {
  386.                     direction += new Vector3(cameraForward.x, 0f, cameraForward.z) * -moveSpeed;
  387.                 }
  388.                 if (Input.GetKey(bgUpMoveKey))
  389.                 {
  390.                     direction += new Vector3(0f, cameraUp.y, 0f) * -moveSpeed;
  391.                 }
  392.                 if (Input.GetKey(bgDownMoveKey))
  393.                 {
  394.                     direction += new Vector3(0f, cameraUp.y, 0f) * moveSpeed;
  395.                 }
  396.  
  397.                 bg.localPosition += direction;
  398.  
  399.                 if (Input.GetKey(bgLeftRotateKey))
  400.                 {
  401.                     bg.RotateAround(maidTransform.transform.position, Vector3.up, rotateSpeed);
  402.                 }
  403.                 if (Input.GetKey(bgRightRotateKey))
  404.                 {
  405.                     bg.RotateAround(maidTransform.transform.position, Vector3.up, -rotateSpeed);
  406.                 }
  407.                 if (Input.GetKey(bgLeftPitchKey))
  408.                 {
  409.                     bg.RotateAround(maidTransform.transform.position, new Vector3(cameraForward.x, 0f, cameraForward.z), rotateSpeed);
  410.                 }
  411.                 if (Input.GetKey(bgRightPitchKey))
  412.                 {
  413.                     bg.RotateAround(maidTransform.transform.position, new Vector3(cameraForward.x, 0f, cameraForward.z), -rotateSpeed);
  414.                 }
  415.  
  416.                 if (getModKeyPressing(modKey.Alt) && (Input.GetKey(bgLeftRotateKey) || Input.GetKey(bgRightRotateKey)))
  417.                 {
  418.                     bg.RotateAround(maidTransform.position, Vector3.up, -bg.rotation.eulerAngles.y);
  419.                 }
  420.                 if (getModKeyPressing(modKey.Alt) && (Input.GetKey(bgLeftPitchKey) || Input.GetKey(bgRightPitchKey)))
  421.                 {
  422.                     bg.RotateAround(maidTransform.position, Vector3.forward, -bg.rotation.eulerAngles.z);
  423.                     bg.RotateAround(maidTransform.position, Vector3.right, -bg.rotation.eulerAngles.x);
  424.                 }
  425.                 if (getModKeyPressing(modKey.Alt) && (Input.GetKey(bgLeftMoveKey) || Input.GetKey(bgRightMoveKey) || Input.GetKey(bgBackMoveKey) || Input.GetKey(bgForwardMoveKey)))
  426.                 {
  427.                     bg.localPosition = new Vector3(0f, bg.localPosition.y, 0f);
  428.                 }
  429.                 if (getModKeyPressing(modKey.Alt) && (Input.GetKey(bgUpMoveKey) || Input.GetKey(bgDownMoveKey)))
  430.                 {
  431.                     bg.localPosition = new Vector3(bg.localPosition.x, 0f, bg.localPosition.z);
  432.                 }
  433.                 if (Input.GetKeyDown(bgInitializeKey))
  434.                 {
  435.                     bg.localPosition = Vector3.zero;
  436.                     bg.RotateAround(maidTransform.position, Vector3.up, -bg.rotation.eulerAngles.y);
  437.                     bg.RotateAround(maidTransform.position, Vector3.right, -bg.rotation.eulerAngles.x);
  438.                     bg.RotateAround(maidTransform.position, Vector3.forward, -bg.rotation.eulerAngles.z);
  439.                     bg.RotateAround(maidTransform.position, Vector3.up, -bg.rotation.eulerAngles.y);
  440.                 }
  441.             }
  442.         }
  443.  
  444.         private void LookAtThis()
  445.         {
  446.             if (Input.GetKeyDown(eyetoCamChangeKey))
  447.             {
  448.                 if (eyeToCamIndex == Enum.GetNames(typeof(Maid.EyeMoveType)).Length - 1)
  449.                 {
  450.                     eyetoCamToggle = false;
  451.                     eyeToCamIndex = 0;
  452.                 }
  453.                 else
  454.                 {
  455.                     eyeToCamIndex++;
  456.                     eyetoCamToggle = true;
  457.                 }
  458.                 maid.EyeToCamera((Maid.EyeMoveType)eyeToCamIndex, 0f);
  459.                 Console.WriteLine("EyeToCam:{0}", eyeToCamIndex);
  460.             }
  461.  
  462.             if (Input.GetKeyDown(eyetoCamToggleKey))
  463.             {
  464.                 eyetoCamToggle = !eyetoCamToggle;
  465.                 //Console.WriteLine("Eye to Cam : {0}", eyetoCamToggle);
  466.                 if (!eyetoCamToggle)
  467.                 {
  468.                     maid.EyeToCamera(Maid.EyeMoveType.無し, 0f);
  469.                     eyeToCamIndex = 0;
  470.                     Console.WriteLine("EyeToCam:{0}", eyeToCamIndex);
  471.                 }
  472.                 else
  473.                 {
  474.                     maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
  475.                     eyeToCamIndex = 5;
  476.                     Console.WriteLine("EyeToCam:{0}", eyeToCamIndex);
  477.                 }
  478.             }
  479.         }
  480.  
  481.         private void TimeScaleChanger()
  482.         {
  483.             if (Input.GetKeyDown(timeScaleMinusKey))
  484.             {
  485.                 Time.timeScale = Mathf.Max(0f, Time.timeScale - 0.2f);
  486.                 Console.WriteLine("TileScale:{0}", Time.timeScale);
  487.             }
  488.             if (Input.GetKeyDown(timeScalePlusKey))
  489.             {
  490.                 Time.timeScale += 0.2f;
  491.                 Console.WriteLine("TileScale:{0}", Time.timeScale);
  492.             }
  493.             if (Input.GetKeyDown(timeScaleZero))
  494.             {
  495.                 Time.timeScale = 0f;
  496.                 Console.WriteLine("TileScale:{0}", Time.timeScale);
  497.             }
  498.             if (Input.GetKeyDown(timeScaleInitialize))
  499.             {
  500.                 Time.timeScale = 1f;
  501.                 Console.WriteLine("TileScale:{0}", Time.timeScale);
  502.             }
  503.         }
  504.  
  505.         private void HideUI()
  506.         {
  507.             if (Input.GetKeyDown(hideUIToggleKey))
  508.             {
  509.                 if (sceneLevel == 5 || sceneLevel == 14)
  510.                 {
  511.                     var field = GameMain.Instance.MainCamera.GetType().GetField("m_eFadeState", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance);
  512.  
  513.                     int i = (int)field.GetValue(mainCamera);
  514.                     //Console.WriteLine("FadeState:{0}", i);
  515.                     if (i == 0)
  516.                     {
  517.                         uiVisible = !uiVisible;
  518.                         if (uiObject)
  519.                         {
  520.                             uiObject.SetActive(uiVisible);
  521.                         }
  522.                     }
  523.                     Console.WriteLine("UIVisible:{0}", uiVisible);
  524.                 }
  525.             }
  526.         }
  527.  
  528.         public void Update()
  529.         {
  530.  
  531.             if (sceneLevel == 5)
  532.             {
  533.                 if (profilePanel.activeSelf)
  534.                 {
  535.                     allowUpdate = false;
  536.                 }
  537.                 else
  538.                 {
  539.                     allowUpdate = true;
  540.                 }
  541.             }
  542.             else if (sceneLevel == 12)
  543.             {
  544.                 if (profilePanel.activeSelf)
  545.                 {
  546.                     allowUpdate = false;
  547.                 }
  548.                 else
  549.                 {
  550.                     allowUpdate = true;
  551.                 }
  552.             }
  553.  
  554.             if (allowUpdate)
  555.             {
  556.                 float moveSpeed = floorMoveSpeed;
  557.                 float rotateSpeed = maidRotateSpeed;
  558.  
  559.                 if (getModKeyPressing(modKey.Shift))
  560.                 {
  561.                     moveSpeed *= 0.1f;
  562.                     rotateSpeed *= 0.1f;
  563.                 }
  564.  
  565.                 //TimeScaleChanger();
  566.                
  567.                 FirstPersonCamera();
  568.  
  569.                 LookAtThis();
  570.  
  571.                 FloorMover(moveSpeed, rotateSpeed);
  572.  
  573.                 if (!occulusVR)
  574.                 {
  575.                     ExtendedCameraHandle();
  576.  
  577.                     HideUI();
  578.                 }
  579.             }
  580.         }
  581.     }
  582. }
Advertisement
Add Comment
Please, Sign In to add comment