Ver Fonte

Map generation added

Priz há 4 dias atrás
pai
commit
a32ab89f22
62 ficheiros alterados com 3901 adições e 4 exclusões
  1. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Editor.meta
  2. 21 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Editor/MapGeneratorEditor.cs
  3. 12 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Editor/MapGeneratorEditor.cs.meta
  4. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Material.meta
  5. 80 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Material/Map Mat.mat
  6. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Material/Map Mat.mat.meta
  7. 54 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Material/Mesh Mat.mat
  8. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Material/Mesh Mat.mat.meta
  9. 136 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Material/Mesh Material.mat
  10. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Material/Mesh Material.mat.meta
  11. 782 3
      GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Game.unity
  12. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene.meta
  13. 842 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene.unity
  14. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene.unity.meta
  15. BIN
      GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene/LightingData.asset
  16. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene/LightingData.asset.meta
  17. BIN
      GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene/ReflectionProbe-0.exr
  18. 143 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene/ReflectionProbe-0.exr.meta
  19. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen.meta
  20. 214 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/EndlessTerrain.cs
  21. 12 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/EndlessTerrain.cs.meta
  22. 28 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/FalloffGenerator.cs
  23. 12 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/FalloffGenerator.cs.meta
  24. 15 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/HideOnPlay.cs
  25. 12 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/HideOnPlay.cs.meta
  26. 20 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MapDisplay.cs
  27. 12 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MapDisplay.cs.meta
  28. 187 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MapGenerator.cs
  29. 12 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MapGenerator.cs.meta
  30. 211 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MeshGenerator.cs
  31. 12 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MeshGenerator.cs.meta
  32. 79 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/Noise.cs
  33. 12 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/Noise.cs.meta
  34. 30 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/TextureGenerator.cs
  35. 12 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/TextureGenerator.cs.meta
  36. 1 1
      GAMEN3-ValleyRunner_SanTi036/Assets/Skybox.mat
  37. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets.meta
  38. 6 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters.meta
  39. 6 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter.meta
  40. 6 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs.meta
  41. 248 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab
  42. 5 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab.meta
  43. 6 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts.meta
  44. 114 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs
  45. 9 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs.meta
  46. 269 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/RigidbodyFirstPersonController.cs
  47. 9 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/RigidbodyFirstPersonController.cs.meta
  48. 9 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials.meta
  49. 19 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Bouncy.physicmaterial
  50. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Bouncy.physicmaterial.meta
  51. 19 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Ice.physicmaterial
  52. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Ice.physicmaterial.meta
  53. 16 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/MaxFriction.physicMaterial
  54. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/MaxFriction.physicMaterial.meta
  55. 19 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Metal.physicmaterial
  56. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Metal.physicmaterial.meta
  57. 19 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Rubber.physicmaterial
  58. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Rubber.physicmaterial.meta
  59. 19 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Wood.physicmaterial
  60. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Wood.physicmaterial.meta
  61. 16 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/ZeroFriction.physicMaterial
  62. 8 0
      GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/ZeroFriction.physicMaterial.meta

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Editor.meta

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

+ 21 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Editor/MapGeneratorEditor.cs

@@ -0,0 +1,21 @@
+using UnityEngine;
+using System.Collections;
+using UnityEditor;
+
+[CustomEditor (typeof (MapGenerator))]
+public class MapGeneratorEditor : Editor {
+
+	public override void OnInspectorGUI() {
+		MapGenerator mapGen = (MapGenerator)target;
+
+		if (DrawDefaultInspector ()) {
+			if (mapGen.autoUpdate) {
+				mapGen.DrawMapInEditor ();
+			}
+		}
+
+		if (GUILayout.Button ("Generate")) {
+			mapGen.DrawMapInEditor ();
+		}
+	}
+}

+ 12 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Editor/MapGeneratorEditor.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 36580b8c831d94d3392f333a33b58f7a
+timeCreated: 1454754709
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Material.meta

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

+ 80 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Material/Map Mat.mat

@@ -0,0 +1,80 @@
+%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: Map Mat
+  m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0}
+  m_Parent: {fileID: 0}
+  m_ModifiedSerializedProperties: 0
+  m_ValidKeywords: []
+  m_InvalidKeywords: []
+  m_LightmapFlags: 5
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: 2000
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_LockedProperties: 
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _BumpScale: 1
+    - _Cutoff: 0.5
+    - _DetailNormalMapScale: 1
+    - _DstBlend: 0
+    - _Glossiness: 0.5
+    - _Metallic: 0
+    - _Mode: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _SrcBlend: 1
+    - _UVSec: 0
+    - _ZWrite: 1
+    m_Colors:
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+  m_BuildTextureStacks: []
+  m_AllowLocking: 1

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Material/Map Mat.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8361772db5b074f13a47ece154898939
+timeCreated: 1454754662
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 54 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Material/Mesh Mat.mat

@@ -0,0 +1,54 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &-6827682499769759219
+MonoBehaviour:
+  m_ObjectHideFlags: 11
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  version: 10
+--- !u!21 &2100000
+Material:
+  serializedVersion: 8
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Mesh Mat
+  m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
+  m_Parent: {fileID: 2100000, guid: 2cd992d529c08b241b8c0be883f39a2e, type: 2}
+  m_ModifiedSerializedProperties: 2
+  m_ValidKeywords:
+  - _EMISSION
+  m_InvalidKeywords: []
+  m_LightmapFlags: 1
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap:
+    RenderType: Opaque
+  disabledShaderPasses:
+  - MOTIONVECTORS
+  m_LockedProperties: 
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BaseMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _GlossMapScale: 1
+    - _GlossyReflections: 1
+    - _Parallax: 0.02
+    - _Smoothness: 0.5
+    m_Colors: []
+  m_BuildTextureStacks: []
+  m_AllowLocking: 1

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Material/Mesh Mat.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b0872f84cf3c7441d893168677410c73
+timeCreated: 1455974709
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 136 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Material/Mesh Material.mat

@@ -0,0 +1,136 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &-2908825689766565572
+MonoBehaviour:
+  m_ObjectHideFlags: 11
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  version: 10
+--- !u!21 &2100000
+Material:
+  serializedVersion: 8
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Mesh Material
+  m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, 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:
+    RenderType: Opaque
+  disabledShaderPasses:
+  - MOTIONVECTORS
+  m_LockedProperties: 
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BaseMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _SpecGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - unity_Lightmaps:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - unity_LightmapsInd:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - unity_ShadowMasks:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _AddPrecomputedVelocity: 0
+    - _AlphaClip: 0
+    - _AlphaToMask: 0
+    - _Blend: 0
+    - _BlendModePreserveSpecular: 1
+    - _BumpScale: 1
+    - _ClearCoatMask: 0
+    - _ClearCoatSmoothness: 0
+    - _Cull: 2
+    - _Cutoff: 0.5
+    - _DetailAlbedoMapScale: 1
+    - _DetailNormalMapScale: 1
+    - _DstBlend: 0
+    - _DstBlendAlpha: 0
+    - _EnvironmentReflections: 1
+    - _GlossMapScale: 0
+    - _Glossiness: 0
+    - _GlossyReflections: 0
+    - _Metallic: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.005
+    - _QueueOffset: 0
+    - _ReceiveShadows: 1
+    - _Smoothness: 0
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _SrcBlendAlpha: 1
+    - _Surface: 0
+    - _WorkflowMode: 1
+    - _ZWrite: 1
+    m_Colors:
+    - _BaseColor: {r: 1, g: 1, b: 1, a: 1}
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+    - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
+  m_BuildTextureStacks: []
+  m_AllowLocking: 1

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Material/Mesh Material.mat.meta

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

Diff do ficheiro suprimidas por serem muito extensas
+ 782 - 3
GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Game.unity


+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene.meta

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

Diff do ficheiro suprimidas por serem muito extensas
+ 842 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene.unity


