Explorar el Código

Save Feature + DaylightCycle + GameManager

Nathan Gusatto hace 1 mes
padre
commit
1d900a94d3
Se han modificado 28 ficheros con 1046 adiciones y 66 borrados
  1. 8 8
      Assets/Materials/MeshMaterial.mat
  2. 4 39
      Assets/Scenes/SampleScene.unity
  3. 8 0
      Assets/Scripts/Daylight Cycle.meta
  4. BIN
      Assets/Scripts/Daylight Cycle/FS003_Day.png
  5. 137 0
      Assets/Scripts/Daylight Cycle/FS003_Day.png.meta
  6. BIN
      Assets/Scripts/Daylight Cycle/FS003_Night.png
  7. 137 0
      Assets/Scripts/Daylight Cycle/FS003_Night.png.meta
  8. BIN
      Assets/Scripts/Daylight Cycle/FS003_Sunrise.png
  9. 137 0
      Assets/Scripts/Daylight Cycle/FS003_Sunrise.png.meta
  10. BIN
      Assets/Scripts/Daylight Cycle/FS003_Sunset.png
  11. 137 0
      Assets/Scripts/Daylight Cycle/FS003_Sunset.png.meta
  12. 48 0
      Assets/Scripts/Daylight Cycle/Skybox.mat
  13. 8 0
      Assets/Scripts/Daylight Cycle/Skybox.mat.meta
  14. 136 0
      Assets/Scripts/Daylight Cycle/Skybox.shader
  15. 9 0
      Assets/Scripts/Daylight Cycle/Skybox.shader.meta
  16. 109 0
      Assets/Scripts/Daylight Cycle/TimeManager.cs
  17. 2 0
      Assets/Scripts/Daylight Cycle/TimeManager.cs.meta
  18. 78 0
      Assets/Scripts/GameManager.cs
  19. 2 0
      Assets/Scripts/GameManager.cs.meta
  20. 1 1
      Assets/Scripts/Procedural Generation/Data/TextureData.cs
  21. 6 1
      Assets/Scripts/Procedural Generation/MapGenerator.cs
  22. 8 0
      Assets/Scripts/Save.meta
  23. 15 0
      Assets/Scripts/Save/GameData.cs
  24. 2 0
      Assets/Scripts/Save/GameData.cs.meta
  25. 35 0
      Assets/Scripts/Save/SaveManager.cs
  26. 2 0
      Assets/Scripts/Save/SaveManager.cs.meta
  27. 10 10
      Assets/TerrainAssets/DefaultTerrain.asset
  28. 7 7
      Assets/TerrainAssets/DefaultTexture.asset

+ 8 - 8
Assets/Materials/MeshMaterial.mat

@@ -116,15 +116,15 @@ Material:
     - _ZWrite: 1
     - _baseColorCount: 0
     - _baseStartHeight0: 0
-    - _baseStartHeight1: 0.11
-    - _baseStartHeight2: 0.18
-    - _baseStartHeight3: 0.247
-    - _baseStartHeight4: 0.363
-    - _baseStartHeight5: 0.51
-    - _baseStartHeight6: 0.686
-    - _baseStartHeight7: 0.778
+    - _baseStartHeight1: 0.064
+    - _baseStartHeight2: 0.104
+    - _baseStartHeight3: 0.159
+    - _baseStartHeight4: 0.335
+    - _baseStartHeight5: 0.473
+    - _baseStartHeight6: 0.649
+    - _baseStartHeight7: 0.787
     - _maxArrayLength: 8
-    - _maxHeight: 77.115005
+    - _maxHeight: 75.292885
     - _minHeight: 0
     m_Colors:
     - _BaseColor: {r: 1, g: 1, b: 1, a: 1}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 4 - 39
Assets/Scenes/SampleScene.unity


+ 8 - 0
Assets/Scripts/Daylight Cycle.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: de06192a29dbf9c47ae028014a6ad9bb
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Scripts/Daylight Cycle/FS003_Day.png


+ 137 - 0
Assets/Scripts/Daylight Cycle/FS003_Day.png.meta

