| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using UnityEngine; |
| | 4 | | using UnityEngine.Serialization; |
| | 5 | |
|
| | 6 | | namespace DCL.Skybox |
| | 7 | | { |
| | 8 | | [System.Serializable] |
| | 9 | | public class TextureLayer |
| | 10 | | { |
| | 11 | | public int slotID; // Slot ID |
| | 12 | | public LayerRenderType renderType; |
| | 13 | | public LayerType layerType; |
| | 14 | | public bool enabled; |
| | 15 | | public string nameInEditor; |
| | 16 | | public bool expandedInEditor; |
| | 17 | | public float timeSpan_start; |
| | 18 | | public float timeSpan_End; |
| | 19 | | public float fadingInTime = 1; |
| | 20 | | public float fadingOutTime = 1; |
| | 21 | |
|
| | 22 | | [FormerlySerializedAs("tintercentage")] |
| | 23 | | public float tintPercentage; |
| | 24 | | public List<TransitioningFloat> renderDistance; |
| | 25 | |
|
| | 26 | | public Texture2D texture; |
| | 27 | | public Texture2D textureNormal; |
| | 28 | | public Cubemap cubemap; |
| | 29 | | public Gradient color; |
| | 30 | | public Vector2 tiling; |
| | 31 | |
|
| | 32 | | [FormerlySerializedAs("flipBookRowsAndColumns")] |
| | 33 | | public Vector2 flipbookRowsAndColumns = Vector2.one; |
| | 34 | | public float flipbookAnimSpeed = 1; |
| | 35 | |
|
| | 36 | | // Offset |
| | 37 | | public List<TransitioningVector2> offset; |
| | 38 | |
|
| | 39 | | // satellite |
| | 40 | | public List<TransitioningVector2> satelliteWidthHeight; |
| | 41 | |
|
| | 42 | | // Rotations |
| | 43 | | [FormerlySerializedAs("rotation_float")] |
| | 44 | | public List<TransitioningFloat> rotations_float; |
| | 45 | | [FormerlySerializedAs("cubemapRotations")] |
| | 46 | | public List<TransitioningVector3> rotations_Vector3; |
| | 47 | |
|
| | 48 | | public Vector3 speed_Vector3; |
| | 49 | | [FormerlySerializedAs("speed_Vec2")] |
| | 50 | | public Vector2 speed_Vector2; |
| | 51 | | [FormerlySerializedAs("speed")] |
| | 52 | | public float speed_float; |
| | 53 | | public float normalIntensity; |
| | 54 | |
|
| | 55 | | // Particles |
| | 56 | | public bool particleExpanded; |
| | 57 | | public Vector2 particleTiling = Vector2.one; |
| | 58 | | public Vector2 particlesOffset = Vector2.zero; |
| | 59 | | public List<TransitioningVector3> particleRotation = new List<TransitioningVector3>(); |
| | 60 | | // Particle Primary Param |
| | 61 | | public float particlesAmount = 1; |
| | 62 | | public float particleMinSize = 1; |
| | 63 | | public float particleMaxSize = 1; |
| | 64 | | // Particle Secondary Param |
| | 65 | | public float particlesHorizontalSpread = 1; |
| | 66 | | public float particlesVerticalSpread = 1; |
| | 67 | | public float particleMinFade = 1; |
| | 68 | | public float particleMaxFade = 1; |
| | 69 | |
|
| | 70 | | // Distortion Values |
| | 71 | | public bool distortionExpanded; |
| | 72 | | public List<TransitioningFloat> distortIntensity; |
| | 73 | | public List<TransitioningFloat> distortSize; |
| | 74 | | public List<TransitioningVector2> distortSpeed; |
| | 75 | | public List<TransitioningVector2> distortSharpness; |
| | 76 | |
|
| | 77 | | public MovementType movementTypeCubemap; |
| | 78 | | public MovementType movementTypePlanar_Radial; |
| | 79 | | public MovementType movementTypeSatellite; |
| | 80 | |
|
| | 81 | | public TextureLayer(string name = "noname") |
| | 82 | | { |
| | 83 | | enabled = true; |
| | 84 | | tiling = new Vector2(1, 1); |
| | 85 | | speed_Vector2 = new Vector2(0, 0); |
| | 86 | | speed_Vector3 = new Vector3(0, 0, 0); |
| | 87 | | nameInEditor = name; |
| | 88 | | offset = new List<TransitioningVector2>(); |
| | 89 | | renderDistance = new List<TransitioningFloat>(); |
| | 90 | | rotations_float = new List<TransitioningFloat>(); |
| | 91 | | satelliteWidthHeight = new List<TransitioningVector2>(); |
| | 92 | | rotations_Vector3 = new List<TransitioningVector3>(); |
| | 93 | | color = new Gradient(); |
| | 94 | | movementTypeCubemap = MovementType.Speed; |
| | 95 | |
|
| | 96 | | distortIntensity = new List<TransitioningFloat>(); |
| | 97 | | distortSize = new List<TransitioningFloat>(); |
| | 98 | | distortSpeed = new List<TransitioningVector2>(); |
| | 99 | | distortSharpness = new List<TransitioningVector2>(); |
| | 100 | |
|
| | 101 | | particleRotation = new List<TransitioningVector3>(); |
| | 102 | | } |
| | 103 | | } |
| | 104 | |
|
| | 105 | | public enum LayerType |
| | 106 | | { |
| | 107 | | Planar = 0, |
| | 108 | | Radial = 1, |
| | 109 | | Satellite = 2, |
| | 110 | | Particles = 3, |
| | 111 | | Cubemap = 4, |
| | 112 | | } |
| | 113 | |
|
| | 114 | | public enum LayerRenderType |
| | 115 | | { |
| | 116 | | Rendering, |
| | 117 | | NotRendering, |
| | 118 | | Conflict_Playing, |
| | 119 | | Conflict_NotPlaying |
| | 120 | | } |
| | 121 | |
|
| | 122 | | public enum MovementType |
| | 123 | | { |
| | 124 | | Speed, |
| | 125 | | PointBased |
| | 126 | | } |
| | 127 | |
|
| | 128 | | [System.Serializable] |
| | 129 | | public class TimelineTagsDuration |
| | 130 | | { |
| | 131 | | public string tag; |
| | 132 | | public float startTime = 0; |
| | 133 | | public float endTime = 0; |
| 0 | 134 | | public bool isTrigger = true; // If true, this event is trigger event |
| | 135 | | [System.NonSerialized] |
| | 136 | | public bool startEventExecuted; // Also works for trigger events |
| | 137 | |
|
| 0 | 138 | | public TimelineTagsDuration(float startTime, string tag = "", bool isTrigger = true) |
| | 139 | | { |
| 0 | 140 | | this.tag = tag; |
| 0 | 141 | | this.startTime = startTime; |
| 0 | 142 | | this.isTrigger = isTrigger; |
| 0 | 143 | | } |
| | 144 | | } |
| | 145 | |
|
| | 146 | | [System.Serializable] |
| | 147 | | public class TransitioningFloat |
| | 148 | | { |
| | 149 | | public float percentage; |
| | 150 | | public float value; |
| | 151 | |
|
| | 152 | | public TransitioningFloat(float percentage, float value) |
| | 153 | | { |
| | 154 | | this.percentage = percentage; |
| | 155 | | this.value = value; |
| | 156 | | } |
| | 157 | | } |
| | 158 | |
|
| | 159 | | [System.Serializable] |
| | 160 | | public class TransitioningVector3 |
| | 161 | | { |
| | 162 | | public float percentage; |
| | 163 | | public Vector3 value; |
| | 164 | |
|
| | 165 | | public TransitioningVector3(float percentage, Vector3 value) |
| | 166 | | { |
| | 167 | | this.percentage = percentage; |
| | 168 | | this.value = value; |
| | 169 | | } |
| | 170 | | } |
| | 171 | |
|
| | 172 | | [System.Serializable] |
| | 173 | | public class TransitioningVector2 |
| | 174 | | { |
| | 175 | | public float percentage; |
| | 176 | | public Vector2 value; |
| | 177 | |
|
| | 178 | | public TransitioningVector2(float percentage, Vector2 value) |
| | 179 | | { |
| | 180 | | this.percentage = percentage; |
| | 181 | | this.value = value; |
| | 182 | | } |
| | 183 | | } |
| | 184 | |
|
| | 185 | | [System.Serializable] |
| | 186 | | public class TransitioningVector4 |
| | 187 | | { |
| | 188 | | public float percentage; |
| | 189 | | public Vector4 value; |
| | 190 | |
|
| | 191 | | public TransitioningVector4(float percentage, Vector4 value) |
| | 192 | | { |
| | 193 | | this.percentage = percentage; |
| | 194 | | this.value = value; |
| | 195 | | } |
| | 196 | | } |
| | 197 | |
|
| | 198 | | [System.Serializable] |
| | 199 | | public class TransitioningQuaternion |
| | 200 | | { |
| | 201 | | public float percentage; |
| | 202 | | public Quaternion value; |
| | 203 | |
|
| | 204 | | public TransitioningQuaternion(float percentage, Quaternion value) |
| | 205 | | { |
| | 206 | | this.percentage = percentage; |
| | 207 | | this.value = value; |
| | 208 | | } |
| | 209 | | } |
| | 210 | |
|
| | 211 | | [System.Serializable] |
| | 212 | | public class DirectionalLightAttributes |
| | 213 | | { |
| | 214 | | public Gradient lightColor; |
| | 215 | | public List<TransitioningFloat> intensity; |
| | 216 | | public List<TransitioningQuaternion> lightDirection; |
| | 217 | | public Gradient tintColor; |
| | 218 | |
|
| | 219 | | public DirectionalLightAttributes() |
| | 220 | | { |
| | 221 | | lightColor = new Gradient(); |
| | 222 | | intensity = new List<TransitioningFloat>(); |
| | 223 | | lightDirection = new List<TransitioningQuaternion>(); |
| | 224 | | tintColor = new Gradient(); |
| | 225 | | } |
| | 226 | | } |
| | 227 | | } |