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