@@ -0,0 +1,137 @@
+fileFormatVersion: 2
+guid: 97c83ef8555216848ba4f98a7496a917
+AssetOrigin:
+  serializedVersion: 1
+  productId: 18353
+  packageName: Fantasy Skybox FREE
+  packageVersion: 1.6.5
+  assetPath: Assets/Fantasy Skybox FREE/Panoramics/FS003/FS003_Day.png
+  uploadId: 699843
+TextureImporter:
+  internalIDToNameTable: []
+  externalObjects: {}
+  serializedVersion: 13
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 0
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    mipMapsPreserveCoverage: 0
+    alphaTestReferenceValue: 0.5
+    mipMapFadeDistanceStart: 1
+    mipMapFadeDistanceEnd: 3
+  bumpmap:
+    convertToNormalMap: 0
+    externalNormalMap: 0
+    heightScale: 0.25
+    normalMapFilter: 0
+    flipGreenChannel: 0
+  isReadable: 0
+  streamingMipmaps: 0
+  streamingMipmapsPriority: 0
+  vTOnly: 0
+  ignoreMipmapLimit: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 0
+  seamlessCubemap: 0
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: 1
+    aniso: 1
+    mipBias: 0
+    wrapU: 1
+    wrapV: 1
+    wrapW: 1
+  nPOTScale: 1
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 0
+  spriteExtrude: 1
+  spriteMeshType: 1
+  alignment: 0
+  spritePivot: {x: 0.5, y: 0.5}
+  spritePixelsToUnits: 100
+  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+  spriteGenerateFallbackPhysicsShape: 1
+  alphaUsage: 0
+  alphaIsTransparency: 0
+  spriteTessellationDetail: -1
+  textureType: 0
+  textureShape: 1
+  singleChannelComponent: 0
+  flipbookRows: 1
+  flipbookColumns: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  ignorePngGamma: 0
+  applyGammaDecoding: 0
+  swizzle: 50462976
+  cookieLightType: 1
+  platformSettings:
+  - serializedVersion: 4
+    buildTarget: DefaultTexturePlatform
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Standalone
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Server
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+    customData: 
+    physicsShape: []
+    bones: []
+    spriteID: 
+    internalID: 0
+    vertices: []
+    indices: 
+    edges: []
+    weights: []
+    secondaryTextures: []
+    spriteCustomMetadata:
+      entries: []
+    nameFileIdTable: {}
+  mipmapLimitGroupName: 
+  pSDRemoveMatte: 0
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Scripts/Daylight Cycle/FS003_Night.png


+ 137 - 0
Assets/Scripts/Daylight Cycle/FS003_Night.png.meta

@@ -0,0 +1,137 @@
+fileFormatVersion: 2
+guid: 323f1ea1bce78fe4c90b2286fa1997e2
+AssetOrigin:
+  serializedVersion: 1
+  productId: 18353
+  packageName: Fantasy Skybox FREE
+  packageVersion: 1.6.5
+  assetPath: Assets/Fantasy Skybox FREE/Panoramics/FS003/FS003_Night.png
+  uploadId: 699843
+TextureImporter:
+  internalIDToNameTable: []
+  externalObjects: {}
+  serializedVersion: 13
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 0
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    mipMapsPreserveCoverage: 0
+    alphaTestReferenceValue: 0.5
+    mipMapFadeDistanceStart: 1
+    mipMapFadeDistanceEnd: 3
+  bumpmap:
+    convertToNormalMap: 0
+    externalNormalMap: 0
+    heightScale: 0.25
+    normalMapFilter: 0
+    flipGreenChannel: 0
+  isReadable: 0
+  streamingMipmaps: 0
+  streamingMipmapsPriority: 0
+  vTOnly: 0
+  ignoreMipmapLimit: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 0
+  seamlessCubemap: 0
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: 1
+    aniso: 1
+    mipBias: 0
+    wrapU: 1
+    wrapV: 1
+    wrapW: 1
+  nPOTScale: 1
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 0
+  spriteExtrude: 1
+  spriteMeshType: 1
+  alignment: 0
+  spritePivot: {x: 0.5, y: 0.5}
+  spritePixelsToUnits: 100
+  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+  spriteGenerateFallbackPhysicsShape: 1
+  alphaUsage: 0
+  alphaIsTransparency: 0
+  spriteTessellationDetail: -1
+  textureType: 0
+  textureShape: 1
+  singleChannelComponent: 0
+  flipbookRows: 1
+  flipbookColumns: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  ignorePngGamma: 0
+  applyGammaDecoding: 0
+  swizzle: 50462976
+  cookieLightType: 1
+  platformSettings:
+  - serializedVersion: 4
+    buildTarget: DefaultTexturePlatform
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Standalone
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Server
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+    customData: 
+    physicsShape: []
+    bones: []
+    spriteID: 
+    internalID: 0
+    vertices: []
+    indices: 
+    edges: []
+    weights: []
+    secondaryTextures: []
+    spriteCustomMetadata:
+      entries: []
+    nameFileIdTable: {}
+  mipmapLimitGroupName: 
+  pSDRemoveMatte: 0
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Scripts/Daylight Cycle/FS003_Sunrise.png


