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
8 changes: 8 additions & 0 deletions Source/.idea/.idea.Source/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 22 additions & 4 deletions Source/Assets/Character/Movements/CharacterRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ public class CharacterRotation : MonoBehaviour
[SerializeField]
[Tooltip("The camera")]
private Transform cameraTransform;

//

private Vector3 initVector;

[SerializeField] [Tooltip("The min value of the field of view")]
private float minFOV = 10f;

[SerializeField] [Tooltip("The max value of the field of view")]
private float maxFOV = 60f;

private bool IsLocked => LockCharacter();

Expand All @@ -37,12 +42,25 @@ public void CheckCollision()
if (Physics.Raycast(targetTransform.position, direction, out RaycastHit hit, initVector.magnitude))
{
cameraTransform.position = hit.point;
Debug.Log("Did Hit");
}
else
{
cameraTransform.localPosition = initVector;
Debug.Log("Did not Hit");
}
}

public void ScrollWheelCamera()
{
//Zoom
if (Input.GetAxis("Mouse ScrollWheel") > 0 && cameraTransform.GetComponent<Camera>().fieldOfView > minFOV)
{
cameraTransform.GetComponent<Camera>().fieldOfView-=2;
}

//Dezoom
if (Input.GetAxis("Mouse ScrollWheel") < 0 && cameraTransform.GetComponent<Camera>().fieldOfView < maxFOV)
{
cameraTransform.GetComponent<Camera>().fieldOfView+=2;
}
}

Expand Down
2 changes: 0 additions & 2 deletions Source/Assets/Character/Movements/GrapplingHookShooter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Character
Expand Down
3 changes: 2 additions & 1 deletion Source/Assets/Character/Movements/MovementManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void Update()
gravity?.GravityPush();
rotation?.LookAround(input);
LedgeCatcher?.TryCatchLedge(input);
rotation.CheckCollision();
rotation?.CheckCollision();
rotation?.ScrollWheelCamera();
}
}
}
8 changes: 8 additions & 0 deletions Source/Assets/Prefabs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading