| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using UnityEditor; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | namespace DCL.Skybox |
| | 7 | | { |
| | 8 | | public class RenderTimelineTags |
| | 9 | | { |
| | 10 | | public static void RenderLayer(ref float timeOfTheDay, EditorToolMeasurements toolSize, SkyboxConfiguration conf |
| | 11 | | { |
| 0 | 12 | | if (config.timelineTags == null) |
| | 13 | | { |
| 0 | 14 | | config.timelineTags = new List<TimelineTagsDuration>(); |
| | 15 | | } |
| | 16 | |
|
| 0 | 17 | | for (int i = 0; i < config.timelineTags.Count; i++) |
| | 18 | | { |
| 0 | 19 | | EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| | 20 | |
|
| | 21 | | // Text field for name of event |
| 0 | 22 | | EditorGUILayout.LabelField(SkyboxEditorLiterals.Labels.name, GUILayout.Width(50)); |
| 0 | 23 | | config.timelineTags[i].tag = EditorGUILayout.TextField(config.timelineTags[i].tag, GUILayout.Width(70)); |
| | 24 | |
|
| | 25 | | // Start time |
| 0 | 26 | | EditorGUILayout.LabelField(SkyboxEditorLiterals.LayerProperties.start, GUILayout.Width(45)); |
| 0 | 27 | | GUILayout.Space(0); |
| 0 | 28 | | config.timelineTags[i].startTime = EditorGUILayout.FloatField(config.timelineTags[i].startTime, GUILayou |
| 0 | 29 | | SkyboxEditorUtils.ClampToDayTime(ref config.timelineTags[i].startTime); |
| | 30 | |
|
| | 31 | | // End time |
| 0 | 32 | | if (!config.timelineTags[i].isTrigger) |
| | 33 | | { |
| 0 | 34 | | EditorGUILayout.LabelField(SkyboxEditorLiterals.LayerProperties.end, GUILayout.Width(40)); |
| 0 | 35 | | GUILayout.Space(0); |
| 0 | 36 | | config.timelineTags[i].endTime = EditorGUILayout.FloatField(config.timelineTags[i].endTime, GUILayou |
| 0 | 37 | | SkyboxEditorUtils.ClampToDayTime(ref config.timelineTags[i].endTime); |
| 0 | 38 | | } |
| | 39 | | else |
| | 40 | | { |
| 0 | 41 | | GUILayout.Space(97); |
| | 42 | | } |
| | 43 | |
|
| | 44 | | // no end time |
| 0 | 45 | | config.timelineTags[i].isTrigger = EditorGUILayout.ToggleLeft(SkyboxEditorLiterals.LayerProperties.trigg |
| | 46 | |
|
| | 47 | | // Remove Button |
| 0 | 48 | | if (GUILayout.Button(SkyboxEditorLiterals.Characters.sign_remove, GUILayout.Width(30))) |
| | 49 | | { |
| 0 | 50 | | config.timelineTags.RemoveAt(i); |
| | 51 | | } |
| | 52 | |
|
| 0 | 53 | | EditorGUILayout.EndHorizontal(); |
| | 54 | | } |
| | 55 | |
|
| 0 | 56 | | EditorGUILayout.BeginHorizontal(); |
| 0 | 57 | | GUILayout.Space(20); |
| 0 | 58 | | if (GUILayout.Button(SkyboxEditorLiterals.Characters.sign_add, GUILayout.Width(30))) |
| | 59 | | { |
| 0 | 60 | | config.timelineTags.Add(new TimelineTagsDuration(timeOfTheDay)); |
| | 61 | | } |
| 0 | 62 | | EditorGUILayout.EndHorizontal(); |
| 0 | 63 | | } |
| | 64 | | } |
| | 65 | | } |