+ 137 - 0
Assets/Scripts/Daylight Cycle/FS003_Sunrise.png.meta

@@ -0,0 +1,137 @@
+fileFormatVersion: 2
+guid: c15e36d3819e8d14ab21ab119e3fd4a7
+AssetOrigin:
+  serializedVersion: 1
+  productId: 18353
+  packageName: Fantasy Skybox FREE
+  packageVersion: 1.6.5
+  assetPath: Assets/Fantasy Skybox FREE/Panoramics/FS003/FS003_Sunrise.png
+  uploadId: 699843
+TextureImporter:
+  internalIDToNameTable: []
+  externalObjects: {}
+  serializedVersion: 13
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 0
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    mipMapsPreserveCoverage: 0
+    alphaTestReferenceValue: 0.5
+    mipMapFadeDistanceStart: 1
+    mipMapFadeDistanceEnd: 3
+  bumpmap:
+    convertToNormalMap: 0
+    externalNormalMap: 0
+    heightScale: 0.25
+    normalMapFilter: 0
+    flipGreenChannel: 0
+  isReadable: 0
+  streamingMipmaps: 0
+  streamingMipmapsPriority: 0
+  vTOnly: 0
+  ignoreMipmapLimit: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 0
+  seamlessCubemap: 0
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: 1
+    aniso: 1
+    mipBias: 0
+    wrapU: 1
+    wrapV: 1
+    wrapW: 1
+  nPOTScale: 1
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 0
+  spriteExtrude: 1
+  spriteMeshType: 1
+  alignment: 0
+  spritePivot: {x: 0.5, y: 0.5}
+  spritePixelsToUnits: 100
+  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+  spriteGenerateFallbackPhysicsShape: 1
+  alphaUsage: 0
+  alphaIsTransparency: 0
+  spriteTessellationDetail: -1
+  textureType: 0
+  textureShape: 1
+  singleChannelComponent: 0
+  flipbookRows: 1
+  flipbookColumns: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  ignorePngGamma: 0
+  applyGammaDecoding: 0
+  swizzle: 50462976
+  cookieLightType: 1
+  platformSettings:
+  - serializedVersion: 4
+    buildTarget: DefaultTexturePlatform
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Standalone
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Server
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+    customData: 
+    physicsShape: []
+    bones: []
+    spriteID: 
+    internalID: 0
+    vertices: []
+    indices: 
+    edges: []
+    weights: []
+    secondaryTextures: []
+    spriteCustomMetadata:
+      entries: []
+    nameFileIdTable: {}
+  mipmapLimitGroupName: 
+  pSDRemoveMatte: 0
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Scripts/Daylight Cycle/FS003_Sunset.png


+ 137 - 0
Assets/Scripts/Daylight Cycle/FS003_Sunset.png.meta