+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene.unity.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d9f8c2fdf48824faaa2ed178aa5dc8ef
+timeCreated: 1454753185
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene/LightingData.asset


+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene/LightingData.asset.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c6c56dec0b37d514f940d9576a604a05
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 112000000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene/ReflectionProbe-0.exr


+ 143 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scenes/Scene/ReflectionProbe-0.exr.meta

@@ -0,0 +1,143 @@
+fileFormatVersion: 2
+guid: 2a141d0e42dff1b479feb6e43ecb7e1f
+TextureImporter:
+  internalIDToNameTable: []
+  externalObjects: {}
+  serializedVersion: 13
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 1
+    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: 1
+  seamlessCubemap: 1
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: 2
+    aniso: 0
+    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: 1
+  alphaIsTransparency: 0
+  spriteTessellationDetail: -1
+  textureType: 0
+  textureShape: 2
+  singleChannelComponent: 0
+  flipbookRows: 1
+  flipbookColumns: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  ignorePngGamma: 0
+  applyGammaDecoding: 0
+  swizzle: 50462976
+  cookieLightType: 0
+  platformSettings:
+  - serializedVersion: 4
+    buildTarget: DefaultTexturePlatform
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 100
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Standalone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: Android
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 4
+    buildTarget: WebGL
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    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: 

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen.meta

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

+ 214 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/EndlessTerrain.cs

@@ -0,0 +1,214 @@
+using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+
+public class EndlessTerrain : MonoBehaviour {
+
+	const float scale = 2.5f;
+
+	const float viewerMoveThresholdForChunkUpdate = 25f;
+	const float sqrViewerMoveThresholdForChunkUpdate = viewerMoveThresholdForChunkUpdate * viewerMoveThresholdForChunkUpdate;
+
+	public LODInfo[] detailLevels;
+	public static float maxViewDst;
+
+	public Transform viewer;
+	public Material mapMaterial;
+
+	public static Vector2 viewerPosition;
+	Vector2 viewerPositionOld;
+	static MapGenerator mapGenerator;
+	int chunkSize;
+	int chunksVisibleInViewDst;
+
+	Dictionary<Vector2, TerrainChunk> terrainChunkDictionary = new Dictionary<Vector2, TerrainChunk>();
+	static List<TerrainChunk> terrainChunksVisibleLastUpdate = new List<TerrainChunk>();
+
+	void Start() {
+		mapGenerator = FindObjectOfType<MapGenerator> ();
+
+		maxViewDst = detailLevels [detailLevels.Length - 1].visibleDstThreshold;
+		chunkSize = MapGenerator.mapChunkSize - 1;
+		chunksVisibleInViewDst = Mathf.RoundToInt(maxViewDst / chunkSize);
+
+		UpdateVisibleChunks ();
+	}
+
+	void Update() {
+		viewerPosition = new Vector2 (viewer.position.x, viewer.position.z) / scale;
+
+		if ((viewerPositionOld - viewerPosition).sqrMagnitude > sqrViewerMoveThresholdForChunkUpdate) {
+			viewerPositionOld = viewerPosition;
+			UpdateVisibleChunks ();
+		}
+	}
+		
+	void UpdateVisibleChunks() {
+
+		for (int i = 0; i < terrainChunksVisibleLastUpdate.Count; i++) {
+			terrainChunksVisibleLastUpdate [i].SetVisible (false);
+		}
+		terrainChunksVisibleLastUpdate.Clear ();
+			
+		int currentChunkCoordX = Mathf.RoundToInt (viewerPosition.x / chunkSize);
+		int currentChunkCoordY = Mathf.RoundToInt (viewerPosition.y / chunkSize);
+
+		for (int yOffset = -chunksVisibleInViewDst; yOffset <= chunksVisibleInViewDst; yOffset++) {
+			for (int xOffset = -chunksVisibleInViewDst; xOffset <= chunksVisibleInViewDst; xOffset++) {
+				Vector2 viewedChunkCoord = new Vector2 (currentChunkCoordX + xOffset, currentChunkCoordY + yOffset);
+
+				if (terrainChunkDictionary.ContainsKey (viewedChunkCoord)) {
+					terrainChunkDictionary [viewedChunkCoord].UpdateTerrainChunk ();
+				} else {
+					terrainChunkDictionary.Add (viewedChunkCoord, new TerrainChunk (viewedChunkCoord, chunkSize, detailLevels, transform, mapMaterial));
+				}
+
+			}
+		}
+	}
+
+	public class TerrainChunk {
+
+		GameObject meshObject;
+		Vector2 position;
+		Bounds bounds;
+
+		MeshRenderer meshRenderer;
+		MeshFilter meshFilter;
+		MeshCollider meshCollider;
+
+		LODInfo[] detailLevels;
+		LODMesh[] lodMeshes;
+		LODMesh collisionLODMesh;
+
+		MapData mapData;
+		bool mapDataReceived;
+		int previousLODIndex = -1;
+
+		public TerrainChunk(Vector2 coord, int size, LODInfo[] detailLevels, Transform parent, Material material) {
+			this.detailLevels = detailLevels;
+
+			position = coord * size;
+			bounds = new Bounds(position,Vector2.one * size);
+			Vector3 positionV3 = new Vector3(position.x,0,position.y);
+
+			meshObject = new GameObject("Terrain Chunk");
+			meshRenderer = meshObject.AddComponent<MeshRenderer>();
+			meshFilter = meshObject.AddComponent<MeshFilter>();
+			meshCollider = meshObject.AddComponent<MeshCollider>();
+			meshRenderer.material = material;
+
+			meshObject.transform.position = positionV3 * scale;
+			meshObject.transform.parent = parent;
+			meshObject.transform.localScale = Vector3.one * scale;
+			SetVisible(false);
+
+			lodMeshes = new LODMesh[detailLevels.Length];
+			for (int i = 0; i < detailLevels.Length; i++) {
+				lodMeshes[i] = new LODMesh(detailLevels[i].lod, UpdateTerrainChunk);
+				if (detailLevels[i].useForCollider) {
+					collisionLODMesh = lodMeshes[i];
+				}
+			}
+
+			mapGenerator.RequestMapData(position,OnMapDataReceived);
+		}
+
+		void OnMapDataReceived(MapData mapData) {
+			this.mapData = mapData;
+			mapDataReceived = true;
+
+			Texture2D texture = TextureGenerator.TextureFromColourMap (mapData.colourMap, MapGenerator.mapChunkSize, MapGenerator.mapChunkSize);
+			meshRenderer.material.mainTexture = texture;
+
+			UpdateTerrainChunk ();
+		}
+
+	
+
+		public void UpdateTerrainChunk() {
+			if (mapDataReceived) {
+				float viewerDstFromNearestEdge = Mathf.Sqrt (bounds.SqrDistance (viewerPosition));
+				bool visible = viewerDstFromNearestEdge <= maxViewDst;
+
+				if (visible) {
+					int lodIndex = 0;
+
+					for (int i = 0; i < detailLevels.Length - 1; i++) {
+						if (viewerDstFromNearestEdge > detailLevels [i].visibleDstThreshold) {
+							lodIndex = i + 1;
+						} else {
+							break;
+						}
+					}
+
+					if (lodIndex != previousLODIndex) {
+						LODMesh lodMesh = lodMeshes [lodIndex];
+						if (lodMesh.hasMesh) {
+							previousLODIndex = lodIndex;
+							meshFilter.mesh = lodMesh.mesh;
+						} else if (!lodMesh.hasRequestedMesh) {
+							lodMesh.RequestMesh (mapData);
+						}
+					}
+
+					if (lodIndex == 0) {
+						if (collisionLODMesh.hasMesh) {
+							meshCollider.sharedMesh = collisionLODMesh.mesh;
+						} else if (!collisionLODMesh.hasRequestedMesh) {
+							collisionLODMesh.RequestMesh (mapData);
+						}
+					}
+
+					terrainChunksVisibleLastUpdate.Add (this);
+				}
+
+				SetVisible (visible);
+			}
+		}
+
+		public void SetVisible(bool visible) {
+			meshObject.SetActive (visible);
+		}
+
+		public bool IsVisible() {
+			return meshObject.activeSelf;
+		}
+
+	}
+
+	class LODMesh {
+
+		public Mesh mesh;
+		public bool hasRequestedMesh;
+		public bool hasMesh;
+		int lod;
+		System.Action updateCallback;
+
+		public LODMesh(int lod, System.Action updateCallback) {
+			this.lod = lod;
+			this.updateCallback = updateCallback;
+		}
+
+		void OnMeshDataReceived(MeshData meshData) {
+			mesh = meshData.CreateMesh ();
+			hasMesh = true;
+
+			updateCallback ();
+		}
+
+		public void RequestMesh(MapData mapData) {
+			hasRequestedMesh = true;
+			mapGenerator.RequestMeshData (mapData, lod, OnMeshDataReceived);
+		}
+
+	}
+
+	[System.Serializable]
+	public struct LODInfo {
+		public int lod;
+		public float visibleDstThreshold;
+		public bool useForCollider;
+	}
+
+}

