| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using UnityEditor; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | namespace DCL.Skybox |
| | 7 | | { |
| | 8 | | public static class RenderSimpleValues |
| | 9 | | { |
| | 10 | | public static void RenderSepratedFloatFields(string label, string label1, ref float value1, string label2, ref f |
| | 11 | | { |
| 0 | 12 | | GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| 0 | 13 | | EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false)); |
| 0 | 14 | | EditorGUILayout.LabelField(label1, GUILayout.Width(90), GUILayout.ExpandWidth(false)); |
| 0 | 15 | | value1 = EditorGUILayout.FloatField("", value1, GUILayout.Width(90)); |
| 0 | 16 | | EditorGUILayout.LabelField(label2, GUILayout.Width(90), GUILayout.ExpandWidth(false)); |
| 0 | 17 | | value2 = EditorGUILayout.FloatField("", value2, GUILayout.Width(90)); |
| 0 | 18 | | GUILayout.EndHorizontal(); |
| 0 | 19 | | EditorGUILayout.Separator(); |
| 0 | 20 | | } |
| | 21 | |
|
| | 22 | | public static void RenderFloatField(string label, ref float value) |
| | 23 | | { |
| 0 | 24 | | EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| 0 | 25 | | EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false)); |
| 0 | 26 | | value = EditorGUILayout.FloatField(value, GUILayout.Width(90)); |
| 0 | 27 | | EditorGUILayout.EndHorizontal(); |
| 0 | 28 | | EditorGUILayout.Separator(); |
| 0 | 29 | | } |
| | 30 | |
|
| | 31 | | public static void RenderFloatFieldAsSlider(string label, ref float value, float min, float max) |
| | 32 | | { |
| 0 | 33 | | EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| 0 | 34 | | EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false)); |
| 0 | 35 | | value = EditorGUILayout.Slider(value, min, max, GUILayout.Width(200)); |
| 0 | 36 | | EditorGUILayout.EndHorizontal(); |
| 0 | 37 | | EditorGUILayout.Separator(); |
| 0 | 38 | | } |
| | 39 | |
|
| | 40 | | public static void RenderVector3Field(string label, ref Vector3 value) |
| | 41 | | { |
| 0 | 42 | | GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| 0 | 43 | | EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false)); |
| 0 | 44 | | value = EditorGUILayout.Vector3Field("", value, GUILayout.Width(200), GUILayout.ExpandWidth(false)); |
| 0 | 45 | | GUILayout.EndHorizontal(); |
| 0 | 46 | | EditorGUILayout.Separator(); |
| 0 | 47 | | } |
| | 48 | |
|
| | 49 | | public static void RenderVector2Field(string label, ref Vector2 value) |
| | 50 | | { |
| 0 | 51 | | GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| 0 | 52 | | EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false)); |
| 0 | 53 | | value = EditorGUILayout.Vector2Field("", value, GUILayout.Width(200), GUILayout.ExpandWidth(false)); |
| 0 | 54 | | GUILayout.EndHorizontal(); |
| 0 | 55 | | EditorGUILayout.Separator(); |
| 0 | 56 | | } |
| | 57 | |
|
| | 58 | | public static void RenderTexture(string label, ref Texture2D tex) |
| | 59 | | { |
| 0 | 60 | | GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| 0 | 61 | | EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false)); |
| 0 | 62 | | tex = (Texture2D)EditorGUILayout.ObjectField(tex, typeof(Texture2D), false, GUILayout.Width(200)); |
| 0 | 63 | | GUILayout.EndHorizontal(); |
| 0 | 64 | | EditorGUILayout.Separator(); |
| 0 | 65 | | } |
| | 66 | |
|
| | 67 | | public static void RenderCubemapTexture(string label, ref Cubemap tex) |
| | 68 | | { |
| 0 | 69 | | GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| 0 | 70 | | EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false)); |
| 0 | 71 | | tex = (Cubemap)EditorGUILayout.ObjectField(tex, typeof(Cubemap), false, GUILayout.Width(200)); |
| 0 | 72 | | GUILayout.EndHorizontal(); |
| 0 | 73 | | EditorGUILayout.Separator(); |
| 0 | 74 | | } |
| | 75 | |
|
| | 76 | | public static void RenderColorGradientField(Gradient color, string label = SkyboxEditorLiterals.color, float sta |
| | 77 | | { |
| 0 | 78 | | GUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| 0 | 79 | | EditorGUILayout.LabelField(label, GUILayout.Width(150), GUILayout.ExpandWidth(false)); |
| | 80 | |
|
| 0 | 81 | | if (startTime != -1) |
| | 82 | | { |
| 0 | 83 | | EditorGUILayout.LabelField(startTime + SkyboxEditorLiterals.short_Hour, GUILayout.Width(65), GUILayout.E |
| | 84 | | } |
| | 85 | |
|
| 0 | 86 | | color = EditorGUILayout.GradientField(new GUIContent(""), color, hdr, GUILayout.Width(250), GUILayout.Expand |
| | 87 | |
|
| 0 | 88 | | if (endTime != 1) |
| | 89 | | { |
| 0 | 90 | | EditorGUILayout.LabelField(endTime + SkyboxEditorLiterals.short_Hour, GUILayout.Width(65), GUILayout.Exp |
| | 91 | | } |
| 0 | 92 | | GUILayout.EndHorizontal(); |
| 0 | 93 | | EditorGUILayout.Separator(); |
| 0 | 94 | | } |
| | 95 | | } |
| | 96 | | } |