@@ -0,0 +1,137 @@
+fileFormatVersion: 2
+guid: 846cce7d90ad21b4b80fcb937193081e
+AssetOrigin:
+  serializedVersion: 1
+  productId: 18353
+  packageName: Fantasy Skybox FREE
+  packageVersion: 1.6.5
+  assetPath: Assets/Fantasy Skybox FREE/Panoramics/FS003/FS003_Sunset.png
+  uploadId: 699843
+TextureImporter:
+  internalIDToNameTable: []
+  externalObjects: {}
+  serializedVersion: 13
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 0
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    mipMapsPreserveCoverage: 0
+    alphaTestReferenceValue: 0.5
+    mipMapFadeDistanceStart: 1
+    mipMapFadeDistanceEnd: 3
+  bumpmap:
+    convertToNormalMap: 0
+    externalNormalMap: 0
+    heightScale: 0.25
+    normalMapFilter: 0
+    flipGreenChannel: 0
+  isReadable: 0
+  streamingMipmaps: 0
+  streamingMipmapsPriority: 0
+  vTOnly: 0
+  ignoreMipmapLimit: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 0
+  seamlessCubemap: 0
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: 1
+    aniso: 1
+    mipBias: 0
+    wrapU: 1
+    wrapV: 1
+    wrapW: 1
+  nPOTScale: 1
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 0
+  spriteExtrude: 1
+  spriteMeshType: 1
+  alignment: 0
+  spritePivot: {x: 0.5, y: 0.5}
+  spritePixelsToUnits: 100
+  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+  spriteGenerateFallbackPhysicsShape: 1
+  alphaUsage: 0
+  alphaIsTransparency: 0
+  spriteTessellationDetail: -1
+  textureType: 0
+  textureShape: 1
+  singleChannelComponent: 0
+  flipbookRows: 1
+  flipbookColumns: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  ignorePngGamma: 0
+  applyGammaDecoding: 0
+  swizzle: 50462976
+  cookieLightType: 1
+  platformSettings:
+  - serializedVersion: 4
+    buildTarget: DefaultTexturePlatform
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Standalone
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Server
+    maxTextureSize: 4096
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 2
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+    customData: 
+    physicsShape: []
+    bones: []
+    spriteID: 
+    internalID: 0
+    vertices: []
+    indices: 
+    edges: []
+    weights: []
+    secondaryTextures: []
+    spriteCustomMetadata:
+      entries: []
+    nameFileIdTable: {}
+  mipmapLimitGroupName: 
+  pSDRemoveMatte: 0
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 48 - 0
Assets/Scripts/Daylight Cycle/Skybox.mat

