< Summary

Class:JumpInAction
Assembly:UIComponents
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/UIComponents/Scripts/Components/Button/JumpInAction.cs
Covered lines:6
Uncovered lines:4
Coverable lines:10
Total lines:32
Line coverage:60% (6 of 10)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%110100%
OnDestroy()0%220100%
JumpIn()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/UIComponents/Scripts/Components/Button/JumpInAction.cs

#LineLine coverage
 1using DCL.Interface;
 2using UnityEngine;
 3
 4[RequireComponent(typeof(ButtonComponentView))]
 5public class JumpInAction : MonoBehaviour
 6{
 7    public Vector2Int coords;
 8    public string serverName;
 9    public string layerName;
 10
 11    private ButtonComponentView button;
 12
 13    private void Start()
 14    {
 1515        button = GetComponent<ButtonComponentView>();
 1516        button.onClick.AddListener(JumpIn);
 1517    }
 18
 19    private void OnDestroy()
 20    {
 3721        if (button != null)
 1522            button.onClick.RemoveAllListeners();
 3723    }
 24
 25    internal void JumpIn()
 26    {
 027        if (string.IsNullOrEmpty(serverName))
 028            WebInterface.GoTo(coords.x, coords.y);
 29        else
 030            WebInterface.JumpIn(coords.x, coords.y, serverName, layerName);
 031    }
 32}

Methods/Properties

Start()
OnDestroy()
JumpIn()