< Summary

Class:DCL.Skybox.Config3DPlanar
Assembly:ProceduralSkybox
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/ProceduralSkybox/ToolProceduralSkybox/Scripts/Configuration/Config3DPlanar.cs
Covered lines:0
Uncovered lines:22
Coverable lines:22
Total lines:71
Line coverage:0% (0 of 22)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Config3DPlanar(...)0%2100%
AssignNewPrefab(...)0%42600%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/ProceduralSkybox/ToolProceduralSkybox/Scripts/Configuration/Config3DPlanar.cs

#LineLine coverage
 1using System;
 2using System.Collections;
 3using System.Collections.Generic;
 4using UnityEngine;
 5
 6namespace DCL.Skybox
 7{
 8    [System.Serializable]
 9    public class Config3DPlanar
 10    {
 011        public bool enabled = true;
 12        public string nameInEditor;
 13        public LayerRenderType renderType;
 14        public GameObject prefab;
 15        public float timeSpan_start = 0;
 016        public float timeSpan_End = 24;
 17        public float fadeInTime = 0;
 18        public float fadeOutTime = 0;
 19        public float satelliteSize;
 20        public float radius;
 21        public float yPos = 0;
 22        public bool followCamera;
 23        public bool renderWithMainCamera;
 24        public bool validPrefab;
 25
 26        private ParticleSystem particles;
 027        [NonSerialized] public string inValidStr = "";
 28
 029        public Config3DPlanar(string name) { this.nameInEditor = name; }
 30
 31        public void AssignNewPrefab(GameObject tempPrefab)
 32        {
 033            if (tempPrefab == prefab)
 34            {
 035                return;
 36            }
 37
 038            if (tempPrefab == null)
 39            {
 040                prefab = tempPrefab;
 041                return;
 42            }
 43
 44            // Check if prefab contains particle system
 045            particles = tempPrefab.GetComponent<ParticleSystem>();
 046            if (particles == null)
 47            {
 048                validPrefab = false;
 049                inValidStr = "Particle system not present";
 50            }
 51            else
 52            {
 53                // Check if particle system is of type circle
 054                var shape = particles.shape;
 055                if (shape.shapeType == ParticleSystemShapeType.Circle || shape.shapeType == ParticleSystemShapeType.Hemi
 56                {
 057                    validPrefab = true;
 058                    radius = shape.radius;
 059                    prefab = tempPrefab;
 060                    inValidStr = "valid!";
 61                }
 62                else
 63                {
 064                    validPrefab = false;
 065                    inValidStr = "Particle system not of type Circle or Hemisphere";
 66                }
 67
 68            }
 069        }
 70    }
 71}