@@ -0,0 +1,48 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 8
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Skybox
+  m_Shader: {fileID: 4800000, guid: 55a92c39bd4d7e34b8fe677fcae49f67, type: 3}
+  m_Parent: {fileID: 0}
+  m_ModifiedSerializedProperties: 0
+  m_ValidKeywords: []
+  m_InvalidKeywords: []
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_LockedProperties: 
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _Texture1:
+        m_Texture: {fileID: 2800000, guid: 97c83ef8555216848ba4f98a7496a917, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _Texture2:
+        m_Texture: {fileID: 2800000, guid: 846cce7d90ad21b4b80fcb937193081e, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _Blend: 0.38507944
+    - _Exposure1: 1
+    - _Exposure2: 1
+    - _ImageType: 0
+    - _Layout: 0
+    - _MirrorOnBack: 0
+    - _Rotation1: 0
+    - _Rotation2: 0
+    m_Colors:
+    - _Tint1: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
+    - _Tint2: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
+  m_BuildTextureStacks: []
+  m_AllowLocking: 1

+ 8 - 0
Assets/Scripts/Daylight Cycle/Skybox.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 90f55f0029046e6408a1f4d96ce0e278
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 136 - 0
Assets/Scripts/Daylight Cycle/Skybox.shader

@@ -0,0 +1,136 @@
+// Derived from Unity built-in shader source. 
+// https://raw.githubusercontent.com/chsxf/unity-built-in-shaders/0c7940740e75340009bbed453e2b198e294e4bab/Shaders/DefaultResourcesExtra/Skybox-Panoramic.shader
+ 
+Shader "Skybox/Dual Panoramic" {
+	Properties{
+		_Tint1("Tint Color 1", Color) = (.5, .5, .5, .5)
+		_Tint2("Tint Color 2", Color) = (.5, .5, .5, .5)
+		[Gamma] _Exposure1("Exposure 1", Range(0, 8)) = 1.0
+		[Gamma] _Exposure2("Exposure 2", Range(0, 8)) = 1.0
+		_Rotation1("Rotation1", Range(0, 360)) = 0
+		_Rotation2("Rotation2", Range(0, 360)) = 0
+		[NoScaleOffset] _Texture1("Texture 1", 2D) = "grey" {}
+		[NoScaleOffset] _Texture2("Texture 2", 2D) = "grey" {}
+		[Enum(360 Degrees, 0, 180 Degrees, 1)] _ImageType("Image Type", Float) = 0
+		[Toggle] _MirrorOnBack("Mirror on Back", Float) = 0
+		[Enum(None, 0, Side by Side, 1, Over Under, 2)] _Layout("3D Layout", Float) = 0
+		_Blend("Blend", Range(0.0, 1.0)) = 0.0
+	}
+ 
+		SubShader{
+			Tags { "Queue" = "Background" "RenderType" = "Background" "PreviewType" = "Skybox" }
+			Cull Off ZWrite Off
+ 
+			Pass {
+ 
+				CGPROGRAM
+				#pragma vertex vert
+				#pragma fragment frag
+				#pragma target 2.0
+				#pragma multi_compile_local __ _MAPPING_6_FRAMES_LAYOUT
+ 
+				#include "UnityCG.cginc"
+ 
+				sampler2D _Texture1;
+				sampler2D _Texture2;
+ 
+				float4 _Texture1_TexelSize;
+ 
+				half4 _Texture1_HDR;
+				half4 _Texture2_HDR;
+				half4 _Tint1;
+				half4 _Tint2;
+				half _Exposure1;
+				half _Exposure2;
+				float _Rotation1;
+				float _Rotation2;
+ 
+				float _Blend;
+ 
+				bool _MirrorOnBack;
+				int _ImageType;
+				int _Layout;
+ 
+				inline float2 ToRadialCoords(float3 coords)
+				{
+					float3 normalizedCoords = normalize(coords);
+					float latitude = acos(normalizedCoords.y);
+					float longitude = atan2(normalizedCoords.z, normalizedCoords.x);
+					float2 sphereCoords = float2(longitude, latitude) * float2(0.5 / UNITY_PI, 1.0 / UNITY_PI);
+					return float2(0.5,1.0) - sphereCoords;
+				}
+ 
+				float3 RotateAroundYInDegrees(float3 vertex, float degrees)
+				{
+					float alpha = degrees * UNITY_PI / 180.0;
+					float sina, cosa;
+					sincos(alpha, sina, cosa);
+					float2x2 m = float2x2(cosa, -sina, sina, cosa);
+					return float3(mul(m, vertex.xz), vertex.y).xzy;
+				}
+ 
+				struct appdata_t {
+					float4 vertex : POSITION;
+					UNITY_VERTEX_INPUT_INSTANCE_ID
+				};
+ 
+				struct v2f {
+					float4 vertex : SV_POSITION;
+					float3 texcoord : TEXCOORD0;
+					float2 image180ScaleAndCutoff : TEXCOORD1;
+					float4 layout3DScaleAndOffset : TEXCOORD2;
+					UNITY_VERTEX_OUTPUT_STEREO
+				};
+ 
+				v2f vert(appdata_t v)
+				{
+					v2f o;
+					UNITY_SETUP_INSTANCE_ID(v);
+					UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
+					float3 rotated = RotateAroundYInDegrees(v.vertex, _Rotation1);
+					o.vertex = UnityObjectToClipPos(rotated);
+ 
+					o.texcoord = v.vertex.xyz;
+ 
+					// Calculate constant horizontal scale and cutoff for 180 (vs 360) image type
+					if (_ImageType == 0)  // 360 degree
+						o.image180ScaleAndCutoff = float2(1.0, 1.0);
+					else  // 180 degree
+						o.image180ScaleAndCutoff = float2(2.0, _MirrorOnBack ? 1.0 : 0.5);
+					// Calculate constant scale and offset for 3D layouts
+					if (_Layout == 0) // No 3D layout
+						o.layout3DScaleAndOffset = float4(0,0,1,1);
+					else if (_Layout == 1) // Side-by-Side 3D layout
+						o.layout3DScaleAndOffset = float4(unity_StereoEyeIndex,0,0.5,1);
+					else // Over-Under 3D layout
+						o.layout3DScaleAndOffset = float4(0, 1 - unity_StereoEyeIndex,1,0.5);
+					return o;
+				}
+ 
+				fixed4 frag(v2f i) : SV_Target
+				{
+					float2 tc = ToRadialCoords(i.texcoord);
+					if (tc.x > i.image180ScaleAndCutoff[1])
+						return half4(0,0,0,1);
+					tc.x = fmod(tc.x * i.image180ScaleAndCutoff[0], 1);
+					tc = (tc + i.layout3DScaleAndOffset.xy) * i.layout3DScaleAndOffset.zw;
+ 
+					half4 tex1 = tex2D(_Texture1, tc);
+					tc.x = frac(tc.x + (_Rotation2 - _Rotation1) / 360.0);
+					half4 tex2 = tex2D(_Texture2, tc);
+ 
+					half3 c1 = DecodeHDR(tex1, _Texture1_HDR);
+					half3 c2 = DecodeHDR(tex2, _Texture2_HDR);
+ 
+					c1 = lerp(c1, c2, _Blend) * lerp(_Tint1.rgb, _Tint2.rgb, _Blend) * unity_ColorSpaceDouble.rgb * lerp(_Exposure1, _Exposure2, _Blend);
+					return half4(c1, 1);
+				}
+				ENDCG
+			}
+		}
+ 
+ 
+			//CustomEditor "SkyboxPanoramicShaderGUI"
+					Fallback Off
+ 
+}

+ 9 - 0
Assets/Scripts/Daylight Cycle/Skybox.shader.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 55a92c39bd4d7e34b8fe677fcae49f67
+ShaderImporter:
+  externalObjects: {}
+  defaultTextures: []
+  nonModifiableTextures: []
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 109 - 0
Assets/Scripts/Daylight Cycle/TimeManager.cs

@@ -0,0 +1,109 @@
+using System;
+using System.Collections;
+using UnityEngine;
+
+public class TimeManager : MonoBehaviour
+{
+    public float gameSpeed = 1f;
+    public Texture2D skyboxNight;
+    public Texture2D skyboxSunrise;
+    public Texture2D skyboxDay;
+    public Texture2D skyboxSunset;
+
+    public Gradient gradientNightToSunrise;
+    public Gradient gradientSunriseToDay;
+    public Gradient gradientDayToSunset;
+    public Gradient gradientSunsetToNight;
+    public Light globalLight;
+
+    public int minutes;
+    public int Minutes {  get { return minutes; } set { minutes = value; OnMinutesChanged(value); } }
+    public int hours;
+    public int Hours { get { return hours; } set { hours = value; OnHoursChanged(value); } }
+    public int days;
+    public int Days { get { return days; } set { days = value; } }
+
+    public float tempSecond;
+
+    // Start is called once before the first execution of Update after the MonoBehaviour is created
+    void Start()
+    {
+    }
+
+    // Update is called once per frame
+    void Update()
+    {
+        tempSecond += Time.deltaTime * gameSpeed;
+        if(tempSecond >= 1)
+        {
+            Minutes++;
+            tempSecond--;
+        }
+    }
+
+    private void OnMinutesChanged(float value)
+    {
+        globalLight.transform.Rotate(Vector3.up, (1f / 1440f) * 360f, Space.World);
+        if(value >= 60)
+        {
+            Hours++;
+            Minutes -= 60;
+        }
+        if (Hours >= 24)
+        {
+            Hours -= 24;
+            Days++;
+        }
+    }
+
+    private void OnHoursChanged(float value)
+    {
+        switch (value)
+        {
+            case 6:
+                StartCoroutine(LerpSkybox(skyboxNight, skyboxSunrise, 10f));
+                StartCoroutine(LerpLight(gradientNightToSunrise, 10f));
+                break;
+
+            case 10:
+                StartCoroutine(LerpSkybox(skyboxSunrise, skyboxDay, 10f));
+                StartCoroutine(LerpLight(gradientSunriseToDay, 10f));
+                break;
+
+            case 18:
+                StartCoroutine(LerpSkybox(skyboxDay, skyboxSunset, 10f));
+                StartCoroutine(LerpLight(gradientDayToSunset, 10f));
+                break;
+
+            case 22:
+                StartCoroutine(LerpSkybox(skyboxSunset, skyboxNight, 10f));
+                StartCoroutine(LerpLight(gradientSunsetToNight, 10f));
+                break;
+        }
+    }
+
+    private IEnumerator LerpSkybox(Texture2D a, Texture2D b, float time)
+    {
+        RenderSettings.skybox.SetTexture("_Texture1", a);
+        RenderSettings.skybox.SetTexture("_Texture2", b);
+        RenderSettings.skybox.SetFloat("_Blend", 0);
+
+        for (float i=0; i < time; i += Time.deltaTime)
+        {
+            RenderSettings.skybox.SetFloat("_Blend", i / time);
+            yield return null;
+        }
+
+        RenderSettings.skybox.SetTexture("_Texture1", b);
+    }
+
+    private IEnumerator LerpLight(Gradient lightGradient, float time)
+    {
+        for (float i = 0; i < time; i += Time.deltaTime)
+        {
+            globalLight.color = lightGradient.Evaluate(i / time);
+            RenderSettings.fogColor = globalLight.color;
+            yield return null;
+        }
+    }
+}

+ 2 - 0
Assets/Scripts/Daylight Cycle/TimeManager.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 85e11084e329cf544af675630d195e96

+ 78 - 0
Assets/Scripts/GameManager.cs

@@ -0,0 +1,78 @@
+using UnityEngine;
+
+public class GameManager : MonoBehaviour
+{
+    private GameData data;
+
+    private SaveManager saveManager;
+    private TimeManager timeManager;
+    private Material skybox;
+    private Color globalLightColor;
+    private Quaternion globalLightRotation;
+
+    private GameObject player;
+    // Start is called once before the first execution of Update after the MonoBehaviour is created
+    void Start()
+    {
+        //Get the player
+        player = GameObject.Find("Player");
+        if (player == null) return;
+
+        //Get components
+        saveManager = GetComponent<SaveManager>();
+        timeManager = GetComponent<TimeManager>();
+        skybox = RenderSettings.skybox;
+        globalLightColor = timeManager.globalLight.color;
+        globalLightRotation = timeManager.globalLight.transform.rotation;
+
+        data = saveManager.LoadGame();
+        if (data != null)
+        {
+            SetData();
+        }
+        else
+        {
+            data = new GameData();
+        }
+    }
+
+    // Update is called once per frame
+    void Update()
+    {
+
+        if (Input.GetKeyDown(KeyCode.Space)) 
+        {
+            GetData();
+            saveManager.SaveGame(data);
+        }
+    }
+    void GetData()
+    {
+        data.playerPosition = player.transform.position;
+
+        #region DaylightCycle
+        data.minutes = timeManager.Minutes;
+        data.hours = timeManager.Hours;
+        data.skybox = skybox;
+        data.globalLightColor = globalLightColor;
+        data.globalLightRotation = globalLightRotation;
+
+        #endregion
+    }
+
+    void SetData()
+    {
+        player.transform.position = data.playerPosition;
+
+        #region DaylightCycle
+        timeManager.Minutes = data.minutes;
+        timeManager.Hours = data.hours;
+        skybox = data.skybox;
+        globalLightColor = data.globalLightColor;
+        RenderSettings.fogColor = data.globalLightColor;
+        globalLightRotation = data.globalLightRotation;
+
+        #endregion
+
+    }
+}

+ 2 - 0
Assets/Scripts/GameManager.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: c3f7088d9e1a815409b9799da776d236

+ 1 - 1
Assets/Scripts/Procedural Generation/Data/TextureData.cs

@@ -28,6 +28,6 @@ public class TextureData : UpdatableData
         savedMaxHeight = maxHeight;
 
         material.SetFloat("_minHeight", minHeight);
-        material.SetFloat("maxHeight", maxHeight);
+        material.SetFloat("_maxHeight", maxHeight);
     }
 }