+ 12 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/EndlessTerrain.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 16ce6ecc4242344ccb4045ed364cbcc0
+timeCreated: 1457969415
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 28 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/FalloffGenerator.cs

@@ -0,0 +1,28 @@
+using UnityEngine;
+using System.Collections;
+
+public static class FalloffGenerator {
+
+	public static float[,] GenerateFalloffMap(int size) {
+		float[,] map = new float[size,size];
+
+		for (int i = 0; i < size; i++) {
+			for (int j = 0; j < size; j++) {
+				float x = i / (float)size * 2 - 1;
+				float y = j / (float)size * 2 - 1;
+
+				float value = Mathf.Max (Mathf.Abs (x), Mathf.Abs (y));
+				map [i, j] = Evaluate(value);
+			}
+		}
+
+		return map;
+	}
+
+	static float Evaluate(float value) {
+		float a = 3;
+		float b = 2.2f;
+
+		return Mathf.Pow (value, a) / (Mathf.Pow (value, a) + Mathf.Pow (b - b * value, a));
+	}
+}

+ 12 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/FalloffGenerator.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 94ecc0bec425d4c9a94a55c7bc8f1fea
+timeCreated: 1462976878
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 15 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/HideOnPlay.cs

@@ -0,0 +1,15 @@
+using UnityEngine;
+using System.Collections;
+
+public class HideOnPlay : MonoBehaviour {
+
+	// Use this for initialization
+	void Start () {
+		gameObject.SetActive (false);
+	}
+	
+	// Update is called once per frame
+	void Update () {
+	
+	}
+}

+ 12 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/HideOnPlay.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 7712ca4b498404cc5931aea5ebc20f51
+timeCreated: 1472545823
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MapDisplay.cs

@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+public class MapDisplay : MonoBehaviour {
+
+	public Renderer textureRender;
+	public MeshFilter meshFilter;
+	public MeshRenderer meshRenderer;
+
+	public void DrawTexture(Texture2D texture) {
+		textureRender.sharedMaterial.mainTexture = texture;
+		textureRender.transform.localScale = new Vector3 (texture.width, 1, texture.height);
+	}
+
+	public void DrawMesh(MeshData meshData, Texture2D texture) {
+		meshFilter.sharedMesh = meshData.CreateMesh ();
+		meshRenderer.sharedMaterial.mainTexture = texture;
+	}
+
+}

+ 12 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MapDisplay.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 4aeb0f3a8e031433495f2ddd66acbef4
+timeCreated: 1454754170
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 187 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MapGenerator.cs

@@ -0,0 +1,187 @@
+using UnityEngine;
+using System.Collections;
+using System;
+using System.Threading;
+using System.Collections.Generic;
+
+public class MapGenerator : MonoBehaviour {
+
+	public enum DrawMode {NoiseMap, ColourMap, Mesh, FalloffMap};
+	public DrawMode drawMode;
+
+	public Noise.NormalizeMode normalizeMode;
+
+	public bool useFlatShading;
+
+	[Range(0,6)]
+	public int editorPreviewLOD;
+	public float noiseScale;
+
+	public int octaves;
+	[Range(0,1)]
+	public float persistance;
+	public float lacunarity;
+
+	public int seed;
+	public Vector2 offset;
+
+	public bool useFalloff;
+
+	public float meshHeightMultiplier;
+	public AnimationCurve meshHeightCurve;
+
+	public bool autoUpdate;
+
+	public TerrainType[] regions;
+	static MapGenerator instance;
+
+	float[,] falloffMap;
+
+	Queue<MapThreadInfo<MapData>> mapDataThreadInfoQueue = new Queue<MapThreadInfo<MapData>>();
+	Queue<MapThreadInfo<MeshData>> meshDataThreadInfoQueue = new Queue<MapThreadInfo<MeshData>>();
+
+	void Awake() {
+		falloffMap = FalloffGenerator.GenerateFalloffMap (mapChunkSize);
+	}
+
+	public static int mapChunkSize {
+		get {
+			if (instance == null) {
+				instance = FindObjectOfType<MapGenerator> ();
+			}
+
+			if (instance.useFlatShading) {
+				return 95;
+			} else {
+				return 239;
+			}
+		}
+	}
+
+	public void DrawMapInEditor() {
+		MapData mapData = GenerateMapData (Vector2.zero);
+
+		MapDisplay display = FindObjectOfType<MapDisplay> ();
+		if (drawMode == DrawMode.NoiseMap) {
+			display.DrawTexture (TextureGenerator.TextureFromHeightMap (mapData.heightMap));
+		} else if (drawMode == DrawMode.ColourMap) {
+			display.DrawTexture (TextureGenerator.TextureFromColourMap (mapData.colourMap, mapChunkSize, mapChunkSize));
+		} else if (drawMode == DrawMode.Mesh) {
+			display.DrawMesh (MeshGenerator.GenerateTerrainMesh (mapData.heightMap, meshHeightMultiplier, meshHeightCurve, editorPreviewLOD,useFlatShading), TextureGenerator.TextureFromColourMap (mapData.colourMap, mapChunkSize, mapChunkSize));
+		} else if (drawMode == DrawMode.FalloffMap) {
+			display.DrawTexture(TextureGenerator.TextureFromHeightMap(FalloffGenerator.GenerateFalloffMap(mapChunkSize)));
+		}
+	}
+
+	public void RequestMapData(Vector2 centre, Action<MapData> callback) {
+		ThreadStart threadStart = delegate {
+			MapDataThread (centre, callback);
+		};
+
+		new Thread (threadStart).Start ();
+	}
+
+	void MapDataThread(Vector2 centre, Action<MapData> callback) {
+		MapData mapData = GenerateMapData (centre);
+		lock (mapDataThreadInfoQueue) {
+			mapDataThreadInfoQueue.Enqueue (new MapThreadInfo<MapData> (callback, mapData));
+		}
+	}
+
+	public void RequestMeshData(MapData mapData, int lod, Action<MeshData> callback) {
+		ThreadStart threadStart = delegate {
+			MeshDataThread (mapData, lod, callback);
+		};
+
+		new Thread (threadStart).Start ();
+	}
+
+	void MeshDataThread(MapData mapData, int lod, Action<MeshData> callback) {
+		MeshData meshData = MeshGenerator.GenerateTerrainMesh (mapData.heightMap, meshHeightMultiplier, meshHeightCurve, lod,useFlatShading);
+		lock (meshDataThreadInfoQueue) {
+			meshDataThreadInfoQueue.Enqueue (new MapThreadInfo<MeshData> (callback, meshData));
+		}
+	}
+
+	void Update() {
+		if (mapDataThreadInfoQueue.Count > 0) {
+			for (int i = 0; i < mapDataThreadInfoQueue.Count; i++) {
+				MapThreadInfo<MapData> threadInfo = mapDataThreadInfoQueue.Dequeue ();
+				threadInfo.callback (threadInfo.parameter);
+			}
+		}
+
+		if (meshDataThreadInfoQueue.Count > 0) {
+			for (int i = 0; i < meshDataThreadInfoQueue.Count; i++) {
+				MapThreadInfo<MeshData> threadInfo = meshDataThreadInfoQueue.Dequeue ();
+				threadInfo.callback (threadInfo.parameter);
+			}
+		}
+	}
+
+	MapData GenerateMapData(Vector2 centre) {
+		float[,] noiseMap = Noise.GenerateNoiseMap (mapChunkSize + 2, mapChunkSize + 2, seed, noiseScale, octaves, persistance, lacunarity, centre + offset, normalizeMode);
+
+		Color[] colourMap = new Color[mapChunkSize * mapChunkSize];
+		for (int y = 0; y < mapChunkSize; y++) {
+			for (int x = 0; x < mapChunkSize; x++) {
+				if (useFalloff) {
+					noiseMap [x, y] = Mathf.Clamp01(noiseMap [x, y] - falloffMap [x, y]);
+				}
+				float currentHeight = noiseMap [x, y];
+				for (int i = 0; i < regions.Length; i++) {
+					if (currentHeight >= regions [i].height) {
+						colourMap [y * mapChunkSize + x] = regions [i].colour;
+					} else {
+						break;
+					}
+				}
+			}
+		}
+
+
+		return new MapData (noiseMap, colourMap);
+	}
+
+	void OnValidate() {
+		if (lacunarity < 1) {
+			lacunarity = 1;
+		}
+		if (octaves < 0) {
+			octaves = 0;
+		}
+
+		falloffMap = FalloffGenerator.GenerateFalloffMap (mapChunkSize);
+	}
+
+	struct MapThreadInfo<T> {
+		public readonly Action<T> callback;
+		public readonly T parameter;
+
+		public MapThreadInfo (Action<T> callback, T parameter)
+		{
+			this.callback = callback;
+			this.parameter = parameter;
+		}
+
+	}
+
+}
+
+[System.Serializable]
+public struct TerrainType {
+	public string name;
+	public float height;
+	public Color colour;
+}
+
+public struct MapData {
+	public readonly float[,] heightMap;
+	public readonly Color[] colourMap;
+
+	public MapData (float[,] heightMap, Color[] colourMap)
+	{
+		this.heightMap = heightMap;
+		this.colourMap = colourMap;
+	}
+}

