Optimized Oribit Camera in Replay, now only moving with right click

This commit is contained in:
Thorbjoern
2025-06-02 20:13:25 +02:00
parent 0cb48fe1a9
commit 045218dc9f
4 changed files with 67 additions and 13 deletions
@@ -0,0 +1,35 @@
using UnityEngine;
using UnityEngine.InputSystem;
using Unity.Cinemachine;
public class OrbitCameraMouseControl : MonoBehaviour
{
[Header("Input Actions")]
public InputActionReference aimAction; // CM Default / Aim
[Header("Cinemachine Components")]
public CinemachineInputAxisController inputAxisController;
private void OnEnable()
{
if (aimAction != null)
aimAction.action.Enable();
}
private void OnDisable()
{
if (aimAction != null)
aimAction.action.Disable();
}
void Update()
{
bool isAiming = aimAction != null && aimAction.action.ReadValue<float>() > 0.5f;
if (inputAxisController != null)
{
inputAxisController.Controllers[0].Enabled = isAiming;
inputAxisController.Controllers[1].Enabled = isAiming;
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 77bfd51a51660c04b8c06ccb69c96587