+ 6 - 1
Assets/Scripts/Procedural Generation/MapGenerator.cs

@@ -53,9 +53,15 @@ public class MapGenerator : MonoBehaviour
             }
         }
     }
+    private void Awake()
+    {
+        textureData.UpdateMeshHeights(terrainMaterial, terrainData.minHeight, terrainData.maxHeight);
+    }
 
     public void DrawMapInEditor()
     {
+
+        textureData.UpdateMeshHeights(terrainMaterial, terrainData.minHeight, terrainData.maxHeight);
         MapData mapData = GenerateMapData(Vector2.zero);
 
         MapDisplay display = FindFirstObjectByType<MapDisplay>();
@@ -152,7 +158,6 @@ public class MapGenerator : MonoBehaviour
                 }
             }
         }
-        textureData.UpdateMeshHeights(terrainMaterial, terrainData.minHeight, terrainData.maxHeight);
 
         return new MapData(noiseMap);
     }

+ 8 - 0
Assets/Scripts/Save.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 4dfab46d1d21d0441bbb8abb6f28b589
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 15 - 0
Assets/Scripts/Save/GameData.cs

@@ -0,0 +1,15 @@
+using UnityEngine;
+
+[System.Serializable]
+public class GameData
+{
+    public int playerScore;
+    public Vector3 playerPosition;
+
+    //Daylight cycle
+    public int minutes;
+    public int hours;
+    public Color globalLightColor;
+    public Quaternion globalLightRotation;
+    public Material skybox;
+}

