< Summary

Class:DCL.StickerAnimationListener
Assembly:MainScripts
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/StickersController/StickerAnimationListener.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:24
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%2100%
PlaySticker(...)0%20400%

File(s)

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

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCL
 4{
 5    public class StickerAnimationListener : MonoBehaviour
 6    {
 7        private const float WEIGHT_THRESHOLD = 0.5f;
 8        private StickersController stickersController;
 9
 010        private void Awake() { stickersController = GetComponentInParent<StickersController>(); }
 11
 12        //It's going to be called through an AnimationEvent
 13        private void PlaySticker(AnimationEvent animEvent)
 14        {
 015            if (string.IsNullOrEmpty(animEvent.stringParameter))
 016                return;
 17
 018            if (animEvent.animationState.weight < WEIGHT_THRESHOLD)
 019                return;
 20
 021            stickersController?.PlaySticker(animEvent.stringParameter);
 022        }
 23    }
 24}