< Summary

Class:UI_FacePlayer
Assembly:Test
File(s):E:/Unity/Unity Project/VR-Cooking-Demo/Assets/_Scripts/UI_FacePlayer.cs
Covered lines:12
Uncovered lines:0
Coverable lines:12
Total lines:40
Line coverage:100% (12 of 12)
Covered branches:0
Total branches:0
Covered methods:3
Total methods:3
Method coverage:100% (3 of 3)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%000100%
Update()0%000100%
TurnToCamera()0%000100%

File(s)

E:/Unity/Unity Project/VR-Cooking-Demo/Assets/_Scripts/UI_FacePlayer.cs

#LineLine coverage
 1/*
 2 *
 3 * Code by:
 4 *      Dimitrios Vlachos
 5 *      djv1@student.london.ac.uk
 6 *      dimitri.j.vlachos@gmail.com
 7 *
 8 */
 9
 10using System.Collections;
 11using System.Collections.Generic;
 12using UnityEngine;
 13
 14public class UI_FacePlayer : MonoBehaviour
 15{
 16    Camera cam;
 17    // Start is called before the first frame update
 18    void Start()
 119    {
 120        cam = Camera.main;
 121    }
 22
 23    // Update is called once per frame
 24    void Update()
 168225    {
 168226        TurnToCamera();
 168227    }
 28
 29    void TurnToCamera()
 168230    {
 31        // Get the direction to look
 168232        Vector3 v = cam.transform.position - transform.position;
 33        // Cancel the other directions of rotation
 168234        v.x = v.z = 0.0f;
 35
 36        // Turn to the camera
 168237        transform.LookAt(cam.transform.position - v);
 168238        transform.Rotate(0, 180, 0);
 168239    }
 40}

Methods/Properties

Start()
Update()
TurnToCamera()