< Summary

Class:InfFloorBlenderControl
Assembly:InfiniteFloor
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/InfiniteFloor/InfiniteFloorBlenderControl/InfFloorBlenderControl.cs
Covered lines:0
Uncovered lines:19
Coverable lines:19
Total lines:77
Line coverage:0% (0 of 19)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
InfFloorBlenderControl()0%2100%
Awake()0%2100%
Start()0%2100%
Update()0%6200%
GetProceduralSkyboxColors()0%6200%
SetProceduralInfBlenderColors()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/InfiniteFloor/InfiniteFloorBlenderControl/InfFloorBlenderControl.cs

#LineLine coverage
 1using System;
 2using System.Collections;
 3using System.Collections.Generic;
 4using UnityEngine;
 5
 6public class InfFloorBlenderControl : MonoBehaviour
 7{
 8    [Header("Skybox Data")]
 9    [SerializeField] private Material skyboxMaterial;
 10
 11    [Header("Infinite Floor Blender Data")]
 12    [SerializeField] private Material infFloorBlenderMaterial;
 13
 14    [Space]
 15    [Header("Colors Procedural Skybox ")]
 16    [SerializeField] private Color _proceduralSkyboxGroundColor;
 17    [SerializeField] private Color _proceduralSkyboxHorizonColor;
 18
 19    [Space]
 20    [Header("Time Interval")]
 21    [Tooltip("Time interval dictates the amount of time script will wait before changing the colors")]
 22
 23    [SerializeField] private bool _isTimeIntervalEnabled;
 024    [SerializeField] private float _timeInterval = 5f;
 25
 26    [Header("Debug")]
 27    [SerializeField] private bool _isDebug;
 28
 29    // Start is called before the first frame update
 30
 31    private void Awake()
 32    {
 33
 034    }
 35    void Start()
 36    {
 037        GetProceduralSkyboxColors();
 038        SetProceduralInfBlenderColors();
 039    }
 40
 41    // Update is called once per frame
 42    void Update()
 43    {
 44        // example
 045        if (_isTimeIntervalEnabled == true)
 46        {
 47            // every 5 seconds change the colors
 048            Invoke("GetProceduralSkyboxColors" , _timeInterval);
 049            Invoke("SetProceduralInfBlenderColors" , _timeInterval);
 50        }
 051    }
 52
 53    // get _proceduralSkyboxGroundColor and _proceduralSkyboxHorizonColor from skybox material
 54    private void GetProceduralSkyboxColors()
 55    {
 056        _proceduralSkyboxGroundColor = skyboxMaterial.GetColor("_groundColor");
 057        _proceduralSkyboxHorizonColor = skyboxMaterial.GetColor("_horizonColor");
 58
 059        if (_isDebug == true)
 60        {
 061            Debug.Log("Getting Procedural Colors from Skybox");
 62        }
 063    }
 64
 65    // set _proceduralSkyboxGroundColor and _proceduralSkyboxHorizonColor to infFloorBlenderMaterial
 66    private void SetProceduralInfBlenderColors()
 67    {
 068        infFloorBlenderMaterial.SetColor("_ColorSky", _proceduralSkyboxHorizonColor);
 069        infFloorBlenderMaterial.SetColor("_ColorFloor", _proceduralSkyboxGroundColor);
 70
 071        if (_isDebug == true)
 72        {
 073            Debug.Log("Setting Procedural Colors to InfFloorBlender");
 74        }
 075    }
 76
 77}