+ 12 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MapGenerator.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 916b4f4143ed7456294aa19afa97bde8
+timeCreated: 1454754067
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 211 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MeshGenerator.cs

@@ -0,0 +1,211 @@
+using UnityEngine;
+using System.Collections;
+
+public static class MeshGenerator {
+
+	public static MeshData GenerateTerrainMesh(float[,] heightMap, float heightMultiplier, AnimationCurve _heightCurve, int levelOfDetail, bool useFlatShading) {
+		AnimationCurve heightCurve = new AnimationCurve (_heightCurve.keys);
+
+		int meshSimplificationIncrement = (levelOfDetail == 0)?1:levelOfDetail * 2;
+
+		int borderedSize = heightMap.GetLength (0);
+		int meshSize = borderedSize - 2*meshSimplificationIncrement;
+		int meshSizeUnsimplified = borderedSize - 2;
+
+		float topLeftX = (meshSizeUnsimplified - 1) / -2f;
+		float topLeftZ = (meshSizeUnsimplified - 1) / 2f;
+
+
+		int verticesPerLine = (meshSize - 1) / meshSimplificationIncrement + 1;
+
+		MeshData meshData = new MeshData (verticesPerLine,useFlatShading);
+
+		int[,] vertexIndicesMap = new int[borderedSize,borderedSize];
+		int meshVertexIndex = 0;
+		int borderVertexIndex = -1;
+
+		for (int y = 0; y < borderedSize; y += meshSimplificationIncrement) {
+			for (int x = 0; x < borderedSize; x += meshSimplificationIncrement) {
+				bool isBorderVertex = y == 0 || y == borderedSize - 1 || x == 0 || x == borderedSize - 1;
+
+				if (isBorderVertex) {
+					vertexIndicesMap [x, y] = borderVertexIndex;
+					borderVertexIndex--;
+				} else {
+					vertexIndicesMap [x, y] = meshVertexIndex;
+					meshVertexIndex++;
+				}
+			}
+		}
+
+		for (int y = 0; y < borderedSize; y += meshSimplificationIncrement) {
+			for (int x = 0; x < borderedSize; x += meshSimplificationIncrement) {
+				int vertexIndex = vertexIndicesMap [x, y];
+				Vector2 percent = new Vector2 ((x-meshSimplificationIncrement) / (float)meshSize, (y-meshSimplificationIncrement) / (float)meshSize);
+				float height = heightCurve.Evaluate (heightMap [x, y]) * heightMultiplier;
+				Vector3 vertexPosition = new Vector3 (topLeftX + percent.x * meshSizeUnsimplified, height, topLeftZ - percent.y * meshSizeUnsimplified);
+
+				meshData.AddVertex (vertexPosition, percent, vertexIndex);
+
+				if (x < borderedSize - 1 && y < borderedSize - 1) {
+					int a = vertexIndicesMap [x, y];
+					int b = vertexIndicesMap [x + meshSimplificationIncrement, y];
+					int c = vertexIndicesMap [x, y + meshSimplificationIncrement];
+					int d = vertexIndicesMap [x + meshSimplificationIncrement, y + meshSimplificationIncrement];
+					meshData.AddTriangle (a,d,c);
+					meshData.AddTriangle (d,a,b);
+				}
+
+				vertexIndex++;
+			}
+		}
+
+		meshData.ProcessMesh ();
+
+		return meshData;
+
+	}
+}
+
+public class MeshData {
+	Vector3[] vertices;
+	int[] triangles;
+	Vector2[] uvs;
+	Vector3[] bakedNormals;
+
+	Vector3[] borderVertices;
+	int[] borderTriangles;
+
+	int triangleIndex;
+	int borderTriangleIndex;
+
+	bool useFlatShading;
+
+	public MeshData(int verticesPerLine, bool useFlatShading) {
+		this.useFlatShading = useFlatShading;
+
+		vertices = new Vector3[verticesPerLine * verticesPerLine];
+		uvs = new Vector2[verticesPerLine * verticesPerLine];
+		triangles = new int[(verticesPerLine-1)*(verticesPerLine-1)*6];
+
+		borderVertices = new Vector3[verticesPerLine * 4 + 4];
+		borderTriangles = new int[24 * verticesPerLine];
+	}
+
+	public void AddVertex(Vector3 vertexPosition, Vector2 uv, int vertexIndex) {
+		if (vertexIndex < 0) {
+			borderVertices [-vertexIndex - 1] = vertexPosition;
+		} else {
+			vertices [vertexIndex] = vertexPosition;
+			uvs [vertexIndex] = uv;
+		}
+	}
+
+	public void AddTriangle(int a, int b, int c) {
+		if (a < 0 || b < 0 || c < 0) {
+			borderTriangles [borderTriangleIndex] = a;
+			borderTriangles [borderTriangleIndex + 1] = b;
+			borderTriangles [borderTriangleIndex + 2] = c;
+			borderTriangleIndex += 3;
+		} else {
+			triangles [triangleIndex] = a;
+			triangles [triangleIndex + 1] = b;
+			triangles [triangleIndex + 2] = c;
+			triangleIndex += 3;
+		}
+	}
+
+	Vector3[] CalculateNormals() {
+
+		Vector3[] vertexNormals = new Vector3[vertices.Length];
+		int triangleCount = triangles.Length / 3;
+		for (int i = 0; i < triangleCount; i++) {
+			int normalTriangleIndex = i * 3;
+			int vertexIndexA = triangles [normalTriangleIndex];
+			int vertexIndexB = triangles [normalTriangleIndex + 1];
+			int vertexIndexC = triangles [normalTriangleIndex + 2];
+
+			Vector3 triangleNormal = SurfaceNormalFromIndices (vertexIndexA, vertexIndexB, vertexIndexC);
+			vertexNormals [vertexIndexA] += triangleNormal;
+			vertexNormals [vertexIndexB] += triangleNormal;
+			vertexNormals [vertexIndexC] += triangleNormal;
+		}
+
+		int borderTriangleCount = borderTriangles.Length / 3;
+		for (int i = 0; i < borderTriangleCount; i++) {
+			int normalTriangleIndex = i * 3;
+			int vertexIndexA = borderTriangles [normalTriangleIndex];
+			int vertexIndexB = borderTriangles [normalTriangleIndex + 1];
+			int vertexIndexC = borderTriangles [normalTriangleIndex + 2];
+
+			Vector3 triangleNormal = SurfaceNormalFromIndices (vertexIndexA, vertexIndexB, vertexIndexC);
+			if (vertexIndexA >= 0) {
+				vertexNormals [vertexIndexA] += triangleNormal;
+			}
+			if (vertexIndexB >= 0) {
+				vertexNormals [vertexIndexB] += triangleNormal;
+			}
+			if (vertexIndexC >= 0) {
+				vertexNormals [vertexIndexC] += triangleNormal;
+			}
+		}
+
+
+		for (int i = 0; i < vertexNormals.Length; i++) {
+			vertexNormals [i].Normalize ();
+		}
+
+		return vertexNormals;
+
+	}
+
+	Vector3 SurfaceNormalFromIndices(int indexA, int indexB, int indexC) {
+		Vector3 pointA = (indexA < 0)?borderVertices[-indexA-1] : vertices [indexA];
+		Vector3 pointB = (indexB < 0)?borderVertices[-indexB-1] : vertices [indexB];
+		Vector3 pointC = (indexC < 0)?borderVertices[-indexC-1] : vertices [indexC];
+
+		Vector3 sideAB = pointB - pointA;
+		Vector3 sideAC = pointC - pointA;
+		return Vector3.Cross (sideAB, sideAC).normalized;
+	}
+
+	public void ProcessMesh() {
+		if (useFlatShading) {
+			FlatShading ();
+		} else {
+			BakeNormals ();
+		}
+	}
+
+	void BakeNormals() {
+		bakedNormals = CalculateNormals ();
+	}
+
+	void FlatShading() {
+		Vector3[] flatShadedVertices = new Vector3[triangles.Length];
+		Vector2[] flatShadedUvs = new Vector2[triangles.Length];
+
+		for (int i = 0; i < triangles.Length; i++) {
+			flatShadedVertices [i] = vertices [triangles [i]];
+			flatShadedUvs [i] = uvs [triangles [i]];
+			triangles [i] = i;
+		}
+
+		vertices = flatShadedVertices;
+		uvs = flatShadedUvs;
+	}
+
+	public Mesh CreateMesh() {
+		Mesh mesh = new Mesh ();
+		mesh.vertices = vertices;
+		mesh.triangles = triangles;
+		mesh.uv = uvs;
+		if (useFlatShading) {
+			mesh.RecalculateNormals ();
+		} else {
+			mesh.normals = bakedNormals;
+		}
+		return mesh;
+	}
+
+}

