< Summary

Class:DCL.Skybox.RenderSimpleValues
Assembly:SkyboxEditorAssembly
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/ProceduralSkybox/ToolProceduralSkybox/Scripts/Editor/Procedural Skybox/SimpleValuesRendering/RenderSimpleValues.cs
Covered lines:0
Uncovered lines:80
Coverable lines:80
Total lines:135
Line coverage:0% (0 of 80)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
RenderSepratedFloatFields(...)0%2100%
RenderFloatField(...)0%2100%
RenderFloatFieldAsSlider(...)0%2100%
RenderMinMaxSlider(...)0%2100%
RenderVector3Field(...)0%2100%
RenderVector2Field(...)0%2100%
RenderTexture(...)0%2100%
RenderCubemapTexture(...)0%2100%
RenderColorGradientField(...)0%12300%
RenderPrefabInput(...)0%2100%
RenderEnumPopup[T](...)0%2100%
RenderBoolField(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/ProceduralSkybox/ToolProceduralSkybox/Scripts/Editor/Procedural Skybox/SimpleValuesRendering/RenderSimpleValues.cs

#LineLine coverage
 1using System;
 2using System.Collections;
 3using System.Collections.Generic;
 4using UnityEditor;
 5using UnityEngine;
 6
 7namespace DCL.Skybox
 8{
 9    public static class RenderSimpleValues
 10    {
 11        public static void RenderSepratedFloatFields(string label, string label1, ref float value1, string label2, ref f
 12        {
 013            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 014            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 015            EditorGUILayout.LabelField(label1, GUILayout.Width(90), GUILayout.ExpandWidth(false));
 016            value1 = EditorGUILayout.FloatField("", value1, GUILayout.Width(90));
 017            EditorGUILayout.LabelField(label2, GUILayout.Width(90), GUILayout.ExpandWidth(false));
 018            value2 = EditorGUILayout.FloatField("", value2, GUILayout.Width(90));
 019            GUILayout.EndHorizontal();
 020            EditorGUILayout.Separator();
 021        }
 22
 23        public static void RenderFloatField(string label, ref float value)
 24        {
 025            EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 026            value = EditorGUILayout.FloatField(label, value, GUILayout.Width(200));
 027            EditorGUILayout.EndHorizontal();
 028            EditorGUILayout.Separator();
 029        }
 30
 31        public static void RenderFloatFieldAsSlider(string label, ref float value, float min, float max)
 32        {
 033            EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 034            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 035            value = EditorGUILayout.Slider(value, min, max, GUILayout.Width(200));
 036            EditorGUILayout.EndHorizontal();
 037            EditorGUILayout.Separator();
 038        }
 39
 40        internal static void RenderMinMaxSlider(string label, ref float minVal, ref float maxVal, float minLimit, float 
 41        {
 042            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 043            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 044            EditorGUILayout.LabelField(minVal.ToString("f3"), GUILayout.Width(55), GUILayout.ExpandWidth(false));
 045            EditorGUILayout.MinMaxSlider(ref minVal, ref maxVal, minLimit, maxLimit, GUILayout.Width(150));
 046            EditorGUILayout.LabelField(maxVal.ToString("f3"), GUILayout.Width(150), GUILayout.ExpandWidth(false));
 047            GUILayout.EndHorizontal();
 048            EditorGUILayout.Separator();
 049        }
 50
 51        public static void RenderVector3Field(string label, ref Vector3 value)
 52        {
 053            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 054            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 055            value = EditorGUILayout.Vector3Field("", value, GUILayout.Width(200), GUILayout.ExpandWidth(false));
 056            GUILayout.EndHorizontal();
 057            EditorGUILayout.Separator();
 058        }
 59
 60        public static void RenderVector2Field(string label, ref Vector2 value)
 61        {
 062            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 063            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 064            value = EditorGUILayout.Vector2Field("", value, GUILayout.Width(200), GUILayout.ExpandWidth(false));
 065            GUILayout.EndHorizontal();
 066            EditorGUILayout.Separator();
 067        }
 68
 69        public static void RenderTexture(string label, ref Texture2D tex)
 70        {
 071            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 072            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 073            tex = (Texture2D)EditorGUILayout.ObjectField(tex, typeof(Texture2D), false, GUILayout.Width(200));
 074            GUILayout.EndHorizontal();
 075            EditorGUILayout.Separator();
 076        }
 77
 78        public static void RenderCubemapTexture(string label, ref Cubemap tex)
 79        {
 080            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 081            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 082            tex = (Cubemap)EditorGUILayout.ObjectField(tex, typeof(Cubemap), false, GUILayout.Width(200));
 083            GUILayout.EndHorizontal();
 084            EditorGUILayout.Separator();
 085        }
 86
 87        public static void RenderColorGradientField(Gradient color, string label = SkyboxEditorLiterals.LayerProperties.
 88        {
 089            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 090            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 91
 092            if (startTime != -1)
 93            {
 094                EditorGUILayout.LabelField(startTime + SkyboxEditorLiterals.short_Hour, GUILayout.Width(65), GUILayout.E
 95            }
 96
 097            color = EditorGUILayout.GradientField(new GUIContent(""), color, hdr, GUILayout.Width(250), GUILayout.Expand
 98
 099            if (endTime != 1)
 100            {
 0101                EditorGUILayout.LabelField(endTime + SkyboxEditorLiterals.short_Hour, GUILayout.Width(65), GUILayout.Exp
 102            }
 0103            GUILayout.EndHorizontal();
 0104            EditorGUILayout.Separator();
 0105        }
 106
 107        public static void RenderPrefabInput(string label, ref GameObject obj)
 108        {
 0109            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 0110            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 0111            obj = (GameObject)EditorGUILayout.ObjectField(obj, typeof(GameObject), false, GUILayout.Width(200));
 0112            GUILayout.EndHorizontal();
 0113            EditorGUILayout.Separator();
 0114        }
 115
 116        public static void RenderEnumPopup<T>(string label, ref T enumVar) where T : System.Enum
 117        {
 118            // Layer Type
 0119            EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 0120            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 0121            enumVar = (T)EditorGUILayout.EnumPopup(enumVar, GUILayout.Width(200));
 0122            EditorGUILayout.EndHorizontal();
 0123            EditorGUILayout.Separator();
 0124        }
 125
 126        public static void RenderBoolField(string label, ref bool value)
 127        {
 0128            EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(false));
 0129            EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false));
 0130            value = EditorGUILayout.Toggle(value, GUILayout.Width(90));
 0131            EditorGUILayout.EndHorizontal();
 0132            EditorGUILayout.Separator();
 0133        }
 134    }
 135}