< Summary

Class:SmoothAxisProvider
Assembly:Camera
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Camera/SmoothAxisProvider.cs
Covered lines:9
Uncovered lines:0
Coverable lines:9
Total lines:40
Line coverage:100% (9 of 9)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%330100%
Update()0%110100%
GetAxisValue(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Camera/SmoothAxisProvider.cs

#LineLine coverage
 1using System;
 2using System.Collections;
 3using System.Collections.Generic;
 4using Cinemachine;
 5using Cinemachine.Utility;
 6using DCL.Camera;
 7using DCL.Helpers;
 8using UnityEngine;
 9
 10public class SmoothAxisProvider : MonoBehaviour, AxisState.IInputAxisProvider
 11{
 12    public Vector3 dampTime;
 13
 14    private Vector3 axis = new Vector3();
 15    private Vector3 axisTarget = new Vector3();
 16
 17    public InputAction_Measurable axisX;
 18    public InputAction_Measurable axisY;
 19    private InputSpikeFixer[] inputSpikeFixer;
 20
 21    private void Awake()
 22    {
 40223        inputSpikeFixer = new []
 24        {
 1495825            new InputSpikeFixer(() => Utils.IsCursorLocked ? CursorLockMode.Locked : CursorLockMode.None),
 1533626            new InputSpikeFixer(() => Utils.IsCursorLocked ? CursorLockMode.Locked : CursorLockMode.None)
 27        };
 40228    }
 29    void Update()
 30    {
 1492631        axisTarget[0] = axisX.GetValue();
 1492632        axisTarget[1] = axisY.GetValue();
 1492633        axis += Damper.Damp(axisTarget - axis, dampTime, Time.deltaTime);
 1492634    }
 35
 36    public float GetAxisValue(int axis)
 37    {
 2949038        return inputSpikeFixer[axis].GetValue(this.axis[axis]);
 39    }
 40}