+ 12 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/MeshGenerator.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 7939d15f4beb24a65bc949a0e3c02d5e
+timeCreated: 1455965849
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 79 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/Noise.cs

@@ -0,0 +1,79 @@
+using UnityEngine;
+using System.Collections;
+
+public static class Noise {
+
+	public enum NormalizeMode {Local, Global};
+
+	public static float[,] GenerateNoiseMap(int mapWidth, int mapHeight, int seed, float scale, int octaves, float persistance, float lacunarity, Vector2 offset, NormalizeMode normalizeMode) {
+		float[,] noiseMap = new float[mapWidth,mapHeight];
+
+		System.Random prng = new System.Random (seed);
+		Vector2[] octaveOffsets = new Vector2[octaves];
+
+		float maxPossibleHeight = 0;
+		float amplitude = 1;
+		float frequency = 1;
+
+		for (int i = 0; i < octaves; i++) {
+			float offsetX = prng.Next (-100000, 100000) + offset.x;
+			float offsetY = prng.Next (-100000, 100000) - offset.y;
+			octaveOffsets [i] = new Vector2 (offsetX, offsetY);
+
+			maxPossibleHeight += amplitude;
+			amplitude *= persistance;
+		}
+
+		if (scale <= 0) {
+			scale = 0.0001f;
+		}
+
+		float maxLocalNoiseHeight = float.MinValue;
+		float minLocalNoiseHeight = float.MaxValue;
+
+		float halfWidth = mapWidth / 2f;
+		float halfHeight = mapHeight / 2f;
+
+
+		for (int y = 0; y < mapHeight; y++) {
+			for (int x = 0; x < mapWidth; x++) {
+
+				amplitude = 1;
+				frequency = 1;
+				float noiseHeight = 0;
+
+				for (int i = 0; i < octaves; i++) {
+					float sampleX = (x-halfWidth + octaveOffsets[i].x) / scale * frequency;
+					float sampleY = (y-halfHeight + octaveOffsets[i].y) / scale * frequency;
+
+					float perlinValue = Mathf.PerlinNoise (sampleX, sampleY) * 2 - 1;
+					noiseHeight += perlinValue * amplitude;
+
+					amplitude *= persistance;
+					frequency *= lacunarity;
+				}
+
+				if (noiseHeight > maxLocalNoiseHeight) {
+					maxLocalNoiseHeight = noiseHeight;
+				} else if (noiseHeight < minLocalNoiseHeight) {
+					minLocalNoiseHeight = noiseHeight;
+				}
+				noiseMap [x, y] = noiseHeight;
+			}
+		}
+
+		for (int y = 0; y < mapHeight; y++) {
+			for (int x = 0; x < mapWidth; x++) {
+				if (normalizeMode == NormalizeMode.Local) {
+					noiseMap [x, y] = Mathf.InverseLerp (minLocalNoiseHeight, maxLocalNoiseHeight, noiseMap [x, y]);
+				} else {
+					float normalizedHeight = (noiseMap [x, y] + 1) / (maxPossibleHeight/0.9f);
+					noiseMap [x, y] = Mathf.Clamp(normalizedHeight,0, int.MaxValue);
+				}
+			}
+		}
+
+		return noiseMap;
+	}
+
+}

+ 12 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/Noise.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d4ed0d0ddb42c4af290db1cea4b1264f
+timeCreated: 1454753270
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 30 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/TextureGenerator.cs

@@ -0,0 +1,30 @@
+using UnityEngine;
+using System.Collections;
+
+public static class TextureGenerator {
+
+	public static Texture2D TextureFromColourMap(Color[] colourMap, int width, int height) {
+		Texture2D texture = new Texture2D (width, height);
+		texture.filterMode = FilterMode.Point;
+		texture.wrapMode = TextureWrapMode.Clamp;
+		texture.SetPixels (colourMap);
+		texture.Apply ();
+		return texture;
+	}
+
+
+	public static Texture2D TextureFromHeightMap(float[,] heightMap) {
+		int width = heightMap.GetLength (0);
+		int height = heightMap.GetLength (1);
+
+		Color[] colourMap = new Color[width * height];
+		for (int y = 0; y < height; y++) {
+			for (int x = 0; x < width; x++) {
+				colourMap [y * width + x] = Color.Lerp (Color.black, Color.white, heightMap [x, y]);
+			}
+		}
+
+		return TextureFromColourMap (colourMap, width, height);
+	}
+
+}

+ 12 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Scripts/MapGen/TextureGenerator.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: df7acc444474841759c3b95c7ef6d1c3
+timeCreated: 1455354562
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
GAMEN3-ValleyRunner_SanTi036/Assets/Skybox.mat

@@ -112,7 +112,7 @@ Material:
     - _DstBlend: 0
     - _DstBlendAlpha: 0
     - _EnvironmentReflections: 1
