| | 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 RenderPlanarLayer |
| | 9 | | { |
| | 10 | | public static void RenderLayer(ref float timeOfTheDay, EditorToolMeasurements toolSize, TextureLayer layer, bool |
| | 11 | | { |
| | 12 | | // Texture |
| 0 | 13 | | RenderSimpleValues.RenderTexture(SkyboxEditorLiterals.LayerProperties.texture, ref layer.texture); |
| | 14 | |
|
| | 15 | | // Row and Coloumns |
| 0 | 16 | | RenderSimpleValues.RenderVector2Field(SkyboxEditorLiterals.LayerProperties.rowsColumns, ref layer.flipbookRo |
| | 17 | |
|
| | 18 | | // Anim Speed |
| 0 | 19 | | RenderSimpleValues.RenderFloatField(SkyboxEditorLiterals.LayerProperties.animSpeed, ref layer.flipbookAnimSp |
| | 20 | |
|
| | 21 | | // Gradient |
| 0 | 22 | | RenderSimpleValues.RenderColorGradientField(layer.color, SkyboxEditorLiterals.LayerProperties.color, layer.t |
| | 23 | |
|
| | 24 | | // Tiling |
| 0 | 25 | | RenderSimpleValues.RenderVector2Field(SkyboxEditorLiterals.LayerProperties.tiling, ref layer.tiling); |
| | 26 | |
|
| | 27 | | // Movement Type |
| 0 | 28 | | EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(false)); |
| 0 | 29 | | EditorGUILayout.LabelField(SkyboxEditorLiterals.LayerProperties.movementType, GUILayout.Width(150), GUILayou |
| 0 | 30 | | layer.movementTypePlanar_Radial = (MovementType)EditorGUILayout.EnumPopup(layer.movementTypePlanar_Radial, G |
| 0 | 31 | | EditorGUILayout.EndHorizontal(); |
| | 32 | |
|
| 0 | 33 | | EditorGUI.indentLevel++; |
| 0 | 34 | | EditorGUILayout.Separator(); |
| | 35 | |
|
| 0 | 36 | | if (layer.movementTypePlanar_Radial == MovementType.Speed) |
| | 37 | | { |
| | 38 | | // Speed |
| 0 | 39 | | RenderSimpleValues.RenderVector2Field(SkyboxEditorLiterals.LayerProperties.speed, ref layer.speed_Vector |
| 0 | 40 | | } |
| | 41 | | else |
| | 42 | | { |
| | 43 | | // Offset |
| 0 | 44 | | RenderTransitioningVariables.RenderTransitioningVector2(ref timeOfTheDay, layer.offset, SkyboxEditorLite |
| | 45 | | } |
| | 46 | |
|
| 0 | 47 | | EditorGUI.indentLevel--; |
| | 48 | |
|
| 0 | 49 | | EditorGUILayout.Space(15); |
| | 50 | |
|
| | 51 | | // Render Distance |
| 0 | 52 | | RenderTransitioningVariables.RenderTransitioningFloat(toolSize, ref timeOfTheDay, layer.renderDistance, Skyb |
| | 53 | |
|
| 0 | 54 | | EditorGUILayout.Space(15); |
| | 55 | |
|
| | 56 | | // Rotation |
| 0 | 57 | | if (!isRadial) |
| | 58 | | { |
| 0 | 59 | | RenderTransitioningVariables.RenderTransitioningFloat(toolSize, ref timeOfTheDay, layer.rotations_float, |
| 0 | 60 | | EditorGUILayout.Separator(); |
| | 61 | | } |
| | 62 | |
|
| 0 | 63 | | RenderDistortionVariables(ref timeOfTheDay, toolSize, layer); |
| | 64 | |
|
| 0 | 65 | | EditorGUILayout.Space(10); |
| 0 | 66 | | } |
| | 67 | |
|
| | 68 | | public static void RenderDistortionVariables(ref float timeOfTheDay, EditorToolMeasurements toolSize, TextureLay |
| | 69 | | { |
| 0 | 70 | | layer.distortionExpanded = EditorGUILayout.Foldout(layer.distortionExpanded, SkyboxEditorLiterals.LayerPrope |
| | 71 | |
|
| 0 | 72 | | if (!layer.distortionExpanded) |
| | 73 | | { |
| 0 | 74 | | return; |
| | 75 | | } |
| | 76 | |
|
| 0 | 77 | | EditorGUILayout.Space(10); |
| | 78 | |
|
| 0 | 79 | | EditorGUI.indentLevel++; |
| | 80 | |
|
| | 81 | | // Distortion Intensity |
| 0 | 82 | | RenderTransitioningVariables.RenderTransitioningFloat(toolSize, ref timeOfTheDay, layer.distortIntensity, Sk |
| | 83 | |
|
| 0 | 84 | | EditorGUILayout.Space(10); |
| | 85 | |
|
| | 86 | | // Distortion Size |
| 0 | 87 | | RenderTransitioningVariables.RenderTransitioningFloat(toolSize, ref timeOfTheDay, layer.distortSize, SkyboxE |
| | 88 | |
|
| 0 | 89 | | EditorGUILayout.Space(10); |
| | 90 | |
|
| | 91 | | // Distortion Speed |
| 0 | 92 | | RenderTransitioningVariables.RenderTransitioningVector2(ref timeOfTheDay, layer.distortSpeed, SkyboxEditorLi |
| | 93 | |
|
| 0 | 94 | | EditorGUILayout.Space(10); |
| | 95 | |
|
| | 96 | | // Distortion Sharpness |
| 0 | 97 | | RenderTransitioningVariables.RenderTransitioningVector2(ref timeOfTheDay, layer.distortSharpness, SkyboxEdit |
| | 98 | |
|
| 0 | 99 | | EditorGUILayout.Space(10); |
| | 100 | |
|
| 0 | 101 | | EditorGUI.indentLevel--; |
| 0 | 102 | | } |
| | 103 | | } |
| | 104 | | } |