+ 2 - 0
Assets/Scripts/Save/GameData.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: bf345fa14f8568e4fb61a7a957e33944

+ 35 - 0
Assets/Scripts/Save/SaveManager.cs

@@ -0,0 +1,35 @@
+using UnityEngine;
+using System.IO;
+
+public class SaveManager : MonoBehaviour
+{
+    private string filePath;
+
+    private void Start()
+    {
+        filePath = Application.persistentDataPath + "/savegame.json";
+    }
+
+    public void SaveGame(GameData data)
+    {
+        string json = JsonUtility.ToJson(data);
+        File.WriteAllText(filePath, json);
+        Debug.Log("Game Saved to " + filePath);
+    }
+
+    public GameData LoadGame()
+    {
+        if (File.Exists(filePath))
+        {
+            string json = File.ReadAllText(filePath);
+            GameData data = JsonUtility.FromJson<GameData>(json);
+            Debug.Log("Game loaded from " + filePath);
+            return data;
+        }
+        else
+        {
+            Debug.Log("Save file not found!");
+            return null;
+        }
+    }
+}

+ 2 - 0
Assets/Scripts/Save/SaveManager.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: edd665f08fa3eba49baff6e30dbaa3b3

+ 10 - 10
Assets/TerrainAssets/DefaultTerrain.asset