-    - _Exposure: 0.9816964
+    - _Exposure: 0.966106
     - _GlossMapScale: 0
     - _Glossiness: 0
     - _GlossyReflections: 0

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets.meta

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

+ 6 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters.meta

@@ -0,0 +1,6 @@
+fileFormatVersion: 2
+guid: 8c32f58513a41ef4dab9cb7704c5fb92
+folderAsset: yes
+DefaultImporter:
+  userData: 
+  assetBundleName: 

+ 6 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter.meta

@@ -0,0 +1,6 @@
+fileFormatVersion: 2
+guid: 943e057eaae705e43b9e9b2e53d6adb0
+folderAsset: yes
+DefaultImporter:
+  userData: 
+  assetBundleName: 

+ 6 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs.meta

@@ -0,0 +1,6 @@
+fileFormatVersion: 2
+guid: 0bfb2599080d5d24e84362b4ae314ae7
+folderAsset: yes
+DefaultImporter:
+  userData: 
+  assetBundleName: 

+ 248 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab

@@ -0,0 +1,248 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &100004
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 400000}
+  - component: {fileID: 2000000}
+  - component: {fileID: 8100000}
+  m_Layer: 0
+  m_Name: MainCamera
+  m_TagString: MainCamera
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &400000
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 100004}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0.6, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 400002}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!20 &2000000
+Camera:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 100004}
+  m_Enabled: 1
+  serializedVersion: 2
+  m_ClearFlags: 1
+  m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
+  m_projectionMatrixMode: 1
+  m_GateFitMode: 2
+  m_FOVAxisMode: 0
+  m_Iso: 200
+  m_ShutterSpeed: 0.005
+  m_Aperture: 16
+  m_FocusDistance: 10
+  m_FocalLength: 50
+  m_BladeCount: 5
+  m_Curvature: {x: 2, y: 11}
+  m_BarrelClipping: 0.25
+  m_Anamorphism: 0
+  m_SensorSize: {x: 36, y: 24}
+  m_LensShift: {x: 0, y: 0}
+  m_NormalizedViewPortRect:
+    serializedVersion: 2
+    x: 0
+    y: 0
+    width: 1
+    height: 1
+  near clip plane: 0.3
+  far clip plane: 1000
+  field of view: 60
+  orthographic: 0
+  orthographic size: 5
+  m_Depth: 0
+  m_CullingMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_RenderingPath: -1
+  m_TargetTexture: {fileID: 0}
+  m_TargetDisplay: 0
+  m_TargetEye: 3
+  m_HDR: 0
+  m_AllowMSAA: 1
+  m_AllowDynamicResolution: 0
+  m_ForceIntoRT: 0
+  m_OcclusionCulling: 1
+  m_StereoConvergence: 10
+  m_StereoSeparation: 0.022
+--- !u!81 &8100000
+AudioListener:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 100004}
+  m_Enabled: 1
+--- !u!1 &100006
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 400002}
+  - component: {fileID: 5400000}
+  - component: {fileID: 13600000}
+  - component: {fileID: 11400004}
+  m_Layer: 0
+  m_Name: RigidBodyFPSController
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &400002
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 100006}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 1, z: 0, w: -0.00000016292068}
+  m_LocalPosition: {x: -30, y: 1, z: 25}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children:
+  - {fileID: 400000}
+  m_Father: {fileID: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!54 &5400000
+Rigidbody:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 100006}
+  serializedVersion: 4
+  m_Mass: 10
+  m_Drag: 0
+  m_AngularDrag: 0.05
+  m_CenterOfMass: {x: 0, y: 0, z: 0}
+  m_InertiaTensor: {x: 1, y: 1, z: 1}
+  m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_IncludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_ExcludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_ImplicitCom: 1
+  m_ImplicitTensor: 1
+  m_UseGravity: 1
+  m_IsKinematic: 0
+  m_Interpolate: 0
+  m_Constraints: 112
+  m_CollisionDetection: 0
+--- !u!136 &13600000
+CapsuleCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 100006}
+  m_Material: {fileID: 13400000, guid: c2815a7ab32e42c4bb42f59caacb8ec1, type: 2}
+  m_IncludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_ExcludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_LayerOverridePriority: 0
+  m_IsTrigger: 0
+  m_ProvidesContacts: 0
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Radius: 0.5
+  m_Height: 1.6
+  m_Direction: 1
+  m_Center: {x: 0, y: 0, z: 0}
+--- !u!114 &11400004
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 100006}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 81c9795a96c094f4cbde4d65546aa9b2, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  cam: {fileID: 2000000}
+  movementSettings:
+    ForwardSpeed: 8
+    BackwardSpeed: 4
+    StrafeSpeed: 4
+    RunMultiplier: 2
+    RunKey: 304
+    JumpForce: 50
+    SlopeCurveModifier:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: -90
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 0
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 0
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 90
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 0
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    CurrentTargetSpeed: 8
+  mouseLook:
+    XSensitivity: 2
+    YSensitivity: 2
+    clampVerticalRotation: 1
+    MinimumX: -45
+    MaximumX: 90
+    smooth: 1
+    smoothTime: 18
+    lockCursor: 1
+  advancedSettings:
+    groundCheckDistance: 0.1
+    stickToGroundHelperDistance: 0.6
+    slowDownRate: 20
+    airControl: 0
+    shellOffset: 0

+ 5 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Prefabs/RigidBodyFPSController.prefab.meta

@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: c6453f8e1f814744d8b94e5a6d1f9942
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 

+ 6 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts.meta

@@ -0,0 +1,6 @@
+fileFormatVersion: 2
+guid: 314f49b24dc9d5d40956a7b28c67b237
+folderAsset: yes
+DefaultImporter:
+  userData: 
+  assetBundleName: 

+ 114 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs

@@ -0,0 +1,114 @@
+using System;
+using UnityEngine;
+
+namespace UnityStandardAssets.Characters.FirstPerson
+{
+    [Serializable]
+    public class MouseLook
+    {
+        public float XSensitivity = 2f;
+        public float YSensitivity = 2f;
+        public bool clampVerticalRotation = true;
+        public float MinimumX = -90F;
+        public float MaximumX = 90F;
+        public bool smooth;
+        public float smoothTime = 5f;
+        public bool lockCursor = true;
+
+
+        private Quaternion m_CharacterTargetRot;
+        private Quaternion m_CameraTargetRot;
+        private bool m_cursorIsLocked = true;
+
+        public void Init(Transform character, Transform camera)
+        {
+            m_CharacterTargetRot = character.localRotation;
+            m_CameraTargetRot = camera.localRotation;
+        }
+
+
+        public void LookRotation(Transform character, Transform camera)
+        {
+			float yRot = Input.GetAxis("Mouse X") * XSensitivity;
+			float xRot = Input.GetAxis("Mouse Y") * YSensitivity;
+
+            m_CharacterTargetRot *= Quaternion.Euler (0f, yRot, 0f);
+            m_CameraTargetRot *= Quaternion.Euler (-xRot, 0f, 0f);
+
+            if(clampVerticalRotation)
+                m_CameraTargetRot = ClampRotationAroundXAxis (m_CameraTargetRot);
+
+            if(smooth)
+            {
+                character.localRotation = Quaternion.Slerp (character.localRotation, m_CharacterTargetRot,
+                    smoothTime * Time.deltaTime);
+                camera.localRotation = Quaternion.Slerp (camera.localRotation, m_CameraTargetRot,
+                    smoothTime * Time.deltaTime);
+            }
+            else
+            {
+                character.localRotation = m_CharacterTargetRot;
+                camera.localRotation = m_CameraTargetRot;
+            }
+
+            UpdateCursorLock();
+        }
+
+        public void SetCursorLock(bool value)
+        {
+            lockCursor = value;
+            if(!lockCursor)
+            {//we force unlock the cursor if the user disable the cursor locking helper
+                Cursor.lockState = CursorLockMode.None;
+                Cursor.visible = true;
+            }
+        }
+
+        public void UpdateCursorLock()
+        {
+            //if the user set "lockCursor" we check & properly lock the cursos
+            if (lockCursor)
+                InternalLockUpdate();
+        }
+
+        private void InternalLockUpdate()
+        {
+            if(Input.GetKeyUp(KeyCode.Escape))
+            {
+                m_cursorIsLocked = false;
+            }
+            else if(Input.GetMouseButtonUp(0))
+            {
+                m_cursorIsLocked = true;
+            }
+
+            if (m_cursorIsLocked)
+            {
+                Cursor.lockState = CursorLockMode.Locked;
+                Cursor.visible = false;
+            }
+            else if (!m_cursorIsLocked)
+            {
+                Cursor.lockState = CursorLockMode.None;
+                Cursor.visible = true;
+            }
+        }
+
+        Quaternion ClampRotationAroundXAxis(Quaternion q)
+        {
+            q.x /= q.w;
+            q.y /= q.w;
+            q.z /= q.w;
+            q.w = 1.0f;
+
+            float angleX = 2.0f * Mathf.Rad2Deg * Mathf.Atan (q.x);
+
+            angleX = Mathf.Clamp (angleX, MinimumX, MaximumX);
+
+            q.x = Mathf.Tan (0.5f * Mathf.Deg2Rad * angleX);
+
+            return q;
+        }
+
+    }
+}

