示例#1
0
        public static bool Prefix()
        {
            bool flag  = MainCameraControlPatcher.IsInSeamoth && !Config.EnableSeamoth;
            bool flag2 = MainCameraControlPatcher.IsInPrawnSuit && !Config.EnablePrawn;
            bool flag3 = !Config.EnableSnapTurning || flag || flag2;
            bool result;

            if (flag3)
            {
                result = true;
            }
            else
            {
                bool flag4       = GameInput.GetButtonDown(26) || KeyCodeUtils.GetKeyDown(Config.KeybindKeyRight);
                bool flag5       = GameInput.GetButtonDown(25) || KeyCodeUtils.GetKeyDown(Config.KeybindKeyLeft);
                bool buttonHeld  = GameInput.GetButtonHeld(25);
                bool buttonHeld2 = GameInput.GetButtonHeld(26);
                bool flag6       = flag5 || flag4 || buttonHeld || buttonHeld2;
                bool flag7       = XRSettings.enabled && flag6;
                bool flag8       = flag7;
                if (flag8)
                {
                    MainCameraControlPatcher.UpdatePlayerOrVehicleRotation(flag4, flag5);
                    result = false;
                }
                else
                {
                    result = true;
                }
            }
            return(result);
        }
示例#2
0
        // Token: 0x06000011 RID: 17 RVA: 0x00002650 File Offset: 0x00000850
        private static Vector3 GetNewEulerAngles(bool didLookRight, bool didLookLeft)
        {
            Vector3 result    = (MainCameraControlPatcher.IsInSeamoth || MainCameraControlPatcher.IsInPrawnSuit) ? Player.main.currentMountedVehicle.transform.localRotation.eulerAngles : Player.main.transform.localRotation.eulerAngles;
            float   snapAngle = MainCameraControlPatcher.GetSnapAngle();

            if (didLookRight)
            {
                result.y += snapAngle;
            }
            else if (didLookLeft)
            {
                result.y -= snapAngle;
            }
            return(result);
        }
示例#3
0
        // Token: 0x06000010 RID: 16 RVA: 0x000025D0 File Offset: 0x000007D0
        private static void UpdatePlayerOrVehicleRotation(bool didLookRight, bool didLookLeft)
        {
            Vector3 newEulerAngles = MainCameraControlPatcher.GetNewEulerAngles(didLookRight, didLookLeft);
            bool    isInSeamoth    = MainCameraControlPatcher.IsInSeamoth;

            if (isInSeamoth)
            {
                Player.main.currentMountedVehicle.transform.localRotation = Quaternion.Euler(newEulerAngles);
            }
            else
            {
                bool isInPrawnSuit = MainCameraControlPatcher.IsInPrawnSuit;
                if (isInPrawnSuit)
                {
                    Player.main.currentMountedVehicle.transform.localRotation = Quaternion.Euler(newEulerAngles);
                }
                else
                {
                    Player.main.transform.localRotation = Quaternion.Euler(newEulerAngles);
                }
            }
        }