< Summary

Class:DCL.Components.ScreenSizeWatcher
Assembly:MainScripts
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ScreenController/ScreenSizeWatcher.cs
Covered lines:0
Uncovered lines:10
Coverable lines:10
Total lines:31
Line coverage:0% (0 of 10)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%2100%
LateUpdate()0%6200%
UpdateScreenSize()0%2100%
HasScreenSizeChanged()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ScreenController/ScreenSizeWatcher.cs

#LineLine coverage
 1using System;
 2using UnityEngine;
 3
 4namespace DCL.Components
 5{
 6    public class ScreenSizeWatcher : MonoBehaviour
 7    {
 08        private BaseVariable<Vector2Int> screenSize => DataStore.i.screen.size;
 9        private void Awake()
 10        {
 011            UpdateScreenSize();
 012        }
 13        private void LateUpdate()
 14        {
 015            if (HasScreenSizeChanged())
 16            {
 017                UpdateScreenSize();
 18            }
 019        }
 20
 21        private void UpdateScreenSize()
 22        {
 023            screenSize.Set(new Vector2Int(Screen.width, Screen.height));
 024        }
 25        private bool HasScreenSizeChanged()
 26        {
 027            Vector2Int size = screenSize.Get();
 028            return size.x != Screen.width || size.y != Screen.height;
 29        }
 30    }
 31}