using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Animations; namespace BITFALL.HotFix { public class FPSCameraViewFix : MonoBehaviour { [SerializeField] private ParentConstraint _constraint; [SerializeField] private Vector3 _offset; [SerializeField] private bool useLateUpdate; private Transform Transform; private Transform Source; private void Start() { Destroy(_constraint); Transform = transform; Source = _constraint.GetSource(0).sourceTransform; } private void Update() { if(!useLateUpdate)Execute(); } private void LateUpdate() { if(useLateUpdate)Execute(); } private void Execute() { Transform.localPosition = Source.localPosition; Transform.localRotation = Source.localRotation * Quaternion.Euler(_offset); } } }