This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
station_obscurum_unity/Assets/Scripts/Legacy/Player/CameraController.cs
MarcoHampel f8590432ba Assemblies Made and Refactored Code Folders
Created assemblies for the new design code. Relocated legacy scripts into a legacy folder and made a "new_design" folder for new design.
2023-09-11 19:39:27 -04:00

54 lines
1.6 KiB
C#

using UnityEngine;
using FishNet.Object;
using FishNet.Connection;
namespace Player
{
public class CameraController : NetworkBehaviour
{
//private float mouseX = 0;
//private float mouseY;
public Camera cam;
[SerializeField] private Transform target;
private Vector3 offset;
public Vector3 Forward { get; private set; } = Vector3.zero;
public Vector3 Right { get; private set; } = Vector3.zero;
//private float originalDist = 0;
//private float newDist = 0;
//[SerializeField]
// private bool isChild = false;
// Start is called before the first frame update
private void Start()
{
}
// Update is called once per frame
private void Update()
{
GetMouseLook();
//if(target!=null&&!isChild)
//transform.position = target.transform.position+offset;
Forward = new Vector3(cam.transform.forward.x, target.transform.forward.y, cam.transform.forward.z);
Right = new Vector3(cam.transform.right.x, target.transform.right.y, cam.transform.right.z);
}
private void GetMouseLook()
{
//mouseX = Input.GetAxis("Mouse X");
//mouseY = Input.GetAxis("Mouse Y");
//transform.Rotate(0, mouseX * Time.deltaTime * 180f, 0);
//cam.transform.parent.parent.transform.Rotate(mouseY * Time.deltaTime * 180f, 0, 0);
//Cursor.visible = false;
//Cursor.lockState = CursorLockMode.Locked;
}
}
}