+ 9 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/MouseLook.cs.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 37e60a97f2c87ae41b6cdc1055d78cb9
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 

+ 269 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/RigidbodyFirstPersonController.cs

@@ -0,0 +1,269 @@
+using System;
+using UnityEngine;
+
+namespace UnityStandardAssets.Characters.FirstPerson
+{
+    [RequireComponent(typeof (Rigidbody))]
+    [RequireComponent(typeof (CapsuleCollider))]
+    public class RigidbodyFirstPersonController : MonoBehaviour
+    {
+        [Serializable]
+        public class MovementSettings
+        {
+            public float ForwardSpeed = 8.0f;   // Speed when walking forward
+            public float BackwardSpeed = 4.0f;  // Speed when walking backwards
+            public float StrafeSpeed = 4.0f;    // Speed when walking sideways
+            public float RunMultiplier = 2.0f;   // Speed when sprinting
+	        public KeyCode RunKey = KeyCode.LeftShift;
+            public float JumpForce = 30f;
+            public AnimationCurve SlopeCurveModifier = new AnimationCurve(new Keyframe(-90.0f, 1.0f), new Keyframe(0.0f, 1.0f), new Keyframe(90.0f, 0.0f));
+            [HideInInspector] public float CurrentTargetSpeed = 8f;
+
+#if !MOBILE_INPUT
+            private bool m_Running;
+#endif
+
+            public void UpdateDesiredTargetSpeed(Vector2 input)
+            {
+	            if (input == Vector2.zero) return;
+				if (input.x > 0 || input.x < 0)
+				{
+					//strafe
+					CurrentTargetSpeed = StrafeSpeed;
+				}
+				if (input.y < 0)
+				{
+					//backwards
+					CurrentTargetSpeed = BackwardSpeed;
+				}
+				if (input.y > 0)
+				{
+					//forwards
+					//handled last as if strafing and moving forward at the same time forwards speed should take precedence
+					CurrentTargetSpeed = ForwardSpeed;
+				}
+#if !MOBILE_INPUT
+	            if (Input.GetKey(RunKey))
+	            {
+		            CurrentTargetSpeed *= RunMultiplier;
+		            m_Running = true;
+	            }
+	            else
+	            {
+		            m_Running = false;
+	            }
+#endif
+            }
+
+#if !MOBILE_INPUT
+            public bool Running
+            {
+                get { return m_Running; }
+            }
+#endif
+        }
+
+
+        [Serializable]
+        public class AdvancedSettings
+        {
+            public float groundCheckDistance = 0.01f; // distance for checking if the controller is grounded ( 0.01f seems to work best for this )
+            public float stickToGroundHelperDistance = 0.5f; // stops the character
+            public float slowDownRate = 20f; // rate at which the controller comes to a stop when there is no input
+            public bool airControl; // can the user control the direction that is being moved in the air
+            [Tooltip("set it to 0.1 or more if you get stuck in wall")]
+            public float shellOffset; //reduce the radius by that ratio to avoid getting stuck in wall (a value of 0.1f is nice)
+        }
+
+
+        public Camera cam;
+        public MovementSettings movementSettings = new MovementSettings();
+        public MouseLook mouseLook = new MouseLook();
+        public AdvancedSettings advancedSettings = new AdvancedSettings();
+
+
+        private Rigidbody m_RigidBody;
+        private CapsuleCollider m_Capsule;
+        private float m_YRotation;
+        private Vector3 m_GroundContactNormal;
+        private bool m_Jump, m_PreviouslyGrounded, m_Jumping, m_IsGrounded;
+
+
+        public Vector3 Velocity
+        {
+            get { return m_RigidBody.linearVelocity; }
+        }
+
+        public bool Grounded
+        {
+            get { return m_IsGrounded; }
+        }
+
+        public bool Jumping
+        {
+            get { return m_Jumping; }
+        }
+
+        public bool Running
+        {
+            get
+            {
+ #if !MOBILE_INPUT
+				return movementSettings.Running;
+#else
+	            return false;
+#endif
+            }
+        }
+
+
+        private void Start()
+        {
+            m_RigidBody = GetComponent<Rigidbody>();
+            m_Capsule = GetComponent<CapsuleCollider>();
+            mouseLook.Init (transform, cam.transform);
+        }
+
+
+        private void Update()
+        {
+
+			if (Input.GetKeyDown (KeyCode.Escape)) {
+				Debug.Break ();
+			}
+
+            RotateView();
+
+			if (Input.GetButtonDown("Jump") && !m_Jump)
+            {
+                m_Jump = true;
+            }
+        }
+
+
+        private void FixedUpdate()
+        {
+            GroundCheck();
+            Vector2 input = GetInput();
+
+            if ((Mathf.Abs(input.x) > float.Epsilon || Mathf.Abs(input.y) > float.Epsilon) && (advancedSettings.airControl || m_IsGrounded))
+            {
+                // always move along the camera forward as it is the direction that it being aimed at
+                Vector3 desiredMove = cam.transform.forward*input.y + cam.transform.right*input.x;
+                desiredMove = Vector3.ProjectOnPlane(desiredMove, m_GroundContactNormal).normalized;
+
+                desiredMove.x = desiredMove.x*movementSettings.CurrentTargetSpeed;
+                desiredMove.z = desiredMove.z*movementSettings.CurrentTargetSpeed;
+                desiredMove.y = desiredMove.y*movementSettings.CurrentTargetSpeed;
+                if (m_RigidBody.linearVelocity.sqrMagnitude <
+                    (movementSettings.CurrentTargetSpeed*movementSettings.CurrentTargetSpeed))
+                {
+                    m_RigidBody.AddForce(desiredMove*SlopeMultiplier(), ForceMode.Impulse);
+                }
+            }
+
+            if (m_IsGrounded)
+            {
+                m_RigidBody.linearDamping = 5f;
+
+                if (m_Jump)
+                {
+                    m_RigidBody.linearDamping = 0f;
+                    m_RigidBody.linearVelocity = new Vector3(m_RigidBody.linearVelocity.x, 0f, m_RigidBody.linearVelocity.z);
+                    m_RigidBody.AddForce(new Vector3(0f, movementSettings.JumpForce, 0f), ForceMode.Impulse);
+                    m_Jumping = true;
+                }
+
+                if (!m_Jumping && Mathf.Abs(input.x) < float.Epsilon && Mathf.Abs(input.y) < float.Epsilon && m_RigidBody.linearVelocity.magnitude < 1f)
+                {
+                    m_RigidBody.Sleep();
+                }
+            }
+            else
+            {
+                m_RigidBody.linearDamping = 0f;
+                if (m_PreviouslyGrounded && !m_Jumping)
+                {
+                    StickToGroundHelper();
+                }
+            }
+            m_Jump = false;
+        }
+
+
+        private float SlopeMultiplier()
+        {
+            float angle = Vector3.Angle(m_GroundContactNormal, Vector3.up);
+            return movementSettings.SlopeCurveModifier.Evaluate(angle);
+        }
+
+
+        private void StickToGroundHelper()
+        {
+            RaycastHit hitInfo;
+            if (Physics.SphereCast(transform.position, m_Capsule.radius * (1.0f - advancedSettings.shellOffset), Vector3.down, out hitInfo,
+                                   ((m_Capsule.height/2f) - m_Capsule.radius) +
+                                   advancedSettings.stickToGroundHelperDistance, ~0, QueryTriggerInteraction.Ignore))
+            {
+                if (Mathf.Abs(Vector3.Angle(hitInfo.normal, Vector3.up)) < 85f)
+                {
+                    m_RigidBody.linearVelocity = Vector3.ProjectOnPlane(m_RigidBody.linearVelocity, hitInfo.normal);
+                }
+            }
+        }
+
+
+        private Vector2 GetInput()
+        {
+            
+            Vector2 input = new Vector2
+                {
+				x = Input.GetAxis("Horizontal"),
+				y = Input.GetAxis("Vertical")
+                };
+			movementSettings.UpdateDesiredTargetSpeed(input);
+            return input;
+        }
+
+
+        private void RotateView()
+        {
+            //avoids the mouse looking if the game is effectively paused
+            if (Mathf.Abs(Time.timeScale) < float.Epsilon) return;
+
+            // get the rotation before it's changed
+            float oldYRotation = transform.eulerAngles.y;
+
+            mouseLook.LookRotation (transform, cam.transform);
+
+            if (m_IsGrounded || advancedSettings.airControl)
+            {
+                // Rotate the rigidbody velocity to match the new direction that the character is looking
+                Quaternion velRotation = Quaternion.AngleAxis(transform.eulerAngles.y - oldYRotation, Vector3.up);
+                m_RigidBody.linearVelocity = velRotation*m_RigidBody.linearVelocity;
+            }
+        }
+
+        /// sphere cast down just beyond the bottom of the capsule to see if the capsule is colliding round the bottom
+        private void GroundCheck()
+        {
+            m_PreviouslyGrounded = m_IsGrounded;
+            RaycastHit hitInfo;
+            if (Physics.SphereCast(transform.position, m_Capsule.radius * (1.0f - advancedSettings.shellOffset), Vector3.down, out hitInfo,
+                                   ((m_Capsule.height/2f) - m_Capsule.radius) + advancedSettings.groundCheckDistance, ~0, QueryTriggerInteraction.Ignore))
+            {
+                m_IsGrounded = true;
+                m_GroundContactNormal = hitInfo.normal;
+            }
+            else
+            {
+                m_IsGrounded = false;
+                m_GroundContactNormal = Vector3.up;
+            }
+            if (!m_PreviouslyGrounded && m_IsGrounded && m_Jumping)
+            {
+                m_Jumping = false;
+            }
+        }
+    }
+}

