< Summary

Class:DCL.PhysicsSyncController
Assembly:PhysicsSyncController
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/PhysicsSyncController/PhysicsSyncController.cs
Covered lines:15
Uncovered lines:1
Coverable lines:16
Total lines:40
Line coverage:93.7% (15 of 16)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
PhysicsSyncController()0%110100%
MarkDirty()0%110100%
Sync()0%220100%
Dispose()0%110100%
Initialize()0%110100%

File(s)

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

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5namespace DCL
 6{
 7    public class PhysicsSyncController : IPhysicsSyncController
 8    {
 09        public bool isDirty { get; private set; } = false;
 10
 62911        public PhysicsSyncController()
 12        {
 62913            Physics.autoSimulation = false;
 62914            Physics.autoSyncTransforms = false;
 15
 62916            PoolManager.i.OnGet -= MarkDirty;
 62917            PoolManager.i.OnGet += MarkDirty;
 62918        }
 19
 1275020        public void MarkDirty() { isDirty = true; }
 21
 22        public void Sync()
 23        {
 1230824            if (!isDirty)
 639625                return;
 26
 591227            isDirty = false;
 591228            Physics.SyncTransforms();
 591229        }
 30
 31        public void Dispose()
 32        {
 62933            PoolManager.i.OnGet -= MarkDirty;
 62934        }
 35
 36        public void Initialize()
 37        {
 62938        }
 39    }
 40}