< Summary

Class: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:21
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
 3public class StickerAnimationListener : MonoBehaviour
 4{
 5    private const float WEIGHT_THRESHOLD = 0.5f;
 6    private StickersController stickersController;
 7
 08    private void Awake() { stickersController = GetComponentInParent<StickersController>(); }
 9
 10    //It's going to be called through an AnimationEvent
 11    private void PlaySticker(AnimationEvent animEvent)
 12    {
 013        if (string.IsNullOrEmpty(animEvent.stringParameter))
 014            return;
 15
 016        if (animEvent.animationState.weight < WEIGHT_THRESHOLD)
 017            return;
 18
 019        stickersController?.PlaySticker(animEvent.stringParameter);
 020    }
 21}