< Summary

Class:ExpressionsHotKeyController
Assembly:PlayerAvatarController
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/PlayerAvatarController/ExpressionsHotKeyController.cs
Covered lines:15
Uncovered lines:2
Coverable lines:17
Total lines:56
Line coverage:88.2% (15 of 17)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%110100%
ExpressionCalled(...)0%2100%

File(s)

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

#LineLine coverage
 1using System;
 2using UnityEngine;
 3
 4public class ExpressionsHotKeyController : MonoBehaviour
 5{
 6    [Serializable]
 7    private class ExpressionInputActionToId
 8    {
 9        public InputAction_Trigger inputAction;
 10        public string id;
 11    }
 12
 13    [SerializeField] private ExpressionInputActionToId waveExpression;
 14    [SerializeField] private ExpressionInputActionToId robotExpression;
 15    [SerializeField] private ExpressionInputActionToId fistpumpExpression;
 16    [SerializeField] private ExpressionInputActionToId raiseHandExpression;
 17    [SerializeField] private ExpressionInputActionToId clapExpression;
 18    [SerializeField] private ExpressionInputActionToId throwMoneyExpression;
 19    [SerializeField] private ExpressionInputActionToId sendKissExpression;
 20
 21    private InputAction_Trigger.Triggered waveDelegate;
 22    private InputAction_Trigger.Triggered robotDelegate;
 23    private InputAction_Trigger.Triggered fistpumpDelegate;
 24    private InputAction_Trigger.Triggered raiseHandDelegate;
 25    private InputAction_Trigger.Triggered clapDelegate;
 26    private InputAction_Trigger.Triggered throwMoneyDelegate;
 27    private InputAction_Trigger.Triggered sendKissDelegate;
 28
 029    private UserProfile ownUserProfile => UserProfile.GetOwnUserProfile();
 30
 31    private void Awake()
 32    {
 59733        waveDelegate = (x) => ExpressionCalled(waveExpression.id);
 59734        waveExpression.inputAction.OnTriggered += waveDelegate;
 35
 59736        robotDelegate = (x) => ExpressionCalled(robotExpression.id);
 59737        robotExpression.inputAction.OnTriggered += robotDelegate;
 38
 59739        fistpumpDelegate = (x) => ExpressionCalled(fistpumpExpression.id);
 59740        fistpumpExpression.inputAction.OnTriggered += fistpumpDelegate;
 41
 59742        raiseHandDelegate = (x) => ExpressionCalled(raiseHandExpression.id);
 59743        raiseHandExpression.inputAction.OnTriggered += raiseHandDelegate;
 44
 59745        clapDelegate = (x) => ExpressionCalled(clapExpression.id);
 59746        clapExpression.inputAction.OnTriggered += clapDelegate;
 47
 59748        throwMoneyDelegate = (x) => ExpressionCalled(throwMoneyExpression.id);
 59749        throwMoneyExpression.inputAction.OnTriggered += throwMoneyDelegate;
 50
 59751        sendKissDelegate = (x) => ExpressionCalled(sendKissExpression.id);
 59752        sendKissExpression.inputAction.OnTriggered += sendKissDelegate;
 59753    }
 54
 055    private void ExpressionCalled(string id) { ownUserProfile.SetAvatarExpression(id); }
 56}