├── .gitattributes ├── Assets ├── Scenes │ ├── SampleScene │ │ ├── LightingData.asset │ │ ├── ReflectionProbe-0.exr │ │ ├── Lightmap-0_comp_dir.png │ │ ├── Lightmap-0_comp_light.exr │ │ ├── LightingData.asset.meta │ │ ├── Lightmap-0_comp_dir.png.meta │ │ ├── Lightmap-0_comp_light.exr.meta │ │ └── ReflectionProbe-0.exr.meta │ ├── SampleScene.unity.meta │ └── SampleScene.meta ├── Scenes.meta ├── Scripts.meta ├── Materials.meta ├── PlayerAnimations.meta ├── Materials │ ├── Red.mat.meta │ ├── NoFriction.physicMaterial.meta │ ├── NoFriction.physicMaterial │ └── Red.mat ├── PlayerAnimations │ ├── Climb.anim.meta │ ├── Idle.anim.meta │ ├── Vault.anim.meta │ ├── WallLeft.anim.meta │ ├── WallRight.anim.meta │ ├── CameraAnimation.controller.meta │ ├── Idle.anim │ ├── WallLeft.anim │ ├── WallRight.anim │ ├── Climb.anim │ ├── CameraAnimation.controller │ └── Vault.anim └── Scripts │ ├── CustomTag.cs.meta │ ├── DetectObs.cs.meta │ ├── MouseLook.cs.meta │ ├── PlayerController.cs.meta │ ├── RigidbodyFirstPersonController.cs.meta │ ├── CustomTag.cs │ ├── DetectObs.cs │ ├── MouseLook.cs │ ├── PlayerController.cs │ └── RigidbodyFirstPersonController.cs ├── README.md ├── .gitignore └── LICENSE /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Will-S-Dev/Unity-Parkour-Example/HEAD/Assets/Scenes/SampleScene/LightingData.asset -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Will-S-Dev/Unity-Parkour-Example/HEAD/Assets/Scenes/SampleScene/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene/Lightmap-0_comp_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Will-S-Dev/Unity-Parkour-Example/HEAD/Assets/Scenes/SampleScene/Lightmap-0_comp_dir.png -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene/Lightmap-0_comp_light.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Will-S-Dev/Unity-Parkour-Example/HEAD/Assets/Scenes/SampleScene/Lightmap-0_comp_light.exr -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c2e17381fc240448ae0ad2fb6e1193b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abe805bc50cc40d49ac89f8b77c9d7e7 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3dd8e84eed30b7346b5f2cd402ae5bfd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d2f383812fa87e42bac2a427666a1af 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 378466610f9e35445ba96287e898a3d5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b5373410dd0a104aa1f1e807de2f5e1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/Red.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f5a1d4cfe0a54a46a17a2e960384d6d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/Climb.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f97c9f229bd30c4bb336856a0e71c84 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/Idle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a69483f58577e14087ad2dc8f41c5e4 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/Vault.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9257cc5af641db4d820aa06c8626cff 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/WallLeft.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18264fbe44c69414ea24d85d1fcb2414 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/WallRight.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 792bff0fc8707e445952ddff2702fdef 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Materials/NoFriction.physicMaterial.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9b8843726994c64a8afa429bb1eaeb5 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/CameraAnimation.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2780438daa0db594b9231835ea10aa5e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fbb75055f3fa824698460d9f3f8358d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 112000000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/CustomTag.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 009a96eaef434ae448aac377da8b0da4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/DetectObs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc413d72204cd9848a2ec1cb5cafb1bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/MouseLook.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86796be05526f064ea377cf444f21910 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/PlayerController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab1b05793d3a93e438a16878e35ecc0c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/RigidbodyFirstPersonController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 350e8704c89103c49b231281fc573f13 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Materials/NoFriction.physicMaterial: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!134 &13400000 4 | PhysicMaterial: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: NoFriction 10 | dynamicFriction: 0 11 | staticFriction: 0 12 | bounciness: 0 13 | frictionCombine: 1 14 | bounceCombine: 1 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity-Parkour-Example 2 | A example FPS with a Parkour mechanics inspired by Mirror's Edge made in Unity written in C# 3 | 4 | ![gif](https://media.giphy.com/media/Ri7d0e0IrLKzGdE4bP/giphy.gif) 5 | 6 | How to Use 7 | ------------ 8 | -Download the Project 9 | 10 | -Open with Unity 11 | 12 | -Use WASD to move around, Space key to jump 13 | 14 | -Jump towards obstacles and ledges to vault or climb respectively 15 | 16 | -Run towards walls diagonally to wallrun 17 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | Assets/AssetStoreTools* 7 | 8 | # Visual Studio cache directory 9 | .vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | *.opendb 26 | *.VC.db 27 | 28 | # Unity3D generated meta files 29 | *.pidb.meta 30 | *.pdb.meta 31 | 32 | # Unity3D Generated File On Crash Reports 33 | sysinfo.txt 34 | 35 | # Builds 36 | *.apk 37 | *.unitypackage 38 | -------------------------------------------------------------------------------- /Assets/Scripts/CustomTag.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | public class CustomTag : MonoBehaviour 5 | { 6 | public bool IsEnabled = true; 7 | private void Start() 8 | { 9 | 10 | } 11 | 12 | [SerializeField] 13 | private List tags = new List(); 14 | 15 | public bool HasTag(string tag) 16 | { 17 | return tags.Contains(tag); 18 | } 19 | 20 | public IEnumerable GetTags() 21 | { 22 | return tags; 23 | } 24 | 25 | public void Rename(int index, string tagName) 26 | { 27 | tags[index] = tagName; 28 | } 29 | 30 | public string GetAtIndex(int index) 31 | { 32 | return tags[index]; 33 | } 34 | 35 | public int Count 36 | { 37 | get { return tags.Count; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Iria_Dev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Assets/Scripts/DetectObs.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class DetectObs : MonoBehaviour 6 | { 7 | public string ObjectTagName = ""; 8 | public bool Obstruction; 9 | public GameObject Object; 10 | private Collider colnow; 11 | void OnTriggerStay(Collider col) 12 | { 13 | if (ObjectTagName != "" && !Obstruction) 14 | { 15 | if (col.GetComponent()) 16 | { 17 | if (col.GetComponent().IsEnabled) 18 | { 19 | if (col != null && !col.isTrigger && col.GetComponent().HasTag(ObjectTagName)) // checks if the object has the right tag 20 | { 21 | Obstruction = true; 22 | Object = col.gameObject; 23 | colnow = col; 24 | } 25 | } 26 | } 27 | 28 | } 29 | 30 | 31 | if (ObjectTagName == "" && !Obstruction) 32 | { 33 | if (col != null && !col.isTrigger) 34 | { 35 | Obstruction = true; 36 | colnow = col; 37 | } 38 | 39 | } 40 | 41 | 42 | 43 | } 44 | 45 | private void Update() 46 | { 47 | 48 | if(Object == null || !colnow.enabled) 49 | { 50 | Obstruction = false; 51 | } 52 | if (Object != null) 53 | { 54 | if (!Object.activeInHierarchy) 55 | { 56 | Obstruction = false; 57 | } 58 | } 59 | } 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | void OnTriggerExit(Collider col) 68 | { 69 | if (col == colnow) 70 | { 71 | Obstruction = false; 72 | } 73 | 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene/Lightmap-0_comp_dir.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9301778833557734395351f626face5e 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 0 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 3 36 | mipBias: 0 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 2 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene/Lightmap-0_comp_light.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abe1f822722f62048a2e7d3bb883ef48 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 3 36 | mipBias: 0 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 0 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 6 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 2 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Materials/Red.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Red 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 0, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c002f247f15040a4fb5785cbe527b8f3 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 8900000: generatedCubemap 6 | externalObjects: {} 7 | serializedVersion: 9 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | streamingMipmaps: 0 26 | streamingMipmapsPriority: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 1 30 | seamlessCubemap: 1 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 2 36 | aniso: 0 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 2 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | platformSettings: 62 | - serializedVersion: 2 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 100 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | spriteSheet: 74 | serializedVersion: 2 75 | sprites: [] 76 | outline: [] 77 | physicsShape: [] 78 | bones: [] 79 | spriteID: 80 | vertices: [] 81 | indices: 82 | edges: [] 83 | weights: [] 84 | spritePackingTag: 85 | pSDRemoveMatte: 0 86 | pSDShowRemoveMatteOption: 0 87 | userData: 88 | assetBundleName: 89 | assetBundleVariant: 90 | -------------------------------------------------------------------------------- /Assets/Scripts/MouseLook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Characters.FirstPerson 5 | { 6 | [Serializable] 7 | public class MouseLook 8 | { 9 | public float XSensitivity = 2f; 10 | public float YSensitivity = 2f; 11 | public bool clampVerticalRotation = true; 12 | public float MinimumX = -90F; 13 | public float MaximumX = 90F; 14 | public bool smooth; 15 | public float smoothTime = 5f; 16 | 17 | 18 | public Quaternion m_CharacterTargetRot; 19 | public Quaternion m_CameraTargetRot; 20 | 21 | void Start() 22 | { 23 | } 24 | public void Init(Transform character, Transform camera) 25 | { 26 | m_CharacterTargetRot = character.localRotation; 27 | m_CameraTargetRot = camera.localRotation; 28 | } 29 | 30 | 31 | public void LookRotation(Transform character, Transform camera) 32 | { 33 | Cursor.lockState = CursorLockMode.Locked; 34 | 35 | float yRot = Input.GetAxis("Mouse X") * XSensitivity; 36 | float xRot = Input.GetAxis("Mouse Y") * YSensitivity; 37 | 38 | m_CharacterTargetRot *= Quaternion.Euler (0f, yRot, 0f); 39 | m_CameraTargetRot *= Quaternion.Euler (-xRot, 0f, 0f); 40 | 41 | if(clampVerticalRotation) 42 | m_CameraTargetRot = ClampRotationAroundXAxis (m_CameraTargetRot); 43 | 44 | if(smooth) 45 | { 46 | character.localRotation = Quaternion.Slerp (character.localRotation, m_CharacterTargetRot, 47 | smoothTime * Time.deltaTime); 48 | camera.localRotation = Quaternion.Slerp (camera.localRotation, m_CameraTargetRot, 49 | smoothTime * Time.deltaTime); 50 | } 51 | else 52 | { 53 | character.localRotation = m_CharacterTargetRot; 54 | camera.localRotation = m_CameraTargetRot; 55 | } 56 | } 57 | public void LookOveride(Transform character, Transform camera) 58 | { 59 | m_CharacterTargetRot = character.localRotation; 60 | m_CameraTargetRot = camera.localRotation; 61 | 62 | m_CharacterTargetRot.x = 0f; 63 | m_CharacterTargetRot.z = 0f; 64 | m_CameraTargetRot.z = 0f; 65 | m_CameraTargetRot.y = 0f; 66 | } 67 | public void CamGoBackAll(Transform character, Transform camera) 68 | { 69 | m_CameraTargetRot.x = 0f; 70 | 71 | m_CameraTargetRot.z = 0f; 72 | m_CameraTargetRot.y = 0f; 73 | camera.localRotation = m_CameraTargetRot; 74 | 75 | } 76 | public void CamGoBack(Transform character, Transform camera, float speed) 77 | { 78 | 79 | if (m_CameraTargetRot.x > 0) 80 | { 81 | m_CameraTargetRot.x -= 1f * Time.deltaTime * speed; 82 | 83 | } 84 | if (m_CameraTargetRot.x < 0) 85 | { 86 | m_CameraTargetRot.x += 1f * Time.deltaTime * speed; 87 | 88 | } 89 | 90 | if (m_CameraTargetRot.y > 0) 91 | { 92 | m_CameraTargetRot.y -= 1f * Time.deltaTime * speed; 93 | 94 | } 95 | if (m_CameraTargetRot.y < 0) 96 | { 97 | m_CameraTargetRot.y += 1f * Time.deltaTime * speed; 98 | 99 | } 100 | 101 | if (m_CameraTargetRot.z > 0) 102 | { 103 | m_CameraTargetRot.z -= 1f * Time.deltaTime * speed; 104 | 105 | } 106 | if (m_CameraTargetRot.z < 0) 107 | { 108 | m_CameraTargetRot.z += 1f * Time.deltaTime * speed; 109 | 110 | } 111 | 112 | 113 | 114 | 115 | 116 | camera.localRotation = m_CameraTargetRot; 117 | 118 | 119 | 120 | } 121 | 122 | 123 | Quaternion ClampRotationAroundXAxis(Quaternion q) 124 | { 125 | q.x /= q.w; 126 | q.y /= q.w; 127 | q.z /= q.w; 128 | q.w = 1.0f; 129 | 130 | float angleX = 2.0f * Mathf.Rad2Deg * Mathf.Atan (q.x); 131 | 132 | angleX = Mathf.Clamp (angleX, MinimumX, MaximumX); 133 | 134 | q.x = Mathf.Tan (0.5f * Mathf.Deg2Rad * angleX); 135 | 136 | return q; 137 | } 138 | 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/Idle.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: Idle 10 | serializedVersion: 6 11 | m_Legacy: 0 12 | m_Compressed: 0 13 | m_UseHighQualityCurve: 1 14 | m_RotationCurves: [] 15 | m_CompressedRotationCurves: [] 16 | m_EulerCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - serializedVersion: 3 21 | time: 0 22 | value: {x: 0, y: 0, z: 0} 23 | inSlope: {x: 0, y: 0, z: 0} 24 | outSlope: {x: 0, y: 0, z: 0} 25 | tangentMode: 0 26 | weightedMode: 0 27 | inWeight: {x: 0, y: 0.33333334, z: 0.33333334} 28 | outWeight: {x: 0, y: 0.33333334, z: 0.33333334} 29 | m_PreInfinity: 2 30 | m_PostInfinity: 2 31 | m_RotationOrder: 4 32 | path: 33 | m_PositionCurves: 34 | - curve: 35 | serializedVersion: 2 36 | m_Curve: 37 | - serializedVersion: 3 38 | time: 0 39 | value: {x: 0, y: 0, z: 0} 40 | inSlope: {x: 0, y: 0, z: 0} 41 | outSlope: {x: 0, y: 0, z: 0} 42 | tangentMode: 0 43 | weightedMode: 0 44 | inWeight: {x: 0, y: 0.33333334, z: 0.33333334} 45 | outWeight: {x: 0, y: 0.33333334, z: 0.33333334} 46 | m_PreInfinity: 2 47 | m_PostInfinity: 2 48 | m_RotationOrder: 4 49 | path: 50 | m_ScaleCurves: [] 51 | m_FloatCurves: [] 52 | m_PPtrCurves: [] 53 | m_SampleRate: 60 54 | m_WrapMode: 0 55 | m_Bounds: 56 | m_Center: {x: 0, y: 0, z: 0} 57 | m_Extent: {x: 0, y: 0, z: 0} 58 | m_ClipBindingConstant: 59 | genericBindings: 60 | - serializedVersion: 2 61 | path: 0 62 | attribute: 1 63 | script: {fileID: 0} 64 | typeID: 4 65 | customType: 0 66 | isPPtrCurve: 0 67 | - serializedVersion: 2 68 | path: 0 69 | attribute: 4 70 | script: {fileID: 0} 71 | typeID: 4 72 | customType: 4 73 | isPPtrCurve: 0 74 | pptrCurveMapping: [] 75 | m_AnimationClipSettings: 76 | serializedVersion: 2 77 | m_AdditiveReferencePoseClip: {fileID: 0} 78 | m_AdditiveReferencePoseTime: 0 79 | m_StartTime: 0 80 | m_StopTime: 0 81 | m_OrientationOffsetY: 0 82 | m_Level: 0 83 | m_CycleOffset: 0 84 | m_HasAdditiveReferencePose: 0 85 | m_LoopTime: 1 86 | m_LoopBlend: 0 87 | m_LoopBlendOrientation: 0 88 | m_LoopBlendPositionY: 0 89 | m_LoopBlendPositionXZ: 0 90 | m_KeepOriginalOrientation: 0 91 | m_KeepOriginalPositionY: 1 92 | m_KeepOriginalPositionXZ: 0 93 | m_HeightFromFeet: 0 94 | m_Mirror: 0 95 | m_EditorCurves: 96 | - curve: 97 | serializedVersion: 2 98 | m_Curve: 99 | - serializedVersion: 3 100 | time: 0 101 | value: 0 102 | inSlope: 0 103 | outSlope: 0 104 | tangentMode: 136 105 | weightedMode: 0 106 | inWeight: 0 107 | outWeight: 0 108 | m_PreInfinity: 2 109 | m_PostInfinity: 2 110 | m_RotationOrder: 4 111 | attribute: localEulerAnglesRaw.x 112 | path: 113 | classID: 4 114 | script: {fileID: 0} 115 | - curve: 116 | serializedVersion: 2 117 | m_Curve: 118 | - serializedVersion: 3 119 | time: 0 120 | value: 0 121 | inSlope: 0 122 | outSlope: 0 123 | tangentMode: 136 124 | weightedMode: 0 125 | inWeight: 0 126 | outWeight: 0 127 | m_PreInfinity: 2 128 | m_PostInfinity: 2 129 | m_RotationOrder: 4 130 | attribute: localEulerAnglesRaw.y 131 | path: 132 | classID: 4 133 | script: {fileID: 0} 134 | - curve: 135 | serializedVersion: 2 136 | m_Curve: 137 | - serializedVersion: 3 138 | time: 0 139 | value: 0 140 | inSlope: 0 141 | outSlope: 0 142 | tangentMode: 136 143 | weightedMode: 0 144 | inWeight: 0 145 | outWeight: 0 146 | m_PreInfinity: 2 147 | m_PostInfinity: 2 148 | m_RotationOrder: 4 149 | attribute: localEulerAnglesRaw.z 150 | path: 151 | classID: 4 152 | script: {fileID: 0} 153 | - curve: 154 | serializedVersion: 2 155 | m_Curve: 156 | - serializedVersion: 3 157 | time: 0 158 | value: 0 159 | inSlope: 0 160 | outSlope: 0 161 | tangentMode: 136 162 | weightedMode: 0 163 | inWeight: 0 164 | outWeight: 0 165 | m_PreInfinity: 2 166 | m_PostInfinity: 2 167 | m_RotationOrder: 4 168 | attribute: m_LocalPosition.x 169 | path: 170 | classID: 4 171 | script: {fileID: 0} 172 | - curve: 173 | serializedVersion: 2 174 | m_Curve: 175 | - serializedVersion: 3 176 | time: 0 177 | value: 0 178 | inSlope: 0 179 | outSlope: 0 180 | tangentMode: 136 181 | weightedMode: 0 182 | inWeight: 0 183 | outWeight: 0 184 | m_PreInfinity: 2 185 | m_PostInfinity: 2 186 | m_RotationOrder: 4 187 | attribute: m_LocalPosition.y 188 | path: 189 | classID: 4 190 | script: {fileID: 0} 191 | - curve: 192 | serializedVersion: 2 193 | m_Curve: 194 | - serializedVersion: 3 195 | time: 0 196 | value: 0 197 | inSlope: 0 198 | outSlope: 0 199 | tangentMode: 136 200 | weightedMode: 0 201 | inWeight: 0 202 | outWeight: 0 203 | m_PreInfinity: 2 204 | m_PostInfinity: 2 205 | m_RotationOrder: 4 206 | attribute: m_LocalPosition.z 207 | path: 208 | classID: 4 209 | script: {fileID: 0} 210 | m_EulerEditorCurves: 211 | - curve: 212 | serializedVersion: 2 213 | m_Curve: [] 214 | m_PreInfinity: 2 215 | m_PostInfinity: 2 216 | m_RotationOrder: 4 217 | attribute: m_LocalEulerAngles.x 218 | path: 219 | classID: 4 220 | script: {fileID: 0} 221 | - curve: 222 | serializedVersion: 2 223 | m_Curve: [] 224 | m_PreInfinity: 2 225 | m_PostInfinity: 2 226 | m_RotationOrder: 4 227 | attribute: m_LocalEulerAngles.y 228 | path: 229 | classID: 4 230 | script: {fileID: 0} 231 | - curve: 232 | serializedVersion: 2 233 | m_Curve: [] 234 | m_PreInfinity: 2 235 | m_PostInfinity: 2 236 | m_RotationOrder: 4 237 | attribute: m_LocalEulerAngles.z 238 | path: 239 | classID: 4 240 | script: {fileID: 0} 241 | m_HasGenericRootTransform: 1 242 | m_HasMotionFloatCurves: 0 243 | m_Events: [] 244 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/WallLeft.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: WallLeft 10 | serializedVersion: 6 11 | m_Legacy: 0 12 | m_Compressed: 0 13 | m_UseHighQualityCurve: 1 14 | m_RotationCurves: [] 15 | m_CompressedRotationCurves: [] 16 | m_EulerCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - serializedVersion: 3 21 | time: 0 22 | value: {x: 0, y: 0, z: -30} 23 | inSlope: {x: 0, y: 0, z: 0} 24 | outSlope: {x: 0, y: 0, z: 0} 25 | tangentMode: 0 26 | weightedMode: 0 27 | inWeight: {x: 0, y: 0.33333334, z: 0.33333334} 28 | outWeight: {x: 0, y: 0.33333334, z: 0.33333334} 29 | m_PreInfinity: 2 30 | m_PostInfinity: 2 31 | m_RotationOrder: 4 32 | path: 33 | m_PositionCurves: 34 | - curve: 35 | serializedVersion: 2 36 | m_Curve: 37 | - serializedVersion: 3 38 | time: 0 39 | value: {x: 0, y: 0, z: 0} 40 | inSlope: {x: 0, y: 0, z: 0} 41 | outSlope: {x: 0, y: 0, z: 0} 42 | tangentMode: 0 43 | weightedMode: 0 44 | inWeight: {x: 0, y: 0.33333334, z: 0.33333334} 45 | outWeight: {x: 0, y: 0.33333334, z: 0.33333334} 46 | m_PreInfinity: 2 47 | m_PostInfinity: 2 48 | m_RotationOrder: 4 49 | path: 50 | m_ScaleCurves: [] 51 | m_FloatCurves: [] 52 | m_PPtrCurves: [] 53 | m_SampleRate: 60 54 | m_WrapMode: 0 55 | m_Bounds: 56 | m_Center: {x: 0, y: 0, z: 0} 57 | m_Extent: {x: 0, y: 0, z: 0} 58 | m_ClipBindingConstant: 59 | genericBindings: 60 | - serializedVersion: 2 61 | path: 0 62 | attribute: 1 63 | script: {fileID: 0} 64 | typeID: 4 65 | customType: 0 66 | isPPtrCurve: 0 67 | - serializedVersion: 2 68 | path: 0 69 | attribute: 4 70 | script: {fileID: 0} 71 | typeID: 4 72 | customType: 4 73 | isPPtrCurve: 0 74 | pptrCurveMapping: [] 75 | m_AnimationClipSettings: 76 | serializedVersion: 2 77 | m_AdditiveReferencePoseClip: {fileID: 0} 78 | m_AdditiveReferencePoseTime: 0 79 | m_StartTime: 0 80 | m_StopTime: 0 81 | m_OrientationOffsetY: 0 82 | m_Level: 0 83 | m_CycleOffset: 0 84 | m_HasAdditiveReferencePose: 0 85 | m_LoopTime: 1 86 | m_LoopBlend: 0 87 | m_LoopBlendOrientation: 0 88 | m_LoopBlendPositionY: 0 89 | m_LoopBlendPositionXZ: 0 90 | m_KeepOriginalOrientation: 0 91 | m_KeepOriginalPositionY: 1 92 | m_KeepOriginalPositionXZ: 0 93 | m_HeightFromFeet: 0 94 | m_Mirror: 0 95 | m_EditorCurves: 96 | - curve: 97 | serializedVersion: 2 98 | m_Curve: 99 | - serializedVersion: 3 100 | time: 0 101 | value: 0 102 | inSlope: 0 103 | outSlope: 0 104 | tangentMode: 136 105 | weightedMode: 0 106 | inWeight: 0 107 | outWeight: 0 108 | m_PreInfinity: 2 109 | m_PostInfinity: 2 110 | m_RotationOrder: 4 111 | attribute: localEulerAnglesRaw.x 112 | path: 113 | classID: 4 114 | script: {fileID: 0} 115 | - curve: 116 | serializedVersion: 2 117 | m_Curve: 118 | - serializedVersion: 3 119 | time: 0 120 | value: 0 121 | inSlope: 0 122 | outSlope: 0 123 | tangentMode: 136 124 | weightedMode: 0 125 | inWeight: 0 126 | outWeight: 0 127 | m_PreInfinity: 2 128 | m_PostInfinity: 2 129 | m_RotationOrder: 4 130 | attribute: localEulerAnglesRaw.y 131 | path: 132 | classID: 4 133 | script: {fileID: 0} 134 | - curve: 135 | serializedVersion: 2 136 | m_Curve: 137 | - serializedVersion: 3 138 | time: 0 139 | value: -30 140 | inSlope: 0 141 | outSlope: 0 142 | tangentMode: 136 143 | weightedMode: 0 144 | inWeight: 0 145 | outWeight: 0 146 | m_PreInfinity: 2 147 | m_PostInfinity: 2 148 | m_RotationOrder: 4 149 | attribute: localEulerAnglesRaw.z 150 | path: 151 | classID: 4 152 | script: {fileID: 0} 153 | - curve: 154 | serializedVersion: 2 155 | m_Curve: 156 | - serializedVersion: 3 157 | time: 0 158 | value: 0 159 | inSlope: 0 160 | outSlope: 0 161 | tangentMode: 136 162 | weightedMode: 0 163 | inWeight: 0 164 | outWeight: 0 165 | m_PreInfinity: 2 166 | m_PostInfinity: 2 167 | m_RotationOrder: 4 168 | attribute: m_LocalPosition.x 169 | path: 170 | classID: 4 171 | script: {fileID: 0} 172 | - curve: 173 | serializedVersion: 2 174 | m_Curve: 175 | - serializedVersion: 3 176 | time: 0 177 | value: 0 178 | inSlope: 0 179 | outSlope: 0 180 | tangentMode: 136 181 | weightedMode: 0 182 | inWeight: 0 183 | outWeight: 0 184 | m_PreInfinity: 2 185 | m_PostInfinity: 2 186 | m_RotationOrder: 4 187 | attribute: m_LocalPosition.y 188 | path: 189 | classID: 4 190 | script: {fileID: 0} 191 | - curve: 192 | serializedVersion: 2 193 | m_Curve: 194 | - serializedVersion: 3 195 | time: 0 196 | value: 0 197 | inSlope: 0 198 | outSlope: 0 199 | tangentMode: 136 200 | weightedMode: 0 201 | inWeight: 0 202 | outWeight: 0 203 | m_PreInfinity: 2 204 | m_PostInfinity: 2 205 | m_RotationOrder: 4 206 | attribute: m_LocalPosition.z 207 | path: 208 | classID: 4 209 | script: {fileID: 0} 210 | m_EulerEditorCurves: 211 | - curve: 212 | serializedVersion: 2 213 | m_Curve: [] 214 | m_PreInfinity: 2 215 | m_PostInfinity: 2 216 | m_RotationOrder: 4 217 | attribute: m_LocalEulerAngles.x 218 | path: 219 | classID: 4 220 | script: {fileID: 0} 221 | - curve: 222 | serializedVersion: 2 223 | m_Curve: [] 224 | m_PreInfinity: 2 225 | m_PostInfinity: 2 226 | m_RotationOrder: 4 227 | attribute: m_LocalEulerAngles.y 228 | path: 229 | classID: 4 230 | script: {fileID: 0} 231 | - curve: 232 | serializedVersion: 2 233 | m_Curve: [] 234 | m_PreInfinity: 2 235 | m_PostInfinity: 2 236 | m_RotationOrder: 4 237 | attribute: m_LocalEulerAngles.z 238 | path: 239 | classID: 4 240 | script: {fileID: 0} 241 | m_HasGenericRootTransform: 1 242 | m_HasMotionFloatCurves: 0 243 | m_Events: [] 244 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/WallRight.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: WallRight 10 | serializedVersion: 6 11 | m_Legacy: 0 12 | m_Compressed: 0 13 | m_UseHighQualityCurve: 1 14 | m_RotationCurves: [] 15 | m_CompressedRotationCurves: [] 16 | m_EulerCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - serializedVersion: 3 21 | time: 0 22 | value: {x: 0, y: 0, z: 30} 23 | inSlope: {x: 0, y: 0, z: 0} 24 | outSlope: {x: 0, y: 0, z: 0} 25 | tangentMode: 0 26 | weightedMode: 0 27 | inWeight: {x: 0, y: 0.33333334, z: 0.33333334} 28 | outWeight: {x: 0, y: 0.33333334, z: 0.33333334} 29 | m_PreInfinity: 2 30 | m_PostInfinity: 2 31 | m_RotationOrder: 4 32 | path: 33 | m_PositionCurves: 34 | - curve: 35 | serializedVersion: 2 36 | m_Curve: 37 | - serializedVersion: 3 38 | time: 0 39 | value: {x: 0, y: 0, z: 0} 40 | inSlope: {x: 0, y: 0, z: 0} 41 | outSlope: {x: 0, y: 0, z: 0} 42 | tangentMode: 0 43 | weightedMode: 0 44 | inWeight: {x: 0, y: 0.33333334, z: 0.33333334} 45 | outWeight: {x: 0, y: 0.33333334, z: 0.33333334} 46 | m_PreInfinity: 2 47 | m_PostInfinity: 2 48 | m_RotationOrder: 4 49 | path: 50 | m_ScaleCurves: [] 51 | m_FloatCurves: [] 52 | m_PPtrCurves: [] 53 | m_SampleRate: 60 54 | m_WrapMode: 0 55 | m_Bounds: 56 | m_Center: {x: 0, y: 0, z: 0} 57 | m_Extent: {x: 0, y: 0, z: 0} 58 | m_ClipBindingConstant: 59 | genericBindings: 60 | - serializedVersion: 2 61 | path: 0 62 | attribute: 1 63 | script: {fileID: 0} 64 | typeID: 4 65 | customType: 0 66 | isPPtrCurve: 0 67 | - serializedVersion: 2 68 | path: 0 69 | attribute: 4 70 | script: {fileID: 0} 71 | typeID: 4 72 | customType: 4 73 | isPPtrCurve: 0 74 | pptrCurveMapping: [] 75 | m_AnimationClipSettings: 76 | serializedVersion: 2 77 | m_AdditiveReferencePoseClip: {fileID: 0} 78 | m_AdditiveReferencePoseTime: 0 79 | m_StartTime: 0 80 | m_StopTime: 0 81 | m_OrientationOffsetY: 0 82 | m_Level: 0 83 | m_CycleOffset: 0 84 | m_HasAdditiveReferencePose: 0 85 | m_LoopTime: 1 86 | m_LoopBlend: 0 87 | m_LoopBlendOrientation: 0 88 | m_LoopBlendPositionY: 0 89 | m_LoopBlendPositionXZ: 0 90 | m_KeepOriginalOrientation: 0 91 | m_KeepOriginalPositionY: 1 92 | m_KeepOriginalPositionXZ: 0 93 | m_HeightFromFeet: 0 94 | m_Mirror: 0 95 | m_EditorCurves: 96 | - curve: 97 | serializedVersion: 2 98 | m_Curve: 99 | - serializedVersion: 3 100 | time: 0 101 | value: 0 102 | inSlope: 0 103 | outSlope: 0 104 | tangentMode: 136 105 | weightedMode: 0 106 | inWeight: 0 107 | outWeight: 0 108 | m_PreInfinity: 2 109 | m_PostInfinity: 2 110 | m_RotationOrder: 4 111 | attribute: m_LocalPosition.x 112 | path: 113 | classID: 4 114 | script: {fileID: 0} 115 | - curve: 116 | serializedVersion: 2 117 | m_Curve: 118 | - serializedVersion: 3 119 | time: 0 120 | value: 0 121 | inSlope: 0 122 | outSlope: 0 123 | tangentMode: 136 124 | weightedMode: 0 125 | inWeight: 0 126 | outWeight: 0 127 | m_PreInfinity: 2 128 | m_PostInfinity: 2 129 | m_RotationOrder: 4 130 | attribute: m_LocalPosition.y 131 | path: 132 | classID: 4 133 | script: {fileID: 0} 134 | - curve: 135 | serializedVersion: 2 136 | m_Curve: 137 | - serializedVersion: 3 138 | time: 0 139 | value: 0 140 | inSlope: 0 141 | outSlope: 0 142 | tangentMode: 136 143 | weightedMode: 0 144 | inWeight: 0 145 | outWeight: 0 146 | m_PreInfinity: 2 147 | m_PostInfinity: 2 148 | m_RotationOrder: 4 149 | attribute: m_LocalPosition.z 150 | path: 151 | classID: 4 152 | script: {fileID: 0} 153 | - curve: 154 | serializedVersion: 2 155 | m_Curve: 156 | - serializedVersion: 3 157 | time: 0 158 | value: 0 159 | inSlope: 0 160 | outSlope: 0 161 | tangentMode: 136 162 | weightedMode: 0 163 | inWeight: 0 164 | outWeight: 0 165 | m_PreInfinity: 2 166 | m_PostInfinity: 2 167 | m_RotationOrder: 4 168 | attribute: localEulerAnglesRaw.x 169 | path: 170 | classID: 4 171 | script: {fileID: 0} 172 | - curve: 173 | serializedVersion: 2 174 | m_Curve: 175 | - serializedVersion: 3 176 | time: 0 177 | value: 0 178 | inSlope: 0 179 | outSlope: 0 180 | tangentMode: 136 181 | weightedMode: 0 182 | inWeight: 0 183 | outWeight: 0 184 | m_PreInfinity: 2 185 | m_PostInfinity: 2 186 | m_RotationOrder: 4 187 | attribute: localEulerAnglesRaw.y 188 | path: 189 | classID: 4 190 | script: {fileID: 0} 191 | - curve: 192 | serializedVersion: 2 193 | m_Curve: 194 | - serializedVersion: 3 195 | time: 0 196 | value: 30 197 | inSlope: 0 198 | outSlope: 0 199 | tangentMode: 136 200 | weightedMode: 0 201 | inWeight: 0 202 | outWeight: 0 203 | m_PreInfinity: 2 204 | m_PostInfinity: 2 205 | m_RotationOrder: 4 206 | attribute: localEulerAnglesRaw.z 207 | path: 208 | classID: 4 209 | script: {fileID: 0} 210 | m_EulerEditorCurves: 211 | - curve: 212 | serializedVersion: 2 213 | m_Curve: [] 214 | m_PreInfinity: 2 215 | m_PostInfinity: 2 216 | m_RotationOrder: 4 217 | attribute: m_LocalEulerAngles.x 218 | path: 219 | classID: 4 220 | script: {fileID: 0} 221 | - curve: 222 | serializedVersion: 2 223 | m_Curve: [] 224 | m_PreInfinity: 2 225 | m_PostInfinity: 2 226 | m_RotationOrder: 4 227 | attribute: m_LocalEulerAngles.y 228 | path: 229 | classID: 4 230 | script: {fileID: 0} 231 | - curve: 232 | serializedVersion: 2 233 | m_Curve: [] 234 | m_PreInfinity: 2 235 | m_PostInfinity: 2 236 | m_RotationOrder: 4 237 | attribute: m_LocalEulerAngles.z 238 | path: 239 | classID: 4 240 | script: {fileID: 0} 241 | m_HasGenericRootTransform: 1 242 | m_HasMotionFloatCurves: 0 243 | m_Events: [] 244 | -------------------------------------------------------------------------------- /Assets/Scripts/PlayerController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityStandardAssets.Characters.FirstPerson; 5 | public class PlayerController : MonoBehaviour 6 | { 7 | public float drag_grounded; 8 | public float drag_inair; 9 | 10 | public DetectObs detectVaultObject; //checks for vault object 11 | public DetectObs detectVaultObstruction; //checks if theres somthing in front of the object e.g walls that will not allow the player to vault 12 | public DetectObs detectClimbObject; //checks for climb object 13 | public DetectObs detectClimbObstruction; //checks if theres somthing in front of the object e.g walls that will not allow the player to climb 14 | 15 | 16 | public DetectObs DetectWallL; //detects for a wall on the left 17 | public DetectObs DetectWallR; //detects for a wall on the right 18 | 19 | public Animator cameraAnimator; 20 | 21 | public float WallRunUpForce; 22 | public float WallRunUpForce_DecreaseRate; 23 | 24 | private float upforce; 25 | 26 | public float WallJumpUpVelocity; 27 | public float WallJumpForwardVelocity; 28 | public float drag_wallrun; 29 | public bool WallRunning; 30 | public bool WallrunningLeft; 31 | public bool WallrunningRight; 32 | private bool canwallrun; // ensure that player can only wallrun once before needing to hit the ground again, can be modified for double wallruns 33 | 34 | public bool IsParkour; 35 | private float t_parkour; 36 | private float chosenParkourMoveTime; 37 | 38 | private bool CanVault; 39 | public float VaultTime; //how long the vault takes 40 | public Transform VaultEndPoint; 41 | 42 | private bool CanClimb; 43 | public float ClimbTime; //how long the vault takes 44 | public Transform ClimbEndPoint; 45 | 46 | private RigidbodyFirstPersonController rbfps; 47 | private Rigidbody rb; 48 | private Vector3 RecordedMoveToPosition; //the position of the vault end point in world space to move the player to 49 | private Vector3 RecordedStartPosition; // position of player right before vault 50 | // Start is called before the first frame update 51 | void Start() 52 | { 53 | rbfps = GetComponent(); 54 | rb = GetComponent(); 55 | } 56 | 57 | // Update is called once per frame 58 | void Update() 59 | { 60 | if (rbfps.Grounded) 61 | { 62 | rb.drag = drag_grounded; 63 | canwallrun = true; 64 | } 65 | else 66 | { 67 | rb.drag = drag_inair; 68 | } 69 | if(WallRunning) 70 | { 71 | rb.drag = drag_wallrun; 72 | 73 | } 74 | //vault 75 | if (detectVaultObject.Obstruction && !detectVaultObstruction.Obstruction && !CanVault && !IsParkour && !WallRunning 76 | && (Input.GetKey(KeyCode.Space) || !rbfps.Grounded) && Input.GetAxisRaw("Vertical") > 0f) 77 | // if detects a vault object and there is no wall in front then player can pressing space or in air and pressing forward 78 | { 79 | CanVault = true; 80 | } 81 | 82 | if (CanVault) 83 | { 84 | CanVault = false; // so this is only called once 85 | rb.isKinematic = true; //ensure physics do not interrupt the vault 86 | RecordedMoveToPosition = VaultEndPoint.position; 87 | RecordedStartPosition = transform.position; 88 | IsParkour = true; 89 | chosenParkourMoveTime = VaultTime; 90 | 91 | cameraAnimator.CrossFade("Vault",0.1f); 92 | } 93 | 94 | //climb 95 | if (detectClimbObject.Obstruction && !detectClimbObstruction.Obstruction && !CanClimb && !IsParkour && !WallRunning 96 | && (Input.GetKey(KeyCode.Space) || !rbfps.Grounded) && Input.GetAxisRaw("Vertical") > 0f) 97 | { 98 | CanClimb = true; 99 | } 100 | 101 | if (CanClimb) 102 | { 103 | CanClimb = false; // so this is only called once 104 | rb.isKinematic = true; //ensure physics do not interrupt the vault 105 | RecordedMoveToPosition = ClimbEndPoint.position; 106 | RecordedStartPosition = transform.position; 107 | IsParkour = true; 108 | chosenParkourMoveTime = ClimbTime; 109 | 110 | cameraAnimator.CrossFade("Climb",0.1f); 111 | } 112 | 113 | 114 | //Parkour movement 115 | if (IsParkour && t_parkour < 1f) 116 | { 117 | t_parkour += Time.deltaTime / chosenParkourMoveTime; 118 | transform.position = Vector3.Lerp(RecordedStartPosition, RecordedMoveToPosition, t_parkour); 119 | 120 | if (t_parkour >= 1f) 121 | { 122 | IsParkour = false; 123 | t_parkour = 0f; 124 | rb.isKinematic = false; 125 | 126 | } 127 | } 128 | 129 | 130 | //Wallrun 131 | if (DetectWallL.Obstruction && !rbfps.Grounded && !IsParkour && canwallrun) // if detect wall on the left and is not on the ground and not doing parkour(climb/vault) 132 | { 133 | WallrunningLeft = true; 134 | canwallrun = false; 135 | upforce = WallRunUpForce; //refer to line 186 136 | } 137 | 138 | if (DetectWallR.Obstruction && !rbfps.Grounded && !IsParkour && canwallrun) // if detect wall on thr right and is not on the ground 139 | { 140 | WallrunningRight = true; 141 | canwallrun = false; 142 | upforce = WallRunUpForce; 143 | } 144 | if (WallrunningLeft && !DetectWallL.Obstruction || Input.GetAxisRaw("Vertical") <= 0f || rbfps.relativevelocity.magnitude < 1f) // if there is no wall on the lef tor pressing forward or forward speed < 1 (refer to fpscontroller script) 145 | { 146 | WallrunningLeft = false; 147 | WallrunningRight = false; 148 | } 149 | if (WallrunningRight && !DetectWallR.Obstruction || Input.GetAxisRaw("Vertical") <= 0f || rbfps.relativevelocity.magnitude < 1f) // same as above 150 | { 151 | WallrunningLeft = false; 152 | WallrunningRight = false; 153 | } 154 | 155 | if (WallrunningLeft || WallrunningRight) 156 | { 157 | WallRunning = true; 158 | rbfps.Wallrunning = true; // this stops the playermovement (refer to fpscontroller script) 159 | } 160 | else 161 | { 162 | WallRunning = false; 163 | rbfps.Wallrunning = false; 164 | } 165 | 166 | if (WallrunningLeft) 167 | { 168 | cameraAnimator.SetBool("WallLeft", true); //Wallrun camera tilt 169 | } 170 | else 171 | { 172 | cameraAnimator.SetBool("WallLeft", false); 173 | } 174 | if (WallrunningRight) 175 | { 176 | cameraAnimator.SetBool("WallRight", true); 177 | } 178 | else 179 | { 180 | cameraAnimator.SetBool("WallRight", false); 181 | } 182 | 183 | if (WallRunning) 184 | { 185 | 186 | rb.velocity = new Vector3(rb.velocity.x, upforce ,rb.velocity.z); //set the y velocity while wallrunning 187 | upforce -= WallRunUpForce_DecreaseRate * Time.deltaTime; //so the player will have a curve like wallrun, upforce from line 136 188 | 189 | if (Input.GetKeyDown(KeyCode.Space)) 190 | { 191 | rb.velocity = transform.forward * WallJumpForwardVelocity + transform.up * WallJumpUpVelocity; //walljump 192 | WallrunningLeft = false; 193 | WallrunningRight = false; 194 | } 195 | if(rbfps.Grounded) 196 | { 197 | WallrunningLeft = false; 198 | WallrunningRight = false; 199 | } 200 | } 201 | 202 | 203 | } 204 | 205 | } 206 | -------------------------------------------------------------------------------- /Assets/Scripts/RigidbodyFirstPersonController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Characters.FirstPerson 5 | { 6 | [RequireComponent(typeof (Rigidbody))] 7 | [RequireComponent(typeof (CapsuleCollider))] 8 | public class RigidbodyFirstPersonController : MonoBehaviour 9 | { 10 | [Serializable] 11 | public class MovementSettings 12 | { 13 | public float ForwardSpeed = 8.0f; // Speed when walking forward 14 | public float BackwardSpeed = 4.0f; // Speed when walking backwards 15 | public float StrafeSpeed = 4.0f; // Speed when walking sideways 16 | public float SpeedInAir = 8.0f; // Speed when onair 17 | public float JumpForce = 30f; 18 | 19 | [HideInInspector] public float CurrentTargetSpeed = 8f; 20 | 21 | #if !MOBILE_INPUT 22 | private bool m_Running; 23 | #endif 24 | 25 | public void UpdateDesiredTargetSpeed(Vector2 input) 26 | { 27 | if (input == Vector2.zero) return; 28 | if (input.x > 0 || input.x < 0) 29 | { 30 | //strafe 31 | CurrentTargetSpeed = StrafeSpeed; 32 | } 33 | if (input.y < 0) 34 | { 35 | //backwards 36 | CurrentTargetSpeed = BackwardSpeed; 37 | } 38 | if (input.y > 0) 39 | { 40 | //forwards 41 | //handled last as if strafing and moving forward at the same time forwards speed should take precedence 42 | CurrentTargetSpeed = ForwardSpeed; 43 | } 44 | 45 | } 46 | 47 | } 48 | 49 | 50 | public bool canrotate; 51 | public Camera cam; 52 | public MovementSettings movementSettings = new MovementSettings(); 53 | public MouseLook mouseLook = new MouseLook(); 54 | public Vector3 relativevelocity; 55 | 56 | public DetectObs detectGround; 57 | 58 | 59 | public bool Wallrunning; 60 | 61 | 62 | 63 | private Rigidbody m_RigidBody; 64 | private CapsuleCollider m_Capsule; 65 | private float m_YRotation; 66 | private bool m_IsGrounded; 67 | 68 | 69 | public Vector3 Velocity 70 | { 71 | get { return m_RigidBody.velocity; } 72 | } 73 | 74 | public bool Grounded 75 | { 76 | get { return m_IsGrounded; } 77 | } 78 | 79 | 80 | 81 | 82 | private void Awake() 83 | { 84 | 85 | canrotate = true; 86 | m_RigidBody = GetComponent(); 87 | m_Capsule = GetComponent(); 88 | mouseLook.Init (transform, cam.transform); 89 | } 90 | 91 | 92 | private void Update() 93 | { 94 | relativevelocity = transform.InverseTransformDirection(m_RigidBody.velocity); 95 | if (m_IsGrounded) 96 | { 97 | 98 | if (Input.GetKeyDown(KeyCode.Space)) 99 | { 100 | NormalJump(); 101 | } 102 | 103 | } 104 | 105 | } 106 | 107 | 108 | private void LateUpdate() 109 | { 110 | if (canrotate) 111 | { 112 | RotateView(); 113 | } 114 | else 115 | { 116 | mouseLook.LookOveride(transform, cam.transform); 117 | } 118 | 119 | 120 | } 121 | public void CamGoBack(float speed) 122 | { 123 | mouseLook.CamGoBack(transform, cam.transform, speed); 124 | 125 | } 126 | public void CamGoBackAll () 127 | { 128 | mouseLook.CamGoBackAll(transform, cam.transform); 129 | 130 | } 131 | private void FixedUpdate() 132 | { 133 | GroundCheck(); 134 | Vector2 input = GetInput(); 135 | 136 | float h = input.x; 137 | float v = input.y; 138 | Vector3 inputVector = new Vector3(h, 0, v); 139 | inputVector = Vector3.ClampMagnitude(inputVector, 1); 140 | 141 | //grounded 142 | if ((Mathf.Abs(input.x) > float.Epsilon || Mathf.Abs(input.y) > float.Epsilon) && m_IsGrounded && !Wallrunning) 143 | { 144 | if (Input.GetAxisRaw("Vertical") > 0.3f) 145 | { 146 | m_RigidBody.AddRelativeForce(0, 0, Time.deltaTime * 1000f * movementSettings.ForwardSpeed * Mathf.Abs(inputVector.z)); 147 | } 148 | if (Input.GetAxisRaw("Vertical") < -0.3f) 149 | { 150 | m_RigidBody.AddRelativeForce(0, 0, Time.deltaTime * 1000f * -movementSettings.BackwardSpeed * Mathf.Abs(inputVector.z)); 151 | } 152 | if (Input.GetAxisRaw("Horizontal") > 0.5f) 153 | { 154 | m_RigidBody.AddRelativeForce(Time.deltaTime * 1000f * movementSettings.StrafeSpeed * Mathf.Abs(inputVector.x), 0, 0); 155 | } 156 | if (Input.GetAxisRaw("Horizontal") < -0.5f) 157 | { 158 | m_RigidBody.AddRelativeForce(Time.deltaTime * 1000f * -movementSettings.StrafeSpeed * Mathf.Abs(inputVector.x), 0, 0); 159 | } 160 | 161 | } 162 | //inair 163 | if ((Mathf.Abs(input.x) > float.Epsilon || Mathf.Abs(input.y) > float.Epsilon) && !m_IsGrounded && !Wallrunning) 164 | { 165 | if (Input.GetAxisRaw("Vertical") > 0.3f) 166 | { 167 | m_RigidBody.AddRelativeForce(0, 0, Time.deltaTime * 1000f * movementSettings.SpeedInAir * Mathf.Abs(inputVector.z)); 168 | } 169 | if (Input.GetAxisRaw("Vertical") < -0.3f) 170 | { 171 | m_RigidBody.AddRelativeForce(0, 0, Time.deltaTime * 1000f * -movementSettings.SpeedInAir * Mathf.Abs(inputVector.z)); 172 | } 173 | if (Input.GetAxisRaw("Horizontal") > 0.5f) 174 | { 175 | m_RigidBody.AddRelativeForce(Time.deltaTime * 1000f * movementSettings.SpeedInAir * Mathf.Abs(inputVector.x), 0, 0); 176 | } 177 | if (Input.GetAxisRaw("Horizontal") < -0.5f) 178 | { 179 | m_RigidBody.AddRelativeForce(Time.deltaTime * 1000f * -movementSettings.SpeedInAir * Mathf.Abs(inputVector.x), 0, 0); 180 | } 181 | 182 | } 183 | 184 | 185 | } 186 | 187 | public void NormalJump() 188 | { 189 | m_RigidBody.velocity = new Vector3(m_RigidBody.velocity.x, 0f, m_RigidBody.velocity.z); 190 | m_RigidBody.AddForce(new Vector3(0f, movementSettings.JumpForce, 0f), ForceMode.Impulse); 191 | } 192 | public void SwitchDirectionJump() 193 | { 194 | m_RigidBody.velocity = transform.forward * m_RigidBody.velocity.magnitude; 195 | m_RigidBody.AddForce(new Vector3(0f, movementSettings.JumpForce, 0f), ForceMode.Impulse); 196 | } 197 | 198 | 199 | 200 | 201 | 202 | private Vector2 GetInput() 203 | { 204 | 205 | Vector2 input = new Vector2 206 | { 207 | x = Input.GetAxisRaw("Horizontal"), 208 | y = Input.GetAxisRaw("Vertical") 209 | }; 210 | movementSettings.UpdateDesiredTargetSpeed(input); 211 | return input; 212 | } 213 | 214 | 215 | private void RotateView() 216 | { 217 | //avoids the mouse looking if the game is effectively paused 218 | if (Mathf.Abs(Time.timeScale) < float.Epsilon) return; 219 | 220 | // get the rotation before it's changed 221 | float oldYRotation = transform.eulerAngles.y; 222 | 223 | mouseLook.LookRotation (transform, cam.transform); 224 | 225 | 226 | } 227 | 228 | 229 | /// sphere cast down just beyond the bottom of the capsule to see if the capsule is colliding round the bottom 230 | private void GroundCheck() 231 | { 232 | if(detectGround.Obstruction) 233 | { 234 | m_IsGrounded = true; 235 | } 236 | else 237 | { 238 | m_IsGrounded = false; 239 | 240 | } 241 | } 242 | } 243 | } 244 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/Climb.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: Climb 10 | serializedVersion: 6 11 | m_Legacy: 0 12 | m_Compressed: 0 13 | m_UseHighQualityCurve: 1 14 | m_RotationCurves: [] 15 | m_CompressedRotationCurves: [] 16 | m_EulerCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - serializedVersion: 3 21 | time: 0 22 | value: {x: 0, y: 0, z: 0} 23 | inSlope: {x: 0, y: 0, z: 0} 24 | outSlope: {x: 0, y: 0, z: 0} 25 | tangentMode: 0 26 | weightedMode: 0 27 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 28 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 29 | - serializedVersion: 3 30 | time: 0.083333336 31 | value: {x: -8.58, y: 0, z: 0} 32 | inSlope: {x: 0, y: 0, z: 0} 33 | outSlope: {x: 0, y: 0, z: 0} 34 | tangentMode: 0 35 | weightedMode: 0 36 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 37 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 38 | - serializedVersion: 3 39 | time: 0.33333334 40 | value: {x: 55.74, y: 0, z: 0} 41 | inSlope: {x: 0, y: 0, z: 0} 42 | outSlope: {x: 0, y: 0, z: 0} 43 | tangentMode: 0 44 | weightedMode: 0 45 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 46 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 47 | - serializedVersion: 3 48 | time: 0.5833333 49 | value: {x: 0, y: 0, z: 0} 50 | inSlope: {x: 0, y: 0, z: 0} 51 | outSlope: {x: 0, y: 0, z: 0} 52 | tangentMode: 0 53 | weightedMode: 0 54 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 55 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 56 | m_PreInfinity: 2 57 | m_PostInfinity: 2 58 | m_RotationOrder: 4 59 | path: 60 | m_PositionCurves: 61 | - curve: 62 | serializedVersion: 2 63 | m_Curve: 64 | - serializedVersion: 3 65 | time: 0 66 | value: {x: 0, y: 0, z: 0} 67 | inSlope: {x: 0, y: 0, z: 0} 68 | outSlope: {x: 0, y: 0, z: 0} 69 | tangentMode: 0 70 | weightedMode: 0 71 | inWeight: {x: 0, y: 0.33333334, z: 0.33333334} 72 | outWeight: {x: 0, y: 0.33333334, z: 0.33333334} 73 | m_PreInfinity: 2 74 | m_PostInfinity: 2 75 | m_RotationOrder: 4 76 | path: 77 | m_ScaleCurves: [] 78 | m_FloatCurves: [] 79 | m_PPtrCurves: [] 80 | m_SampleRate: 60 81 | m_WrapMode: 0 82 | m_Bounds: 83 | m_Center: {x: 0, y: 0, z: 0} 84 | m_Extent: {x: 0, y: 0, z: 0} 85 | m_ClipBindingConstant: 86 | genericBindings: 87 | - serializedVersion: 2 88 | path: 0 89 | attribute: 4 90 | script: {fileID: 0} 91 | typeID: 4 92 | customType: 4 93 | isPPtrCurve: 0 94 | - serializedVersion: 2 95 | path: 0 96 | attribute: 1 97 | script: {fileID: 0} 98 | typeID: 4 99 | customType: 0 100 | isPPtrCurve: 0 101 | pptrCurveMapping: [] 102 | m_AnimationClipSettings: 103 | serializedVersion: 2 104 | m_AdditiveReferencePoseClip: {fileID: 0} 105 | m_AdditiveReferencePoseTime: 0 106 | m_StartTime: 0 107 | m_StopTime: 0.5833333 108 | m_OrientationOffsetY: 0 109 | m_Level: 0 110 | m_CycleOffset: 0 111 | m_HasAdditiveReferencePose: 0 112 | m_LoopTime: 1 113 | m_LoopBlend: 0 114 | m_LoopBlendOrientation: 0 115 | m_LoopBlendPositionY: 0 116 | m_LoopBlendPositionXZ: 0 117 | m_KeepOriginalOrientation: 0 118 | m_KeepOriginalPositionY: 1 119 | m_KeepOriginalPositionXZ: 0 120 | m_HeightFromFeet: 0 121 | m_Mirror: 0 122 | m_EditorCurves: 123 | - curve: 124 | serializedVersion: 2 125 | m_Curve: 126 | - serializedVersion: 3 127 | time: 0 128 | value: 0 129 | inSlope: 0 130 | outSlope: 0 131 | tangentMode: 136 132 | weightedMode: 0 133 | inWeight: 0 134 | outWeight: 0 135 | m_PreInfinity: 2 136 | m_PostInfinity: 2 137 | m_RotationOrder: 4 138 | attribute: m_LocalPosition.x 139 | path: 140 | classID: 4 141 | script: {fileID: 0} 142 | - curve: 143 | serializedVersion: 2 144 | m_Curve: 145 | - serializedVersion: 3 146 | time: 0 147 | value: 0 148 | inSlope: 0 149 | outSlope: 0 150 | tangentMode: 136 151 | weightedMode: 0 152 | inWeight: 0 153 | outWeight: 0 154 | m_PreInfinity: 2 155 | m_PostInfinity: 2 156 | m_RotationOrder: 4 157 | attribute: m_LocalPosition.y 158 | path: 159 | classID: 4 160 | script: {fileID: 0} 161 | - curve: 162 | serializedVersion: 2 163 | m_Curve: 164 | - serializedVersion: 3 165 | time: 0 166 | value: 0 167 | inSlope: 0 168 | outSlope: 0 169 | tangentMode: 136 170 | weightedMode: 0 171 | inWeight: 0 172 | outWeight: 0 173 | m_PreInfinity: 2 174 | m_PostInfinity: 2 175 | m_RotationOrder: 4 176 | attribute: m_LocalPosition.z 177 | path: 178 | classID: 4 179 | script: {fileID: 0} 180 | - curve: 181 | serializedVersion: 2 182 | m_Curve: 183 | - serializedVersion: 3 184 | time: 0 185 | value: 0 186 | inSlope: 0 187 | outSlope: 0 188 | tangentMode: 136 189 | weightedMode: 0 190 | inWeight: 0.33333334 191 | outWeight: 0.33333334 192 | - serializedVersion: 3 193 | time: 0.083333336 194 | value: -8.58 195 | inSlope: 0 196 | outSlope: 0 197 | tangentMode: 136 198 | weightedMode: 0 199 | inWeight: 0.33333334 200 | outWeight: 0.33333334 201 | - serializedVersion: 3 202 | time: 0.33333334 203 | value: 55.74 204 | inSlope: 0 205 | outSlope: 0 206 | tangentMode: 136 207 | weightedMode: 0 208 | inWeight: 0.33333334 209 | outWeight: 0.33333334 210 | - serializedVersion: 3 211 | time: 0.5833333 212 | value: 0 213 | inSlope: 0 214 | outSlope: 0 215 | tangentMode: 136 216 | weightedMode: 0 217 | inWeight: 0.33333334 218 | outWeight: 0.33333334 219 | m_PreInfinity: 2 220 | m_PostInfinity: 2 221 | m_RotationOrder: 4 222 | attribute: localEulerAnglesRaw.x 223 | path: 224 | classID: 4 225 | script: {fileID: 0} 226 | - curve: 227 | serializedVersion: 2 228 | m_Curve: 229 | - serializedVersion: 3 230 | time: 0 231 | value: 0 232 | inSlope: 0 233 | outSlope: 0 234 | tangentMode: 136 235 | weightedMode: 0 236 | inWeight: 0.33333334 237 | outWeight: 0.33333334 238 | - serializedVersion: 3 239 | time: 0.083333336 240 | value: 0 241 | inSlope: 0 242 | outSlope: 0 243 | tangentMode: 136 244 | weightedMode: 0 245 | inWeight: 0.33333334 246 | outWeight: 0.33333334 247 | - serializedVersion: 3 248 | time: 0.33333334 249 | value: 0 250 | inSlope: 0 251 | outSlope: 0 252 | tangentMode: 136 253 | weightedMode: 0 254 | inWeight: 0.33333334 255 | outWeight: 0.33333334 256 | - serializedVersion: 3 257 | time: 0.5833333 258 | value: 0 259 | inSlope: 0 260 | outSlope: 0 261 | tangentMode: 136 262 | weightedMode: 0 263 | inWeight: 0.33333334 264 | outWeight: 0.33333334 265 | m_PreInfinity: 2 266 | m_PostInfinity: 2 267 | m_RotationOrder: 4 268 | attribute: localEulerAnglesRaw.y 269 | path: 270 | classID: 4 271 | script: {fileID: 0} 272 | - curve: 273 | serializedVersion: 2 274 | m_Curve: 275 | - serializedVersion: 3 276 | time: 0 277 | value: 0 278 | inSlope: 0 279 | outSlope: 0 280 | tangentMode: 136 281 | weightedMode: 0 282 | inWeight: 0.33333334 283 | outWeight: 0.33333334 284 | - serializedVersion: 3 285 | time: 0.083333336 286 | value: 0 287 | inSlope: 0 288 | outSlope: 0 289 | tangentMode: 136 290 | weightedMode: 0 291 | inWeight: 0.33333334 292 | outWeight: 0.33333334 293 | - serializedVersion: 3 294 | time: 0.33333334 295 | value: 0 296 | inSlope: 0 297 | outSlope: 0 298 | tangentMode: 136 299 | weightedMode: 0 300 | inWeight: 0.33333334 301 | outWeight: 0.33333334 302 | - serializedVersion: 3 303 | time: 0.5833333 304 | value: 0 305 | inSlope: 0 306 | outSlope: 0 307 | tangentMode: 136 308 | weightedMode: 0 309 | inWeight: 0.33333334 310 | outWeight: 0.33333334 311 | m_PreInfinity: 2 312 | m_PostInfinity: 2 313 | m_RotationOrder: 4 314 | attribute: localEulerAnglesRaw.z 315 | path: 316 | classID: 4 317 | script: {fileID: 0} 318 | m_EulerEditorCurves: 319 | - curve: 320 | serializedVersion: 2 321 | m_Curve: [] 322 | m_PreInfinity: 2 323 | m_PostInfinity: 2 324 | m_RotationOrder: 4 325 | attribute: m_LocalEulerAngles.x 326 | path: 327 | classID: 4 328 | script: {fileID: 0} 329 | - curve: 330 | serializedVersion: 2 331 | m_Curve: [] 332 | m_PreInfinity: 2 333 | m_PostInfinity: 2 334 | m_RotationOrder: 4 335 | attribute: m_LocalEulerAngles.y 336 | path: 337 | classID: 4 338 | script: {fileID: 0} 339 | - curve: 340 | serializedVersion: 2 341 | m_Curve: [] 342 | m_PreInfinity: 2 343 | m_PostInfinity: 2 344 | m_RotationOrder: 4 345 | attribute: m_LocalEulerAngles.z 346 | path: 347 | classID: 4 348 | script: {fileID: 0} 349 | m_HasGenericRootTransform: 1 350 | m_HasMotionFloatCurves: 0 351 | m_Events: [] 352 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/CameraAnimation.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1102 &-6010843634705180288 4 | AnimatorState: 5 | serializedVersion: 5 6 | m_ObjectHideFlags: 1 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Climb 11 | m_Speed: 1 12 | m_CycleOffset: 0 13 | m_Transitions: 14 | - {fileID: 2664489833390406175} 15 | m_StateMachineBehaviours: [] 16 | m_Position: {x: 50, y: 50, z: 0} 17 | m_IKOnFeet: 0 18 | m_WriteDefaultValues: 1 19 | m_Mirror: 0 20 | m_SpeedParameterActive: 0 21 | m_MirrorParameterActive: 0 22 | m_CycleOffsetParameterActive: 0 23 | m_TimeParameterActive: 0 24 | m_Motion: {fileID: 7400000, guid: 4f97c9f229bd30c4bb336856a0e71c84, type: 2} 25 | m_Tag: 26 | m_SpeedParameter: 27 | m_MirrorParameter: 28 | m_CycleOffsetParameter: 29 | m_TimeParameter: 30 | --- !u!1101 &-3583018811241164908 31 | AnimatorStateTransition: 32 | m_ObjectHideFlags: 1 33 | m_CorrespondingSourceObject: {fileID: 0} 34 | m_PrefabInstance: {fileID: 0} 35 | m_PrefabAsset: {fileID: 0} 36 | m_Name: 37 | m_Conditions: 38 | - m_ConditionMode: 1 39 | m_ConditionEvent: WallRight 40 | m_EventTreshold: 0 41 | m_DstStateMachine: {fileID: 0} 42 | m_DstState: {fileID: 2259741141055119559} 43 | m_Solo: 0 44 | m_Mute: 0 45 | m_IsExit: 0 46 | serializedVersion: 3 47 | m_TransitionDuration: 0.25 48 | m_TransitionOffset: 0 49 | m_ExitTime: 0.75 50 | m_HasExitTime: 0 51 | m_HasFixedDuration: 1 52 | m_InterruptionSource: 0 53 | m_OrderedInterruption: 1 54 | m_CanTransitionToSelf: 1 55 | --- !u!1102 &-1864360831533548957 56 | AnimatorState: 57 | serializedVersion: 5 58 | m_ObjectHideFlags: 1 59 | m_CorrespondingSourceObject: {fileID: 0} 60 | m_PrefabInstance: {fileID: 0} 61 | m_PrefabAsset: {fileID: 0} 62 | m_Name: WallLeft 63 | m_Speed: 1 64 | m_CycleOffset: 0 65 | m_Transitions: 66 | - {fileID: 4265880736603089901} 67 | m_StateMachineBehaviours: [] 68 | m_Position: {x: 50, y: 50, z: 0} 69 | m_IKOnFeet: 0 70 | m_WriteDefaultValues: 1 71 | m_Mirror: 0 72 | m_SpeedParameterActive: 0 73 | m_MirrorParameterActive: 0 74 | m_CycleOffsetParameterActive: 0 75 | m_TimeParameterActive: 0 76 | m_Motion: {fileID: 7400000, guid: 18264fbe44c69414ea24d85d1fcb2414, type: 2} 77 | m_Tag: 78 | m_SpeedParameter: 79 | m_MirrorParameter: 80 | m_CycleOffsetParameter: 81 | m_TimeParameter: 82 | --- !u!91 &9100000 83 | AnimatorController: 84 | m_ObjectHideFlags: 0 85 | m_CorrespondingSourceObject: {fileID: 0} 86 | m_PrefabInstance: {fileID: 0} 87 | m_PrefabAsset: {fileID: 0} 88 | m_Name: CameraAnimation 89 | serializedVersion: 5 90 | m_AnimatorParameters: 91 | - m_Name: WallLeft 92 | m_Type: 4 93 | m_DefaultFloat: 0 94 | m_DefaultInt: 0 95 | m_DefaultBool: 0 96 | m_Controller: {fileID: 9100000} 97 | - m_Name: WallRight 98 | m_Type: 4 99 | m_DefaultFloat: 0 100 | m_DefaultInt: 0 101 | m_DefaultBool: 0 102 | m_Controller: {fileID: 9100000} 103 | m_AnimatorLayers: 104 | - serializedVersion: 5 105 | m_Name: Base Layer 106 | m_StateMachine: {fileID: 3696902346300387306} 107 | m_Mask: {fileID: 0} 108 | m_Motions: [] 109 | m_Behaviours: [] 110 | m_BlendingMode: 0 111 | m_SyncedLayerIndex: -1 112 | m_DefaultWeight: 0 113 | m_IKPass: 0 114 | m_SyncedLayerAffectsTiming: 0 115 | m_Controller: {fileID: 9100000} 116 | --- !u!1101 &1824143027639592918 117 | AnimatorStateTransition: 118 | m_ObjectHideFlags: 1 119 | m_CorrespondingSourceObject: {fileID: 0} 120 | m_PrefabInstance: {fileID: 0} 121 | m_PrefabAsset: {fileID: 0} 122 | m_Name: 123 | m_Conditions: [] 124 | m_DstStateMachine: {fileID: 0} 125 | m_DstState: {fileID: 4261554827052638842} 126 | m_Solo: 0 127 | m_Mute: 0 128 | m_IsExit: 0 129 | serializedVersion: 3 130 | m_TransitionDuration: 0.25 131 | m_TransitionOffset: 0 132 | m_ExitTime: 0.625 133 | m_HasExitTime: 1 134 | m_HasFixedDuration: 1 135 | m_InterruptionSource: 0 136 | m_OrderedInterruption: 1 137 | m_CanTransitionToSelf: 1 138 | --- !u!1102 &2259741141055119559 139 | AnimatorState: 140 | serializedVersion: 5 141 | m_ObjectHideFlags: 1 142 | m_CorrespondingSourceObject: {fileID: 0} 143 | m_PrefabInstance: {fileID: 0} 144 | m_PrefabAsset: {fileID: 0} 145 | m_Name: WallRight 146 | m_Speed: 1 147 | m_CycleOffset: 0 148 | m_Transitions: 149 | - {fileID: 8883148535437700504} 150 | m_StateMachineBehaviours: [] 151 | m_Position: {x: 50, y: 50, z: 0} 152 | m_IKOnFeet: 0 153 | m_WriteDefaultValues: 1 154 | m_Mirror: 0 155 | m_SpeedParameterActive: 0 156 | m_MirrorParameterActive: 0 157 | m_CycleOffsetParameterActive: 0 158 | m_TimeParameterActive: 0 159 | m_Motion: {fileID: 7400000, guid: 792bff0fc8707e445952ddff2702fdef, type: 2} 160 | m_Tag: 161 | m_SpeedParameter: 162 | m_MirrorParameter: 163 | m_CycleOffsetParameter: 164 | m_TimeParameter: 165 | --- !u!1101 &2664489833390406175 166 | AnimatorStateTransition: 167 | m_ObjectHideFlags: 1 168 | m_CorrespondingSourceObject: {fileID: 0} 169 | m_PrefabInstance: {fileID: 0} 170 | m_PrefabAsset: {fileID: 0} 171 | m_Name: 172 | m_Conditions: [] 173 | m_DstStateMachine: {fileID: 0} 174 | m_DstState: {fileID: 4261554827052638842} 175 | m_Solo: 0 176 | m_Mute: 0 177 | m_IsExit: 0 178 | serializedVersion: 3 179 | m_TransitionDuration: 0.25 180 | m_TransitionOffset: 0 181 | m_ExitTime: 0.57142854 182 | m_HasExitTime: 1 183 | m_HasFixedDuration: 1 184 | m_InterruptionSource: 0 185 | m_OrderedInterruption: 1 186 | m_CanTransitionToSelf: 1 187 | --- !u!1107 &3696902346300387306 188 | AnimatorStateMachine: 189 | serializedVersion: 5 190 | m_ObjectHideFlags: 1 191 | m_CorrespondingSourceObject: {fileID: 0} 192 | m_PrefabInstance: {fileID: 0} 193 | m_PrefabAsset: {fileID: 0} 194 | m_Name: Base Layer 195 | m_ChildStates: 196 | - serializedVersion: 1 197 | m_State: {fileID: 4261554827052638842} 198 | m_Position: {x: 210, y: 30, z: 0} 199 | - serializedVersion: 1 200 | m_State: {fileID: 6806071652718559421} 201 | m_Position: {x: 210, y: 120, z: 0} 202 | - serializedVersion: 1 203 | m_State: {fileID: -6010843634705180288} 204 | m_Position: {x: 210, y: -70, z: 0} 205 | - serializedVersion: 1 206 | m_State: {fileID: -1864360831533548957} 207 | m_Position: {x: 430, y: -40, z: 0} 208 | - serializedVersion: 1 209 | m_State: {fileID: 2259741141055119559} 210 | m_Position: {x: 430, y: 90, z: 0} 211 | m_ChildStateMachines: [] 212 | m_AnyStateTransitions: [] 213 | m_EntryTransitions: [] 214 | m_StateMachineTransitions: {} 215 | m_StateMachineBehaviours: [] 216 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 217 | m_EntryPosition: {x: 50, y: 120, z: 0} 218 | m_ExitPosition: {x: 800, y: 120, z: 0} 219 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 220 | m_DefaultState: {fileID: 4261554827052638842} 221 | --- !u!1102 &4261554827052638842 222 | AnimatorState: 223 | serializedVersion: 5 224 | m_ObjectHideFlags: 1 225 | m_CorrespondingSourceObject: {fileID: 0} 226 | m_PrefabInstance: {fileID: 0} 227 | m_PrefabAsset: {fileID: 0} 228 | m_Name: Idle 229 | m_Speed: 1 230 | m_CycleOffset: 0 231 | m_Transitions: 232 | - {fileID: 6036550656685274583} 233 | - {fileID: -3583018811241164908} 234 | m_StateMachineBehaviours: [] 235 | m_Position: {x: 50, y: 50, z: 0} 236 | m_IKOnFeet: 0 237 | m_WriteDefaultValues: 1 238 | m_Mirror: 0 239 | m_SpeedParameterActive: 0 240 | m_MirrorParameterActive: 0 241 | m_CycleOffsetParameterActive: 0 242 | m_TimeParameterActive: 0 243 | m_Motion: {fileID: 7400000, guid: 6a69483f58577e14087ad2dc8f41c5e4, type: 2} 244 | m_Tag: 245 | m_SpeedParameter: 246 | m_MirrorParameter: 247 | m_CycleOffsetParameter: 248 | m_TimeParameter: 249 | --- !u!1101 &4265880736603089901 250 | AnimatorStateTransition: 251 | m_ObjectHideFlags: 1 252 | m_CorrespondingSourceObject: {fileID: 0} 253 | m_PrefabInstance: {fileID: 0} 254 | m_PrefabAsset: {fileID: 0} 255 | m_Name: 256 | m_Conditions: 257 | - m_ConditionMode: 2 258 | m_ConditionEvent: WallLeft 259 | m_EventTreshold: 0 260 | m_DstStateMachine: {fileID: 0} 261 | m_DstState: {fileID: 4261554827052638842} 262 | m_Solo: 0 263 | m_Mute: 0 264 | m_IsExit: 0 265 | serializedVersion: 3 266 | m_TransitionDuration: 0.25 267 | m_TransitionOffset: 0 268 | m_ExitTime: 0.75 269 | m_HasExitTime: 0 270 | m_HasFixedDuration: 1 271 | m_InterruptionSource: 0 272 | m_OrderedInterruption: 1 273 | m_CanTransitionToSelf: 1 274 | --- !u!1101 &6036550656685274583 275 | AnimatorStateTransition: 276 | m_ObjectHideFlags: 1 277 | m_CorrespondingSourceObject: {fileID: 0} 278 | m_PrefabInstance: {fileID: 0} 279 | m_PrefabAsset: {fileID: 0} 280 | m_Name: 281 | m_Conditions: 282 | - m_ConditionMode: 1 283 | m_ConditionEvent: WallLeft 284 | m_EventTreshold: 0 285 | m_DstStateMachine: {fileID: 0} 286 | m_DstState: {fileID: -1864360831533548957} 287 | m_Solo: 0 288 | m_Mute: 0 289 | m_IsExit: 0 290 | serializedVersion: 3 291 | m_TransitionDuration: 0.25 292 | m_TransitionOffset: 0 293 | m_ExitTime: 0.75 294 | m_HasExitTime: 0 295 | m_HasFixedDuration: 1 296 | m_InterruptionSource: 0 297 | m_OrderedInterruption: 1 298 | m_CanTransitionToSelf: 1 299 | --- !u!1102 &6806071652718559421 300 | AnimatorState: 301 | serializedVersion: 5 302 | m_ObjectHideFlags: 1 303 | m_CorrespondingSourceObject: {fileID: 0} 304 | m_PrefabInstance: {fileID: 0} 305 | m_PrefabAsset: {fileID: 0} 306 | m_Name: Vault 307 | m_Speed: 1 308 | m_CycleOffset: 0 309 | m_Transitions: 310 | - {fileID: 1824143027639592918} 311 | m_StateMachineBehaviours: [] 312 | m_Position: {x: 50, y: 50, z: 0} 313 | m_IKOnFeet: 0 314 | m_WriteDefaultValues: 1 315 | m_Mirror: 0 316 | m_SpeedParameterActive: 0 317 | m_MirrorParameterActive: 0 318 | m_CycleOffsetParameterActive: 0 319 | m_TimeParameterActive: 0 320 | m_Motion: {fileID: 7400000, guid: d9257cc5af641db4d820aa06c8626cff, type: 2} 321 | m_Tag: 322 | m_SpeedParameter: 323 | m_MirrorParameter: 324 | m_CycleOffsetParameter: 325 | m_TimeParameter: 326 | --- !u!1101 &8883148535437700504 327 | AnimatorStateTransition: 328 | m_ObjectHideFlags: 1 329 | m_CorrespondingSourceObject: {fileID: 0} 330 | m_PrefabInstance: {fileID: 0} 331 | m_PrefabAsset: {fileID: 0} 332 | m_Name: 333 | m_Conditions: 334 | - m_ConditionMode: 2 335 | m_ConditionEvent: WallRight 336 | m_EventTreshold: 0 337 | m_DstStateMachine: {fileID: 0} 338 | m_DstState: {fileID: 4261554827052638842} 339 | m_Solo: 0 340 | m_Mute: 0 341 | m_IsExit: 0 342 | serializedVersion: 3 343 | m_TransitionDuration: 0.25 344 | m_TransitionOffset: 0 345 | m_ExitTime: 0.75 346 | m_HasExitTime: 0 347 | m_HasFixedDuration: 1 348 | m_InterruptionSource: 0 349 | m_OrderedInterruption: 1 350 | m_CanTransitionToSelf: 1 351 | -------------------------------------------------------------------------------- /Assets/PlayerAnimations/Vault.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: Vault 10 | serializedVersion: 6 11 | m_Legacy: 0 12 | m_Compressed: 0 13 | m_UseHighQualityCurve: 1 14 | m_RotationCurves: [] 15 | m_CompressedRotationCurves: [] 16 | m_EulerCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - serializedVersion: 3 21 | time: 0 22 | value: {x: 0, y: 0, z: 0} 23 | inSlope: {x: 0, y: 0, z: 0} 24 | outSlope: {x: 0, y: 0, z: 0} 25 | tangentMode: 0 26 | weightedMode: 0 27 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 28 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 29 | - serializedVersion: 3 30 | time: 0.25 31 | value: {x: 9.99, y: -3.7, z: 24.14} 32 | inSlope: {x: 0, y: 0, z: 0} 33 | outSlope: {x: 0, y: 0, z: 0} 34 | tangentMode: 0 35 | weightedMode: 0 36 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 37 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 38 | - serializedVersion: 3 39 | time: 0.4 40 | value: {x: -1.51, y: 0.3, z: 20.876648} 41 | inSlope: {x: 0, y: 0, z: -28.017902} 42 | outSlope: {x: 0, y: 0, z: -28.017902} 43 | tangentMode: 0 44 | weightedMode: 0 45 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 46 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 47 | - serializedVersion: 3 48 | time: 0.5833333 49 | value: {x: 4.4, y: 0.23041996, z: 14.800699} 50 | inSlope: {x: 0, y: -1.0437007, z: -78.28742} 51 | outSlope: {x: 0, y: -1.0437007, z: -78.28742} 52 | tangentMode: 0 53 | weightedMode: 0 54 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 55 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 56 | - serializedVersion: 3 57 | time: 0.6666667 58 | value: {x: 0, y: 0, z: 0} 59 | inSlope: {x: 0, y: 0, z: 0} 60 | outSlope: {x: 0, y: 0, z: 0} 61 | tangentMode: 0 62 | weightedMode: 0 63 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 64 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 65 | m_PreInfinity: 2 66 | m_PostInfinity: 2 67 | m_RotationOrder: 4 68 | path: 69 | m_PositionCurves: 70 | - curve: 71 | serializedVersion: 2 72 | m_Curve: 73 | - serializedVersion: 3 74 | time: 0 75 | value: {x: 0, y: 0, z: 0} 76 | inSlope: {x: 0, y: 0, z: 0} 77 | outSlope: {x: 0, y: 0, z: 0} 78 | tangentMode: 0 79 | weightedMode: 0 80 | inWeight: {x: 0, y: 0.33333334, z: 0.33333334} 81 | outWeight: {x: 0, y: 0.33333334, z: 0.33333334} 82 | m_PreInfinity: 2 83 | m_PostInfinity: 2 84 | m_RotationOrder: 4 85 | path: 86 | m_ScaleCurves: [] 87 | m_FloatCurves: [] 88 | m_PPtrCurves: [] 89 | m_SampleRate: 60 90 | m_WrapMode: 0 91 | m_Bounds: 92 | m_Center: {x: 0, y: 0, z: 0} 93 | m_Extent: {x: 0, y: 0, z: 0} 94 | m_ClipBindingConstant: 95 | genericBindings: 96 | - serializedVersion: 2 97 | path: 0 98 | attribute: 4 99 | script: {fileID: 0} 100 | typeID: 4 101 | customType: 4 102 | isPPtrCurve: 0 103 | - serializedVersion: 2 104 | path: 0 105 | attribute: 1 106 | script: {fileID: 0} 107 | typeID: 4 108 | customType: 0 109 | isPPtrCurve: 0 110 | pptrCurveMapping: [] 111 | m_AnimationClipSettings: 112 | serializedVersion: 2 113 | m_AdditiveReferencePoseClip: {fileID: 0} 114 | m_AdditiveReferencePoseTime: 0 115 | m_StartTime: 0 116 | m_StopTime: 0.6666667 117 | m_OrientationOffsetY: 0 118 | m_Level: 0 119 | m_CycleOffset: 0 120 | m_HasAdditiveReferencePose: 0 121 | m_LoopTime: 1 122 | m_LoopBlend: 0 123 | m_LoopBlendOrientation: 0 124 | m_LoopBlendPositionY: 0 125 | m_LoopBlendPositionXZ: 0 126 | m_KeepOriginalOrientation: 0 127 | m_KeepOriginalPositionY: 1 128 | m_KeepOriginalPositionXZ: 0 129 | m_HeightFromFeet: 0 130 | m_Mirror: 0 131 | m_EditorCurves: 132 | - curve: 133 | serializedVersion: 2 134 | m_Curve: 135 | - serializedVersion: 3 136 | time: 0 137 | value: 0 138 | inSlope: 0 139 | outSlope: 0 140 | tangentMode: 136 141 | weightedMode: 0 142 | inWeight: 0 143 | outWeight: 0 144 | m_PreInfinity: 2 145 | m_PostInfinity: 2 146 | m_RotationOrder: 4 147 | attribute: m_LocalPosition.x 148 | path: 149 | classID: 4 150 | script: {fileID: 0} 151 | - curve: 152 | serializedVersion: 2 153 | m_Curve: 154 | - serializedVersion: 3 155 | time: 0 156 | value: 0 157 | inSlope: 0 158 | outSlope: 0 159 | tangentMode: 136 160 | weightedMode: 0 161 | inWeight: 0 162 | outWeight: 0 163 | m_PreInfinity: 2 164 | m_PostInfinity: 2 165 | m_RotationOrder: 4 166 | attribute: m_LocalPosition.y 167 | path: 168 | classID: 4 169 | script: {fileID: 0} 170 | - curve: 171 | serializedVersion: 2 172 | m_Curve: 173 | - serializedVersion: 3 174 | time: 0 175 | value: 0 176 | inSlope: 0 177 | outSlope: 0 178 | tangentMode: 136 179 | weightedMode: 0 180 | inWeight: 0 181 | outWeight: 0 182 | m_PreInfinity: 2 183 | m_PostInfinity: 2 184 | m_RotationOrder: 4 185 | attribute: m_LocalPosition.z 186 | path: 187 | classID: 4 188 | script: {fileID: 0} 189 | - curve: 190 | serializedVersion: 2 191 | m_Curve: 192 | - serializedVersion: 3 193 | time: 0 194 | value: 0 195 | inSlope: 0 196 | outSlope: 0 197 | tangentMode: 136 198 | weightedMode: 0 199 | inWeight: 0.33333334 200 | outWeight: 0.33333334 201 | - serializedVersion: 3 202 | time: 0.25 203 | value: 9.99 204 | inSlope: 0 205 | outSlope: 0 206 | tangentMode: 136 207 | weightedMode: 0 208 | inWeight: 0.33333334 209 | outWeight: 0.33333334 210 | - serializedVersion: 3 211 | time: 0.4 212 | value: -1.51 213 | inSlope: 0 214 | outSlope: 0 215 | tangentMode: 136 216 | weightedMode: 0 217 | inWeight: 0.33333334 218 | outWeight: 0.33333334 219 | - serializedVersion: 3 220 | time: 0.5833333 221 | value: 4.4 222 | inSlope: 0 223 | outSlope: 0 224 | tangentMode: 136 225 | weightedMode: 0 226 | inWeight: 0.33333334 227 | outWeight: 0.33333334 228 | - serializedVersion: 3 229 | time: 0.6666667 230 | value: 0 231 | inSlope: 0 232 | outSlope: 0 233 | tangentMode: 136 234 | weightedMode: 0 235 | inWeight: 0.33333334 236 | outWeight: 0.33333334 237 | m_PreInfinity: 2 238 | m_PostInfinity: 2 239 | m_RotationOrder: 4 240 | attribute: localEulerAnglesRaw.x 241 | path: 242 | classID: 4 243 | script: {fileID: 0} 244 | - curve: 245 | serializedVersion: 2 246 | m_Curve: 247 | - serializedVersion: 3 248 | time: 0 249 | value: 0 250 | inSlope: 0 251 | outSlope: 0 252 | tangentMode: 136 253 | weightedMode: 0 254 | inWeight: 0.33333334 255 | outWeight: 0.33333334 256 | - serializedVersion: 3 257 | time: 0.25 258 | value: -3.7 259 | inSlope: 0 260 | outSlope: 0 261 | tangentMode: 136 262 | weightedMode: 0 263 | inWeight: 0.33333334 264 | outWeight: 0.33333334 265 | - serializedVersion: 3 266 | time: 0.4 267 | value: 0.3 268 | inSlope: 0 269 | outSlope: 0 270 | tangentMode: 136 271 | weightedMode: 0 272 | inWeight: 0.33333334 273 | outWeight: 0.33333334 274 | - serializedVersion: 3 275 | time: 0.5833333 276 | value: 0.23041996 277 | inSlope: -1.0437007 278 | outSlope: -1.0437007 279 | tangentMode: 136 280 | weightedMode: 0 281 | inWeight: 0.33333334 282 | outWeight: 0.33333334 283 | - serializedVersion: 3 284 | time: 0.6666667 285 | value: 0 286 | inSlope: 0 287 | outSlope: 0 288 | tangentMode: 136 289 | weightedMode: 0 290 | inWeight: 0.33333334 291 | outWeight: 0.33333334 292 | m_PreInfinity: 2 293 | m_PostInfinity: 2 294 | m_RotationOrder: 4 295 | attribute: localEulerAnglesRaw.y 296 | path: 297 | classID: 4 298 | script: {fileID: 0} 299 | - curve: 300 | serializedVersion: 2 301 | m_Curve: 302 | - serializedVersion: 3 303 | time: 0 304 | value: 0 305 | inSlope: 0 306 | outSlope: 0 307 | tangentMode: 136 308 | weightedMode: 0 309 | inWeight: 0.33333334 310 | outWeight: 0.33333334 311 | - serializedVersion: 3 312 | time: 0.25 313 | value: 24.14 314 | inSlope: 0 315 | outSlope: 0 316 | tangentMode: 136 317 | weightedMode: 0 318 | inWeight: 0.33333334 319 | outWeight: 0.33333334 320 | - serializedVersion: 3 321 | time: 0.4 322 | value: 20.876648 323 | inSlope: -28.017902 324 | outSlope: -28.017902 325 | tangentMode: 136 326 | weightedMode: 0 327 | inWeight: 0.33333334 328 | outWeight: 0.33333334 329 | - serializedVersion: 3 330 | time: 0.5833333 331 | value: 14.800699 332 | inSlope: -78.28742 333 | outSlope: -78.28742 334 | tangentMode: 136 335 | weightedMode: 0 336 | inWeight: 0.33333334 337 | outWeight: 0.33333334 338 | - serializedVersion: 3 339 | time: 0.6666667 340 | value: 0 341 | inSlope: 0 342 | outSlope: 0 343 | tangentMode: 136 344 | weightedMode: 0 345 | inWeight: 0.33333334 346 | outWeight: 0.33333334 347 | m_PreInfinity: 2 348 | m_PostInfinity: 2 349 | m_RotationOrder: 4 350 | attribute: localEulerAnglesRaw.z 351 | path: 352 | classID: 4 353 | script: {fileID: 0} 354 | m_EulerEditorCurves: 355 | - curve: 356 | serializedVersion: 2 357 | m_Curve: [] 358 | m_PreInfinity: 2 359 | m_PostInfinity: 2 360 | m_RotationOrder: 4 361 | attribute: m_LocalEulerAngles.x 362 | path: 363 | classID: 4 364 | script: {fileID: 0} 365 | - curve: 366 | serializedVersion: 2 367 | m_Curve: [] 368 | m_PreInfinity: 2 369 | m_PostInfinity: 2 370 | m_RotationOrder: 4 371 | attribute: m_LocalEulerAngles.y 372 | path: 373 | classID: 4 374 | script: {fileID: 0} 375 | - curve: 376 | serializedVersion: 2 377 | m_Curve: [] 378 | m_PreInfinity: 2 379 | m_PostInfinity: 2 380 | m_RotationOrder: 4 381 | attribute: m_LocalEulerAngles.z 382 | path: 383 | classID: 4 384 | script: {fileID: 0} 385 | m_HasGenericRootTransform: 1 386 | m_HasMotionFloatCurves: 0 387 | m_Events: [] 388 | --------------------------------------------------------------------------------