Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions Class1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ class MainClass : ModBehaviour
{
public static GameObject _freeCam;
public static Camera _camera;
OWCamera _OWCamera;
public static float _moveSpeed = 7f;
public static float _moveSpeed = 0.1f;
OWCamera _OWCamera;
InputMode _storedMode;

public static bool inputEnabled = false;

static bool inputEnabled = false;
bool mode = false;

public bool _disableLauncher;
public int _fov;
bool _disableLauncher;
int _fov;

public void Start()
{
Expand Down Expand Up @@ -124,7 +121,12 @@ void Update()
SetupCamera();
}

if (Input.GetKeyDown(KeyCode.LeftArrow))
if (Input.GetKeyDown(KeyCode.DownArrow))
{
_moveSpeed = 0.1f;
}

if (Input.GetKeyDown(KeyCode.LeftArrow))
{
if (Locator.GetPlayerSuit().IsWearingHelmet())
{
Expand Down Expand Up @@ -203,12 +205,12 @@ void Update()

if (Input.GetKeyDown(KeyCode.KeypadPlus))
{
_moveSpeed = 7f;
_moveSpeed *= 2f;
}

if (Input.GetKeyDown(KeyCode.KeypadEnter))
{
_moveSpeed = 1000f;
_moveSpeed /= 2f;
}

if (Input.GetKeyDown(KeyCode.KeypadPeriod))
Expand Down
53 changes: 9 additions & 44 deletions CustomLookAround.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,37 @@ class CustomLookAround : MonoBehaviour
{

protected float _degreesX;

protected float _degreesY;
protected float _moveX;
protected float _moveY;
protected float _boost = 1f;

void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}

void Awake()
{
Debug.LogWarning("Awake!");
}

void Update()
{
if (OWInput.GetInputMode() == InputMode.None)
{
this._degreesY = OWInput.GetValue(InputLibrary.look, InputMode.All).y * 2f;
this._degreesX = OWInput.GetValue(InputLibrary.look, InputMode.All).x * 2f;
this._moveX = OWInput.GetValue(InputLibrary.moveXZ, InputMode.All).x;
this._moveY = OWInput.GetValue(InputLibrary.moveXZ, InputMode.All).y;

MainClass._camera.transform.Rotate(Vector3.up, _degreesX);
MainClass._camera.transform.Rotate(Vector3.right, -_degreesY);
MainClass._freeCam.transform.position += _moveY * ((MainClass._freeCam.transform.forward * 0.02f * MainClass._moveSpeed) * _boost);
MainClass._freeCam.transform.position += _moveX * ((MainClass._freeCam.transform.right * 0.02f * MainClass._moveSpeed) * _boost);

if (Input.GetKey(KeyCode.LeftShift))
{
if (MainClass._moveSpeed == 7f)
{
MainClass._moveSpeed = 14f;
}

if (MainClass._moveSpeed == 1000f)
{
MainClass._moveSpeed = 2000;
}
_boost = 2;
}
else
{
if (MainClass._moveSpeed == 14f)
{
MainClass._moveSpeed = 7f;
}

if (MainClass._moveSpeed == 2000f)
{
MainClass._moveSpeed = 1000;
}
}

if (Input.GetKey(KeyCode.W))
{
MainClass._freeCam.transform.position += MainClass._freeCam.transform.forward * 0.02f * MainClass._moveSpeed;
}

if (Input.GetKey(KeyCode.S))
{
MainClass._freeCam.transform.position -= MainClass._freeCam.transform.forward * 0.02f * MainClass._moveSpeed;
}

if (Input.GetKey(KeyCode.A))
{
MainClass._freeCam.transform.position -= MainClass._freeCam.transform.right * 0.02f * MainClass._moveSpeed;
}

if (Input.GetKey(KeyCode.D))
{
MainClass._freeCam.transform.position += MainClass._freeCam.transform.right * 0.02f * MainClass._moveSpeed;
_boost = 1;
}

if (Input.GetKey(KeyCode.Q))
Expand Down