+ 9 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/Characters/FirstPersonCharacter/Scripts/RigidbodyFirstPersonController.cs.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 81c9795a96c094f4cbde4d65546aa9b2
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 

+ 9 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 5eebb5849c50a2c4ea24ded96e6f3aac
+folderAsset: yes
+timeCreated: 1427462663
+licenseType: Pro
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Bouncy.physicmaterial

@@ -0,0 +1,19 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!134 &13400000
+PhysicMaterial:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: Bouncy
+  dynamicFriction: .300000012
+  staticFriction: .300000012
+  bounciness: 1
+  frictionCombine: 0
+  bounceCombine: 3
+  frictionDirection2: {x: 0, y: 0, z: 0}
+  dynamicFriction2: 0
+  staticFriction2: 0
+--- !u!1002 &13400001
+EditorExtensionImpl:
+  serializedVersion: 6

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Bouncy.physicmaterial.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9f93f63d068b08c459038c40fce897d8
+timeCreated: 1427463081
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Ice.physicmaterial

@@ -0,0 +1,19 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!134 &13400000
+PhysicMaterial:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: Ice
+  dynamicFriction: .100000001
+  staticFriction: .100000001
+  bounciness: 0
+  frictionCombine: 2
+  bounceCombine: 2
+  frictionDirection2: {x: 0, y: 0, z: 0}
+  dynamicFriction2: 0
+  staticFriction2: 0
+--- !u!1002 &13400001
+EditorExtensionImpl:
+  serializedVersion: 6

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Ice.physicmaterial.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ba92fb44336020f40bdf294bb66bc9da
+timeCreated: 1427463081
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 16 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/MaxFriction.physicMaterial

@@ -0,0 +1,16 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!134 &13400000
+PhysicMaterial:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: MaxFriction
+  dynamicFriction: 1
+  staticFriction: 1
+  bounciness: 0
+  frictionCombine: 3
+  bounceCombine: 0
+  frictionDirection2: {x: 0, y: 0, z: 0}
+  dynamicFriction2: 0
+  staticFriction2: 0

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/MaxFriction.physicMaterial.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e52fb17f9b1e7fd48b8955f1391d3688
+timeCreated: 1427463081
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Metal.physicmaterial

@@ -0,0 +1,19 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!134 &13400000
+PhysicMaterial:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: Metal
+  dynamicFriction: .150000006
+  staticFriction: .150000006
+  bounciness: 0
+  frictionCombine: 1
+  bounceCombine: 0
+  frictionDirection2: {x: 0, y: 0, z: 0}
+  dynamicFriction2: 0
+  staticFriction2: 0
+--- !u!1002 &13400001
+EditorExtensionImpl:
+  serializedVersion: 6

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Metal.physicmaterial.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 01571ba68fb2dad46aa03094ab219579
+timeCreated: 1427463081
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Rubber.physicmaterial

@@ -0,0 +1,19 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!134 &13400000
+PhysicMaterial:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: Rubber
+  dynamicFriction: 1
+  staticFriction: 1
+  bounciness: .5
+  frictionCombine: 3
+  bounceCombine: 0
+  frictionDirection2: {x: 0, y: 0, z: 0}
+  dynamicFriction2: 0
+  staticFriction2: 0
+--- !u!1002 &13400001
+EditorExtensionImpl:
+  serializedVersion: 6

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Rubber.physicmaterial.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 52baaeb214519f347a35cf0edfd262ff
+timeCreated: 1427463081
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Wood.physicmaterial

@@ -0,0 +1,19 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!134 &13400000
+PhysicMaterial:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: Wood
+  dynamicFriction: .449999988
+  staticFriction: .449999988
+  bounciness: 0
+  frictionCombine: 0
+  bounceCombine: 0
+  frictionDirection2: {x: 0, y: 0, z: 0}
+  dynamicFriction2: 0
+  staticFriction2: 0
+--- !u!1002 &13400001
+EditorExtensionImpl:
+  serializedVersion: 6

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/Wood.physicmaterial.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3aeb7dadc0c69d54d9e5777e9d5631f1
+timeCreated: 1427463081
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 16 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/ZeroFriction.physicMaterial

@@ -0,0 +1,16 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!134 &13400000
+PhysicMaterial:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: ZeroFriction
+  dynamicFriction: 0
+  staticFriction: 0
+  bounciness: 0
+  frictionCombine: 2
+  bounceCombine: 0
+  frictionDirection2: {x: 0, y: 0, z: 0}
+  dynamicFriction2: 0
+  staticFriction2: 0

+ 8 - 0
GAMEN3-ValleyRunner_SanTi036/Assets/Standard Assets/PhysicsMaterials/ZeroFriction.physicMaterial.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c2815a7ab32e42c4bb42f59caacb8ec1
+timeCreated: 1427463081
+licenseType: Pro
+NativeFormatImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff