< Summary

Class:AvatarAnimationEventAudioHandler
Assembly:AvatarShape
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/Avatar/AvatarAnimationEventAudioHandler.cs
Covered lines:0
Uncovered lines:26
Coverable lines:26
Total lines:60
Line coverage:0% (0 of 26)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Init(...)0%6200%
AnimEvent_FootstepLight()0%2100%
AnimEvent_FootstepSlide()0%2100%
AnimEvent_FootstepWalk()0%2100%
AnimEvent_FootstepRun()0%2100%
AnimEvent_FootstepJump()0%2100%
AnimEvent_FootstepLand()0%2100%
AnimEvent_ClothesRustleShort()0%2100%
AnimEvent_Clap()0%2100%
AnimEvent_ThrowMoney()0%2100%
AnimEvent_BlowKiss()0%2100%
TryPlayingEvent(...)0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/Avatar/AvatarAnimationEventAudioHandler.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5public class AvatarAnimationEventAudioHandler : MonoBehaviour
 6{
 7    AudioEvent footstepLight;
 8    AudioEvent footstepSlide;
 9    AudioEvent footstepWalk;
 10    AudioEvent footstepRun;
 11    AudioEvent footstepJump;
 12    AudioEvent footstepLand;
 13    AudioEvent clothesRustleShort;
 14    AudioEvent clap;
 15    AudioEvent throwMoney;
 16    AudioEvent blowKiss;
 17
 18    public void Init(AudioContainer audioContainer)
 19    {
 020        if (audioContainer == null)
 021            return;
 22
 023        footstepLight = audioContainer.GetEvent("FootstepLight");
 024        footstepSlide = audioContainer.GetEvent("FootstepSlide");
 025        footstepWalk = audioContainer.GetEvent("FootstepWalk");
 026        footstepRun = audioContainer.GetEvent("FootstepRun");
 027        footstepJump = audioContainer.GetEvent("FootstepJump");
 028        footstepLand = audioContainer.GetEvent("FootstepLand");
 029        clothesRustleShort = audioContainer.GetEvent("ClothesRustleShort");
 030        clap = audioContainer.GetEvent("ExpressionClap");
 031        throwMoney = audioContainer.GetEvent("ExpressionThrowMoney");
 032        blowKiss = audioContainer.GetEvent("ExpressionBlowKiss");
 033    }
 34
 035    public void AnimEvent_FootstepLight() { TryPlayingEvent(footstepLight); }
 36
 037    public void AnimEvent_FootstepSlide() { TryPlayingEvent(footstepSlide); }
 38
 039    public void AnimEvent_FootstepWalk() { TryPlayingEvent(footstepWalk); }
 40
 041    public void AnimEvent_FootstepRun() { TryPlayingEvent(footstepRun); }
 42
 043    public void AnimEvent_FootstepJump() { TryPlayingEvent(footstepJump); }
 44
 045    public void AnimEvent_FootstepLand() { TryPlayingEvent(footstepLand); }
 46
 047    public void AnimEvent_ClothesRustleShort() { TryPlayingEvent(clothesRustleShort); }
 48
 049    public void AnimEvent_Clap() { TryPlayingEvent(clap); }
 50
 051    public void AnimEvent_ThrowMoney() { TryPlayingEvent(throwMoney); }
 52
 053    public void AnimEvent_BlowKiss() { TryPlayingEvent(blowKiss); }
 54
 55    void TryPlayingEvent(AudioEvent audioEvent)
 56    {
 057        if (audioEvent != null)
 058            audioEvent.Play(true);
 059    }
 60}