Skip to content
Draft
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
251 changes: 0 additions & 251 deletions Class1.cs

This file was deleted.

120 changes: 55 additions & 65 deletions CustomLookAround.cs
Original file line number Diff line number Diff line change
@@ -1,92 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine;

namespace FreeCam
{
class CustomLookAround : MonoBehaviour
public class CustomLookAround : MonoBehaviour
{
private float _degreesX;
private float _degreesY;

protected float _degreesX;
public void Start() => Cursor.lockState = CursorLockMode.Locked;

protected float _degreesY;
public void Awake() => Debug.LogWarning("Awake!");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can just be removed


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

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

void Update()
{
if (OWInput.GetInputMode() == InputMode.None)
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;
return;
}

_degreesY = OWInput.GetValue(InputLibrary.look).y * 2f;
_degreesX = OWInput.GetValue(InputLibrary.look).x * 2f;

MainClass._camera.transform.Rotate(Vector3.up, _degreesX);
MainClass._camera.transform.Rotate(Vector3.right, -_degreesY);
MainClass.Camera.transform.Rotate(Vector3.up, _degreesX);
MainClass.Camera.transform.Rotate(Vector3.right, -_degreesY);

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

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

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

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

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

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

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

if (Input.GetKey(KeyCode.Q))
{
MainClass._freeCam.transform.Rotate(Vector3.forward, 1);
}
if (Input.GetKey(KeyCode.S))
{
MainClass.FreeCam.transform.position -= MainClass.FreeCam.transform.forward * 0.02f * MainClass.MoveSpeed;
}

if (Input.GetKey(KeyCode.E))
{
MainClass._freeCam.transform.Rotate(Vector3.forward, -1);
}
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;
}

if (Input.GetKey(KeyCode.Q))
{
MainClass.FreeCam.transform.Rotate(Vector3.forward, 1);
}

if (Input.GetKey(KeyCode.E))
{
MainClass.FreeCam.transform.Rotate(Vector3.forward, -1);
}
}
}
Expand Down
Loading