@@ -30,22 +30,22 @@ MonoBehaviour:
       inWeight: 0
       outWeight: 0
     - serializedVersion: 3
-      time: 0.4321544
-      value: 0.10455926
-      inSlope: 0.3379594
-      outSlope: 0.3379594
+      time: 0.38158676
+      value: 0.10217889
+      inSlope: 0.6525174
+      outSlope: 0.6525174
       tangentMode: 0
       weightedMode: 0
       inWeight: 0.33333334
-      outWeight: 0.23133722
+      outWeight: 0.18444628
     - serializedVersion: 3
-      time: 0.78393525
-      value: 0.4294193
-      inSlope: 1.9452653
-      outSlope: 1.9452653
+      time: 0.7825925
+      value: 0.45571017
+      inSlope: 1.5272214
+      outSlope: 1.5272214
       tangentMode: 0
       weightedMode: 0
-      inWeight: 0.33333334
+      inWeight: 0.12623401
       outWeight: 0.18317983
     - serializedVersion: 3
       time: 1.0000234

+ 7 - 7
Assets/TerrainAssets/DefaultTexture.asset

@@ -24,10 +24,10 @@ MonoBehaviour:
   - {r: 0.94509804, g: 0.92156863, b: 0.8156863, a: 0}
   baseStartHeights:
   - 0
-  - 0.11
-  - 0.18
-  - 0.247
-  - 0.363
-  - 0.51
-  - 0.686
-  - 0.778
+  - 0.064
+  - 0.104
+  - 0.159
+  - 0.335
+  - 0.473
+  - 0.649
+  - 0.787

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio