├── .gitignore ├── Assembly-CSharp-Editor-firstpass-vs.csproj ├── Assembly-CSharp-Editor-firstpass.csproj ├── Assembly-CSharp-Editor-vs.csproj ├── Assembly-CSharp-Editor.csproj ├── Assembly-CSharp-firstpass-vs.csproj ├── Assembly-CSharp-firstpass.csproj ├── Assembly-CSharp-vs.csproj ├── Assembly-CSharp.csproj ├── Assets ├── Animations.meta ├── Animations │ ├── CloudAnimator.controller │ ├── CloudAnimator.controller.meta │ ├── Idle.anim │ ├── Idle.anim.meta │ ├── Mario-Idle.anim │ ├── Mario-Idle.anim.meta │ ├── Mario-Jump.anim │ ├── Mario-Jump.anim.meta │ ├── Mario-Run.anim │ ├── Mario-Run.anim.meta │ ├── Movement.anim │ ├── Movement.anim.meta │ ├── PlayerController.controller │ └── PlayerController.controller.meta ├── Default.unity ├── Default.unity.meta ├── Done.meta ├── Done │ ├── Sprites.meta │ └── Sprites │ │ ├── CloudEnemy.png │ │ └── CloudEnemy.png.meta ├── Editor.meta ├── Editor │ ├── CrossPlatformInput.meta │ └── CrossPlatformInput │ │ ├── CrossPlatformInputInitialize.cs │ │ └── CrossPlatformInputInitialize.cs.meta ├── Plugins.meta ├── Resources.meta ├── Resources │ ├── Levels.meta │ └── Levels │ │ ├── Level1.txt │ │ ├── Level1.txt.meta │ │ ├── Level2.txt │ │ └── Level2.txt.meta ├── Scripts.meta ├── Scripts │ ├── AutoFlip.cs │ ├── AutoFlip.cs.meta │ ├── KillPlayerOnCollision.cs │ ├── KillPlayerOnCollision.cs.meta │ ├── LevelManager.cs │ ├── LevelManager.cs.meta │ ├── MarioController.cs │ ├── MarioController.cs.meta │ ├── PlatformMoveLeftRight.cs │ ├── PlatformMoveLeftRight.cs.meta │ ├── PlatformMoveUpDown.cs │ ├── PlatformMoveUpDown.cs.meta │ ├── PlayerController.cs │ ├── PlayerController.cs.meta │ ├── SmoothFollow2D.cs │ └── SmoothFollow2D.cs.meta ├── Sprites.meta ├── Sprites │ ├── 100px-Brick.png │ ├── 100px-Brick.png.meta │ ├── 50px-Brick copy.png │ ├── 50px-Brick copy.png.meta │ ├── CloudEnemy.png │ ├── CloudEnemy.png.meta │ ├── Mario.png │ ├── Mario.png.meta │ ├── Run.anim │ └── Run.anim.meta ├── Standard Assets.meta ├── Tiles.meta └── Tiles │ ├── BrickTile.prefab │ ├── BrickTile.prefab.meta │ ├── Enemy.prefab │ ├── Enemy.prefab.meta │ ├── Mario.prefab │ ├── Mario.prefab.meta │ ├── MovingLeftRightTile.prefab │ ├── MovingLeftRightTile.prefab.meta │ ├── MovingUpDownTile.prefab │ └── MovingUpDownTile.prefab.meta ├── MarioTutorial-csharp.sln ├── MarioTutorial.sln ├── MarioTutorial.userprefs ├── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset └── TimeManager.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | Assets/Plugins 2 | Assets/Standard Assets 3 | Builds 4 | Temp 5 | -------------------------------------------------------------------------------- /Assembly-CSharp-Editor-firstpass-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {690EC088-17D4-0744-2F0E-4F77D1F25882} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor-firstpass 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_1_2;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_WEBPLAYER;ENABLE_SUBSTANCE;WEBPLUG;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;CROSS_PLATFORM_INPUT 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 105 | 106 | 107 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll 108 | 109 | 110 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll 111 | 112 | 113 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll 114 | 115 | 116 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll 117 | 118 | 119 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll 120 | 121 | 122 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll 123 | 124 | 125 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll 126 | 127 | 128 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/BlackBerryPlayer/UnityEditor.BB10.Extensions.dll 129 | 130 | 131 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/TizenPlayer/TizenPlayer/UnityEditor.Tizen.Extensions.dll 132 | 133 | 134 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/STVPlayer/STVPlayer/UnityEditor.SamsungTV.Extensions.dll 135 | 136 | 137 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll 138 | 139 | 140 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll 141 | 142 | 143 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll 144 | 145 | 146 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll 147 | 148 | 149 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll 150 | 151 | 152 | 153 | 154 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890} Assembly-CSharp-firstpass-vs 155 | 156 | 157 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /Assembly-CSharp-Editor-firstpass.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {690EC088-17D4-0744-2F0E-4F77D1F25882} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor-firstpass 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_1_2;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_WEBPLAYER;ENABLE_SUBSTANCE;WEBPLUG;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;CROSS_PLATFORM_INPUT 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 105 | 106 | 107 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll 108 | 109 | 110 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll 111 | 112 | 113 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll 114 | 115 | 116 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll 117 | 118 | 119 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll 120 | 121 | 122 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll 123 | 124 | 125 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll 126 | 127 | 128 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/BlackBerryPlayer/UnityEditor.BB10.Extensions.dll 129 | 130 | 131 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/TizenPlayer/TizenPlayer/UnityEditor.Tizen.Extensions.dll 132 | 133 | 134 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/STVPlayer/STVPlayer/UnityEditor.SamsungTV.Extensions.dll 135 | 136 | 137 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll 138 | 139 | 140 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll 141 | 142 | 143 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll 144 | 145 | 146 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll 147 | 148 | 149 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll 150 | 151 | 152 | 153 | 154 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890} Assembly-CSharp-firstpass 155 | 156 | 157 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /Assembly-CSharp-Editor-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_1_2;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_WEBPLAYER;ENABLE_SUBSTANCE;WEBPLUG;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;CROSS_PLATFORM_INPUT 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 78 | 79 | 80 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll 81 | 82 | 83 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll 84 | 85 | 86 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll 87 | 88 | 89 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll 90 | 91 | 92 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll 93 | 94 | 95 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll 96 | 97 | 98 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll 99 | 100 | 101 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/BlackBerryPlayer/UnityEditor.BB10.Extensions.dll 102 | 103 | 104 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/TizenPlayer/TizenPlayer/UnityEditor.Tizen.Extensions.dll 105 | 106 | 107 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/STVPlayer/STVPlayer/UnityEditor.SamsungTV.Extensions.dll 108 | 109 | 110 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll 111 | 112 | 113 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll 114 | 115 | 116 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll 117 | 118 | 119 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll 120 | 121 | 122 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll 123 | 124 | 125 | 126 | 127 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890} Assembly-CSharp-firstpass-vs 128 | 129 | {402B272C-F835-6B14-ED34-3CFBA79D845E} Assembly-CSharp-vs 130 | 131 | {690EC088-17D4-0744-2F0E-4F77D1F25882} Assembly-CSharp-Editor-firstpass-vs 132 | 133 | 134 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /Assembly-CSharp-Editor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_1_2;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_WEBPLAYER;ENABLE_SUBSTANCE;WEBPLUG;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;CROSS_PLATFORM_INPUT 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 78 | 79 | 80 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll 81 | 82 | 83 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll 84 | 85 | 86 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll 87 | 88 | 89 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll 90 | 91 | 92 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll 93 | 94 | 95 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll 96 | 97 | 98 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll 99 | 100 | 101 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/BlackBerryPlayer/UnityEditor.BB10.Extensions.dll 102 | 103 | 104 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/TizenPlayer/TizenPlayer/UnityEditor.Tizen.Extensions.dll 105 | 106 | 107 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/STVPlayer/STVPlayer/UnityEditor.SamsungTV.Extensions.dll 108 | 109 | 110 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll 111 | 112 | 113 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll 114 | 115 | 116 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll 117 | 118 | 119 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll 120 | 121 | 122 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll 123 | 124 | 125 | 126 | 127 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890} Assembly-CSharp-firstpass 128 | 129 | {402B272C-F835-6B14-ED34-3CFBA79D845E} Assembly-CSharp 130 | 131 | {690EC088-17D4-0744-2F0E-4F77D1F25882} Assembly-CSharp-Editor-firstpass 132 | 133 | 134 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /Assembly-CSharp-firstpass-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-firstpass 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_1_2;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_WEBPLAYER;ENABLE_SUBSTANCE;WEBPLUG;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;CROSS_PLATFORM_INPUT 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 115 | 116 | 117 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll 118 | 119 | 120 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll 121 | 122 | 123 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll 124 | 125 | 126 | 127 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /Assembly-CSharp-firstpass.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-firstpass 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_1_2;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_WEBPLAYER;ENABLE_SUBSTANCE;WEBPLUG;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;CROSS_PLATFORM_INPUT 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 115 | 116 | 117 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll 118 | 119 | 120 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll 121 | 122 | 123 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll 124 | 125 | 126 | 127 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /Assembly-CSharp-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {402B272C-F835-6B14-ED34-3CFBA79D845E} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_1_2;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_WEBPLAYER;ENABLE_SUBSTANCE;WEBPLUG;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;CROSS_PLATFORM_INPUT 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 85 | 86 | 87 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll 88 | 89 | 90 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll 91 | 92 | 93 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll 94 | 95 | 96 | 97 | 98 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890} Assembly-CSharp-firstpass-vs 99 | 100 | 101 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /Assembly-CSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {402B272C-F835-6B14-ED34-3CFBA79D845E} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | Assets 16 | 17 | 18 | true 19 | full 20 | false 21 | Temp\bin\Debug\ 22 | DEBUG;TRACE;UNITY_5_1_2;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_WEBPLAYER;ENABLE_SUBSTANCE;WEBPLUG;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;CROSS_PLATFORM_INPUT 23 | prompt 24 | 4 25 | 0169 26 | 27 | 28 | pdbonly 29 | true 30 | Temp\bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 0169 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll 43 | 44 | 45 | /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll 85 | 86 | 87 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll 88 | 89 | 90 | /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll 91 | 92 | 93 | /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll 94 | 95 | 96 | 97 | 98 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890} Assembly-CSharp-firstpass 99 | 100 | 101 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /Assets/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1dc14d21a91f248eabf67ddaa28bf93f 3 | folderAsset: yes 4 | timeCreated: 1439262101 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Animations/CloudAnimator.controller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Animations/CloudAnimator.controller -------------------------------------------------------------------------------- /Assets/Animations/CloudAnimator.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3bb121d2b6a5439191b3d81cd12f751 3 | timeCreated: 1439355691 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Idle.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Animations/Idle.anim -------------------------------------------------------------------------------- /Assets/Animations/Idle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45112a03045a3480f846469af0cbda80 3 | timeCreated: 1439262193 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Mario-Idle.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Animations/Mario-Idle.anim -------------------------------------------------------------------------------- /Assets/Animations/Mario-Idle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acfb3661efec64cbbaedf9a288d0da5f 3 | timeCreated: 1439357795 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Mario-Jump.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Animations/Mario-Jump.anim -------------------------------------------------------------------------------- /Assets/Animations/Mario-Jump.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d03fe3cf2fbfb4e589c389e260ed4224 3 | timeCreated: 1439357940 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Mario-Run.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Animations/Mario-Run.anim -------------------------------------------------------------------------------- /Assets/Animations/Mario-Run.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07a3c9458f222492ba7d6c77b5d63c1d 3 | timeCreated: 1439357892 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Movement.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Animations/Movement.anim -------------------------------------------------------------------------------- /Assets/Animations/Movement.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6d21588f14f24b07913c2c5ac03eb29 3 | timeCreated: 1439355752 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/PlayerController.controller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Animations/PlayerController.controller -------------------------------------------------------------------------------- /Assets/Animations/PlayerController.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35eb7ebfec214487f835b59f06a3deca 3 | timeCreated: 1439357733 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Default.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Default.unity -------------------------------------------------------------------------------- /Assets/Default.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0f1fa604c0794b138ec47997f1d3d24 3 | timeCreated: 1439344163 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Done.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c2cb5cfd9d8f4f57bcf79017bce71dd 3 | folderAsset: yes 4 | timeCreated: 1439355038 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Done/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbbf3f9b180f047fdac5371a10f4018f 3 | folderAsset: yes 4 | timeCreated: 1439261151 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Done/Sprites/CloudEnemy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Done/Sprites/CloudEnemy.png -------------------------------------------------------------------------------- /Assets/Done/Sprites/CloudEnemy.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c45e993495dc44f2bd600fc9c505adc 3 | timeCreated: 1439354643 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 21300000: CloudEnemy_0 8 | 21300002: CloudEnemy_1 9 | 21300004: CloudEnemy_2 10 | 21300006: CloudEnemy_3 11 | 21300008: CloudEnemy_4 12 | 21300010: CloudEnemy_5 13 | 21300012: CloudEnemy_6 14 | 21300014: CloudEnemy_7 15 | 21300016: CloudEnemy_8 16 | 21300018: CloudEnemy_9 17 | serializedVersion: 2 18 | mipmaps: 19 | mipMapMode: 0 20 | enableMipMap: 0 21 | linearTexture: 0 22 | correctGamma: 0 23 | fadeOut: 0 24 | borderMipMap: 0 25 | mipMapFadeDistanceStart: 1 26 | mipMapFadeDistanceEnd: 3 27 | bumpmap: 28 | convertToNormalMap: 0 29 | externalNormalMap: 0 30 | heightScale: .25 31 | normalMapFilter: 0 32 | isReadable: 0 33 | grayScaleToAlpha: 0 34 | generateCubemap: 0 35 | cubemapConvolution: 0 36 | cubemapConvolutionSteps: 8 37 | cubemapConvolutionExponent: 1.5 38 | seamlessCubemap: 0 39 | textureFormat: -1 40 | maxTextureSize: 512 41 | textureSettings: 42 | filterMode: -1 43 | aniso: 16 44 | mipBias: -1 45 | wrapMode: 1 46 | nPOTScale: 0 47 | lightmap: 0 48 | rGBM: 0 49 | compressionQuality: 50 50 | spriteMode: 2 51 | spriteExtrude: 1 52 | spriteMeshType: 1 53 | alignment: 0 54 | spritePivot: {x: .5, y: .5} 55 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 56 | spritePixelsToUnits: 100 57 | alphaIsTransparency: 1 58 | textureType: 8 59 | buildTargetSettings: [] 60 | spriteSheet: 61 | sprites: 62 | - name: CloudEnemy_0 63 | rect: 64 | serializedVersion: 2 65 | x: 5 66 | y: 52 67 | width: 46 68 | height: 38 69 | alignment: 0 70 | pivot: {x: .5, y: .5} 71 | border: {x: 0, y: 0, z: 0, w: 0} 72 | - name: CloudEnemy_1 73 | rect: 74 | serializedVersion: 2 75 | x: 52 76 | y: 52 77 | width: 47 78 | height: 38 79 | alignment: 0 80 | pivot: {x: .5, y: .5} 81 | border: {x: 0, y: 0, z: 0, w: 0} 82 | - name: CloudEnemy_2 83 | rect: 84 | serializedVersion: 2 85 | x: 148 86 | y: 52 87 | width: 46 88 | height: 38 89 | alignment: 0 90 | pivot: {x: .5, y: .5} 91 | border: {x: 0, y: 0, z: 0, w: 0} 92 | - name: CloudEnemy_3 93 | rect: 94 | serializedVersion: 2 95 | x: 197 96 | y: 52 97 | width: 46 98 | height: 38 99 | alignment: 0 100 | pivot: {x: .5, y: .5} 101 | border: {x: 0, y: 0, z: 0, w: 0} 102 | - name: CloudEnemy_4 103 | rect: 104 | serializedVersion: 2 105 | x: 4 106 | y: 5 107 | width: 47 108 | height: 36 109 | alignment: 0 110 | pivot: {x: 0, y: 0} 111 | border: {x: 0, y: 0, z: 0, w: 0} 112 | - name: CloudEnemy_5 113 | rect: 114 | serializedVersion: 2 115 | x: 53 116 | y: 5 117 | width: 46 118 | height: 36 119 | alignment: 0 120 | pivot: {x: .5, y: .5} 121 | border: {x: 0, y: 0, z: 0, w: 0} 122 | - name: CloudEnemy_6 123 | rect: 124 | serializedVersion: 2 125 | x: 101 126 | y: 5 127 | width: 46 128 | height: 36 129 | alignment: 0 130 | pivot: {x: .5, y: .5} 131 | border: {x: 0, y: 0, z: 0, w: 0} 132 | - name: CloudEnemy_7 133 | rect: 134 | serializedVersion: 2 135 | x: 149 136 | y: 5 137 | width: 46 138 | height: 36 139 | alignment: 0 140 | pivot: {x: .5, y: .5} 141 | border: {x: 0, y: 0, z: 0, w: 0} 142 | - name: CloudEnemy_8 143 | rect: 144 | serializedVersion: 2 145 | x: 197 146 | y: 5 147 | width: 46 148 | height: 36 149 | alignment: 0 150 | pivot: {x: .5, y: .5} 151 | border: {x: 0, y: 0, z: 0, w: 0} 152 | - name: CloudEnemy_9 153 | rect: 154 | serializedVersion: 2 155 | x: 99 156 | y: 52 157 | width: 48 158 | height: 38 159 | alignment: 0 160 | pivot: {x: .5, y: .5} 161 | border: {x: 0, y: 0, z: 0, w: 0} 162 | spritePackingTag: 163 | userData: 164 | assetBundleName: 165 | assetBundleVariant: 166 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3361a9b2bb6cc4c0c9c0df1a3787c83a 3 | folderAsset: yes 4 | timeCreated: 1439260808 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/CrossPlatformInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41e4f29e5dee9ec48a2538955ef1de71 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput.Inspector 6 | { 7 | [InitializeOnLoad] 8 | public class CrossPlatformInitialize 9 | { 10 | // Custom compiler defines: 11 | // 12 | // CROSS_PLATFORM_INPUT : denotes that cross platform input package exists, so that other packages can use their CrossPlatformInput functions. 13 | // EDITOR_MOBILE_INPUT : denotes that mobile input should be used in editor, if a mobile build target is selected. (i.e. using Unity Remote app). 14 | // MOBILE_INPUT : denotes that mobile input should be used right now! 15 | 16 | static CrossPlatformInitialize() 17 | { 18 | var defines = GetDefinesList(buildTargetGroups[0]); 19 | if (!defines.Contains("CROSS_PLATFORM_INPUT")) 20 | { 21 | SetEnabled("CROSS_PLATFORM_INPUT", true, false); 22 | SetEnabled("MOBILE_INPUT", true, true); 23 | } 24 | } 25 | 26 | 27 | [MenuItem("Mobile Input/Enable")] 28 | private static void Enable() 29 | { 30 | SetEnabled("MOBILE_INPUT", true, true); 31 | switch (EditorUserBuildSettings.activeBuildTarget) 32 | { 33 | case BuildTarget.Android: 34 | case BuildTarget.iOS: 35 | case BuildTarget.WP8Player: 36 | case BuildTarget.BlackBerry: 37 | case BuildTarget.PSM: 38 | case BuildTarget.Tizen: 39 | case BuildTarget.WSAPlayer: 40 | EditorUtility.DisplayDialog("Mobile Input", 41 | "You have enabled Mobile Input. You'll need to use the Unity Remote app on a connected device to control your game in the Editor.", 42 | "OK"); 43 | break; 44 | 45 | default: 46 | EditorUtility.DisplayDialog("Mobile Input", 47 | "You have enabled Mobile Input, but you have a non-mobile build target selected in your build settings. The mobile control rigs won't be active or visible on-screen until you switch the build target to a mobile platform.", 48 | "OK"); 49 | break; 50 | } 51 | } 52 | 53 | 54 | [MenuItem("Mobile Input/Enable", true)] 55 | private static bool EnableValidate() 56 | { 57 | var defines = GetDefinesList(mobileBuildTargetGroups[0]); 58 | return !defines.Contains("MOBILE_INPUT"); 59 | } 60 | 61 | 62 | [MenuItem("Mobile Input/Disable")] 63 | private static void Disable() 64 | { 65 | SetEnabled("MOBILE_INPUT", false, true); 66 | switch (EditorUserBuildSettings.activeBuildTarget) 67 | { 68 | case BuildTarget.Android: 69 | case BuildTarget.iOS: 70 | case BuildTarget.WP8Player: 71 | case BuildTarget.BlackBerry: 72 | EditorUtility.DisplayDialog("Mobile Input", 73 | "You have disabled Mobile Input. Mobile control rigs won't be visible, and the Cross Platform Input functions will always return standalone controls.", 74 | "OK"); 75 | break; 76 | } 77 | } 78 | 79 | 80 | [MenuItem("Mobile Input/Disable", true)] 81 | private static bool DisableValidate() 82 | { 83 | var defines = GetDefinesList(mobileBuildTargetGroups[0]); 84 | return defines.Contains("MOBILE_INPUT"); 85 | } 86 | 87 | 88 | private static BuildTargetGroup[] buildTargetGroups = new BuildTargetGroup[] 89 | { 90 | BuildTargetGroup.Standalone, 91 | BuildTargetGroup.WebPlayer, 92 | BuildTargetGroup.Android, 93 | BuildTargetGroup.iOS, 94 | BuildTargetGroup.WP8, 95 | BuildTargetGroup.BlackBerry 96 | }; 97 | 98 | private static BuildTargetGroup[] mobileBuildTargetGroups = new BuildTargetGroup[] 99 | { 100 | BuildTargetGroup.Android, 101 | BuildTargetGroup.iOS, 102 | BuildTargetGroup.WP8, 103 | BuildTargetGroup.BlackBerry, 104 | BuildTargetGroup.PSM, 105 | BuildTargetGroup.Tizen, 106 | BuildTargetGroup.WSA 107 | }; 108 | 109 | 110 | private static void SetEnabled(string defineName, bool enable, bool mobile) 111 | { 112 | //Debug.Log("setting "+defineName+" to "+enable); 113 | foreach (var group in mobile ? mobileBuildTargetGroups : buildTargetGroups) 114 | { 115 | var defines = GetDefinesList(group); 116 | if (enable) 117 | { 118 | if (defines.Contains(defineName)) 119 | { 120 | return; 121 | } 122 | defines.Add(defineName); 123 | } 124 | else 125 | { 126 | if (!defines.Contains(defineName)) 127 | { 128 | return; 129 | } 130 | while (defines.Contains(defineName)) 131 | { 132 | defines.Remove(defineName); 133 | } 134 | } 135 | string definesString = string.Join(";", defines.ToArray()); 136 | PlayerSettings.SetScriptingDefineSymbolsForGroup(group, definesString); 137 | } 138 | } 139 | 140 | 141 | private static List GetDefinesList(BuildTargetGroup group) 142 | { 143 | return new List(PlayerSettings.GetScriptingDefineSymbolsForGroup(group).Split(';')); 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db7667203062c644ea1877077e30ebd6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6174bd4a3c5af432a8ca86b8bb386982 3 | folderAsset: yes 4 | timeCreated: 1439343990 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8ebe8f1eca5c45c68fad35597e0ac91 3 | folderAsset: yes 4 | timeCreated: 1439341232 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Levels.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b5044b1c97624c308cd0c87a369c532 3 | folderAsset: yes 4 | timeCreated: 1439341238 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Levels/Level1.txt: -------------------------------------------------------------------------------- 1 | .............................. 2 | ....++++++..................... 3 | .............................. 4 | .............................. 5 | .....................>>....... 6 | ............1................. 7 | ...>>......-----.............. 8 | ........................1..... 9 | .....................++++++... 10 | .............................. 11 | .........------............... 12 | .............................. 13 | .....P...1..........1......... 14 | ....-------.....------........ -------------------------------------------------------------------------------- /Assets/Resources/Levels/Level1.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01a576737ceea4a13bf66e9e5efb17f0 3 | timeCreated: 1439341388 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Levels/Level2.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 1 7 | >> ----- 8 | 1 9 | ++++++ 10 | 11 | ------ 12 | 13 | P 1 14 | ------- ------ -------------------------------------------------------------------------------- /Assets/Resources/Levels/Level2.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 117e75dceadad449191bb24f3f842865 3 | timeCreated: 1439342810 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b39c693f40f964ea8976bf1952b25336 3 | folderAsset: yes 4 | timeCreated: 1439338509 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/AutoFlip.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class AutoFlip : MonoBehaviour { 5 | 6 | float lastX; 7 | 8 | // initialise 9 | void Start() { 10 | lastX = transform.position.x; 11 | } 12 | 13 | // Update is called once per frame 14 | void Update () { 15 | 16 | // going left 17 | if (lastX > transform.position.x) { 18 | if (transform.localScale.x != 1) { 19 | transform.localScale = new Vector3(1f, 1f, 1f); 20 | } 21 | 22 | } 23 | // going right 24 | else { 25 | 26 | if (transform.localScale.x != -1) { 27 | transform.localScale = new Vector3(-1f, 1f, 1f); 28 | } 29 | } 30 | lastX = transform.position.x; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/Scripts/AutoFlip.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e7340a81dbd9454f9930f861baa3097 3 | timeCreated: 1439356338 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/KillPlayerOnCollision.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class KillPlayerOnCollision : MonoBehaviour { 5 | 6 | void OnCollisionEnter2D(Collision2D coll) { 7 | if (coll.gameObject.tag == "Player") { 8 | Application.LoadLevel(Application.loadedLevelName); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Scripts/KillPlayerOnCollision.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec61ce592df094c2d86165beac7d1856 3 | timeCreated: 1439356978 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/LevelManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityStandardAssets._2D; 5 | using System; 6 | 7 | public class LevelManager: MonoBehaviour { 8 | 9 | public enum Orientation { 10 | XY, 11 | XZ 12 | } 13 | 14 | // holds the definition of a tile 15 | [Serializable] 16 | public class Tile { 17 | // id of the tile, should be a single letter 18 | public char id; 19 | // reference to the tile 20 | public GameObject tile; 21 | } 22 | 23 | public Orientation orientation; 24 | public List tiles; 25 | public string startLevel; 26 | 27 | void Start() { 28 | if (!string.IsNullOrEmpty (startLevel)) { 29 | this.LoadWorld(startLevel); 30 | } 31 | } 32 | 33 | public void LoadWorld(string definitionFile) { 34 | // load file from the resource folder (Assets/Resources) 35 | // the file has text format 36 | var world = Resources.Load ("Levels/" + definitionFile); 37 | 38 | // the structure of the file is 39 | // 1.......2........ 40 | // ......1111......4 41 | 42 | var worldText = world.text; 43 | var worldLines = world.text.Split('\n'); 44 | 45 | // browse all lines and instantiate objects at desired positions 46 | for (var reverseRowIndex=worldLines.Length - 1; reverseRowIndex>=0; reverseRowIndex--) { 47 | var line = worldLines[reverseRowIndex]; 48 | var rowIndex = worldLines.Length - reverseRowIndex; 49 | 50 | for (var columnIndex=0; columnIndex w.id == tileId); 60 | 61 | // if tile does not exists, notify developer 62 | if (tile == null) { 63 | Debug.LogErrorFormat("Tile with id '{0}' does not exists!", tileId); 64 | } 65 | 66 | // instantiate tile at a given position according to orientation 67 | if (this.orientation == Orientation.XY) { 68 | Instantiate(tile.tile, new Vector3(columnIndex, rowIndex, 0), Quaternion.identity); 69 | } else if (this.orientation == Orientation.XZ) { 70 | Instantiate(tile.tile, new Vector3(columnIndex, 0, rowIndex), Quaternion.identity); 71 | } 72 | 73 | } 74 | } 75 | 76 | // make camera follow player 77 | var follow = Camera.main.GetComponent(); 78 | follow.target = GameObject.FindGameObjectWithTag("Player").transform; 79 | 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /Assets/Scripts/LevelManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c67bf3e0b5534f339d49930eef1ff1b 3 | timeCreated: 1439338523 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/MarioController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | public class MarioController : MonoBehaviour { 6 | 7 | public float maximumSpeed = 10f; 8 | public float jumpHeight = 3f; 9 | public LayerMask whatIsGround; 10 | public float airControlHandicap = 0.5f; 11 | 12 | bool grounded = false; 13 | Rigidbody2D r2d; 14 | Animator anim; 15 | bool jump; 16 | 17 | // Use this for initialization 18 | void Start () { 19 | r2d = GetComponent (); 20 | anim = GetComponentInChildren (); 21 | } 22 | 23 | private void Update() 24 | { 25 | if (!jump) 26 | { 27 | // Read the jump input in Update so button presses aren't missed. 28 | jump = CrossPlatformInputManager.GetButtonDown("Jump"); 29 | } 30 | } 31 | 32 | // Update is called once per frame 33 | void FixedUpdate () { 34 | float h = CrossPlatformInputManager.GetAxis("Horizontal"); 35 | 36 | grounded = false; 37 | // find all colliders that are under player's feet 38 | Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, 0.2f, whatIsGround); 39 | for (int i = 0; i < colliders.Length; i++) 40 | { 41 | if (colliders[i].gameObject != gameObject) 42 | grounded = true; 43 | } 44 | 45 | anim.SetBool("Grounded", grounded); 46 | 47 | // Pass all parameters to the character control script. 48 | Move(h, jump); 49 | 50 | // set that we are not jumping anymore 51 | jump = false; 52 | } 53 | 54 | void Move(float move, bool jump) { 55 | 56 | // if we are not in air, we allow character to move 57 | if (grounded || airControlHandicap > 0) { 58 | 59 | // set velocity which player is moving 60 | // if player is in the air handicap is added 61 | 62 | r2d.velocity = new Vector2 ( 63 | move * maximumSpeed * (grounded ? 1 : airControlHandicap), 64 | r2d.velocity.y); 65 | 66 | anim.SetFloat ("Speed", Mathf.Abs (move)); 67 | 68 | // AUTO FLIP 69 | if (move > 0) { 70 | if (transform.localScale.x != 1) { 71 | transform.localScale = new Vector3(1f, 1f, 1f); 72 | } 73 | } 74 | // going right 75 | else if (move < 0) { 76 | if (transform.localScale.x != -1) { 77 | transform.localScale = new Vector3(-1f, 1f, 1f); 78 | } 79 | } 80 | } 81 | 82 | // If the player should jump... 83 | if (grounded && jump && anim.GetBool("Grounded")) 84 | { 85 | // Add a vertical force to the player. 86 | grounded = false; 87 | anim.SetBool("Grounded", false); 88 | r2d.AddForce(new Vector2(0f, jumpHeight)); 89 | } 90 | } 91 | 92 | 93 | } 94 | -------------------------------------------------------------------------------- /Assets/Scripts/MarioController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae1b0cbf6d94743ee8fc5ddd4eeacbee 3 | timeCreated: 1439261459 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/PlatformMoveLeftRight.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class PlatformMoveLeftRight : MonoBehaviour { 5 | 6 | public float span = 2; 7 | public float speed = 1; 8 | 9 | private bool goingRight = true; 10 | private Vector3 leftPosition; 11 | private Vector3 rightPosition; 12 | private Transform trans; 13 | private Rigidbody2D r2d; 14 | 15 | // Use this for initialization 16 | void Start () { 17 | // remember original position 18 | leftPosition = transform.position; 19 | r2d = GetComponent(); 20 | 21 | // remember up position 22 | rightPosition = new Vector3( 23 | transform.position.x + span, 24 | transform.position.y, 25 | transform.position.z 26 | ); 27 | 28 | trans = this.transform; 29 | } 30 | 31 | // Update is called once per frame 32 | void FixedUpdate () { 33 | if (goingRight) { 34 | //trans.Translate(Time.deltaTime * speed, 0f, 0f); 35 | 36 | r2d.MovePosition(new Vector2(trans.position.x + Time.deltaTime * speed, trans.position.y)); 37 | if (trans.position.x > rightPosition.x) { 38 | goingRight = false; 39 | 40 | } 41 | } else { 42 | 43 | r2d.MovePosition(new Vector2(trans.position.x - Time.deltaTime * speed, trans.position.y)); 44 | //trans.Translate(- Time.deltaTime * speed, 0f, 0f); 45 | 46 | 47 | if (trans.position.x < leftPosition.x) { 48 | goingRight = true; 49 | 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/Scripts/PlatformMoveLeftRight.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5c8cff812dc14516bccea22d8fd1125 3 | timeCreated: 1439352010 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/PlatformMoveUpDown.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class PlatformMoveUpDown : MonoBehaviour { 5 | 6 | public float verticalSpan = 2; 7 | public float speed = 1; 8 | 9 | private bool goingUp = true; 10 | private Vector3 bottomPosition; 11 | private Vector3 upPosition; 12 | private Transform trans; 13 | 14 | private Rigidbody2D r2d; 15 | 16 | // Use this for initialization 17 | void Start () { 18 | // remember original position 19 | bottomPosition = transform.position; 20 | 21 | // remember up position 22 | upPosition = new Vector3( 23 | transform.position.x, 24 | transform.position.y + verticalSpan, 25 | transform.position.z 26 | ); 27 | 28 | trans = this.transform; 29 | r2d = GetComponent(); 30 | } 31 | 32 | // Update is called once per frame 33 | void FixedUpdate () { 34 | if (goingUp) { 35 | r2d.MovePosition(new Vector2(trans.position.x, trans.position.y + Time.deltaTime * speed)); 36 | 37 | if (trans.position.y > upPosition.y) { 38 | goingUp = false; 39 | 40 | } 41 | } else { 42 | r2d.MovePosition(new Vector2(trans.position.x, trans.position.y - Time.deltaTime * speed)); 43 | 44 | 45 | if (trans.position.y < bottomPosition.y) { 46 | goingUp = true; 47 | 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Scripts/PlatformMoveUpDown.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3423684c167334b8eaa16255fd688141 3 | timeCreated: 1439350918 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/PlayerController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | public class PlayerController : MonoBehaviour { 6 | 7 | public float maximumSpeed = 10f; 8 | 9 | Rigidbody2D r2d; 10 | 11 | // Use this for initialization 12 | void Start () { 13 | r2d = GetComponent (); 14 | } 15 | 16 | private void Update() 17 | { 18 | } 19 | 20 | // Update is called once per frame 21 | void FixedUpdate () { 22 | float h = CrossPlatformInputManager.GetAxis("Horizontal"); 23 | 24 | // Pass all parameters to the character control script. 25 | Move(h); 26 | } 27 | 28 | void Move(float move) { 29 | 30 | r2d.velocity = new Vector2 ( 31 | move * maximumSpeed, 32 | r2d.velocity.y); 33 | 34 | // AUTO FLIP 35 | if (move > 0) { 36 | if (transform.localScale.x != 1) { 37 | transform.localScale = new Vector3(1f, 1f, 1f); 38 | } 39 | } 40 | // going right 41 | else if (move < 0) { 42 | if (transform.localScale.x != -1) { 43 | transform.localScale = new Vector3(-1f, 1f, 1f); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/Scripts/PlayerController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39df590dbd3c24ee68b1bb97551d50d6 3 | timeCreated: 1439366841 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/SmoothFollow2D.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | 4 | public class SmoothFollow2D : MonoBehaviour 5 | { 6 | 7 | // The target we are following 8 | [SerializeField] 9 | public Transform target; 10 | // the height we want the camera to be above the target 11 | [SerializeField] 12 | private float height = 0.0f; 13 | 14 | [SerializeField] 15 | private float moveDamping = 1; 16 | 17 | private Transform trans; 18 | 19 | // Use this for initialization 20 | void Start() { 21 | this.trans = transform; 22 | } 23 | 24 | // Update is called once per frame 25 | void LateUpdate() 26 | { 27 | // Early out if we don't have a target 28 | if (!target) 29 | return; 30 | 31 | // Calculate the current rotation angles 32 | var wantedHeight = target.position.y + height; 33 | 34 | // Damp the height 35 | trans.position = Vector3.Lerp(trans.position, new Vector3(target.position.x, wantedHeight, trans.position.z), moveDamping * Time.deltaTime); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Scripts/SmoothFollow2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b210b4c330b84bc78d4ee08a145de6e 3 | timeCreated: 1439347084 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d6ff7cb002284348b519f735f7fd601 3 | folderAsset: yes 4 | timeCreated: 1439355085 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Sprites/100px-Brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Sprites/100px-Brick.png -------------------------------------------------------------------------------- /Assets/Sprites/100px-Brick.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f2295f591f184190ad70dc2062a2b13 3 | timeCreated: 1439344686 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 1 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 1 48 | textureType: 8 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/Sprites/50px-Brick copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Sprites/50px-Brick copy.png -------------------------------------------------------------------------------- /Assets/Sprites/50px-Brick copy.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d2b5f85d8a24448d8635b2e67a176c0 3 | timeCreated: 1439344686 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 1 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 1 48 | textureType: 8 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/Sprites/CloudEnemy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Sprites/CloudEnemy.png -------------------------------------------------------------------------------- /Assets/Sprites/CloudEnemy.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23cd2eac0bd5e438a94b9fdfb8bdee03 3 | timeCreated: 1439355427 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 21300000: CloudEnemy_0 8 | 21300002: CloudEnemy_1 9 | 21300004: CloudEnemy_2 10 | 21300006: CloudEnemy_3 11 | 21300008: CloudEnemy_4 12 | 21300010: CloudEnemy_5 13 | 21300012: CloudEnemy_6 14 | 21300014: CloudEnemy_7 15 | 21300016: CloudEnemy_8 16 | 21300018: CloudEnemy_9 17 | serializedVersion: 2 18 | mipmaps: 19 | mipMapMode: 0 20 | enableMipMap: 1 21 | linearTexture: 0 22 | correctGamma: 0 23 | fadeOut: 0 24 | borderMipMap: 0 25 | mipMapFadeDistanceStart: 1 26 | mipMapFadeDistanceEnd: 3 27 | bumpmap: 28 | convertToNormalMap: 0 29 | externalNormalMap: 0 30 | heightScale: .25 31 | normalMapFilter: 0 32 | isReadable: 0 33 | grayScaleToAlpha: 0 34 | generateCubemap: 0 35 | cubemapConvolution: 0 36 | cubemapConvolutionSteps: 8 37 | cubemapConvolutionExponent: 1.5 38 | seamlessCubemap: 0 39 | textureFormat: -1 40 | maxTextureSize: 512 41 | textureSettings: 42 | filterMode: -1 43 | aniso: 16 44 | mipBias: -1 45 | wrapMode: 1 46 | nPOTScale: 0 47 | lightmap: 0 48 | rGBM: 0 49 | compressionQuality: 50 50 | spriteMode: 2 51 | spriteExtrude: 1 52 | spriteMeshType: 1 53 | alignment: 0 54 | spritePivot: {x: .5, y: .5} 55 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 56 | spritePixelsToUnits: 50 57 | alphaIsTransparency: 1 58 | textureType: 8 59 | buildTargetSettings: [] 60 | spriteSheet: 61 | sprites: 62 | - name: CloudEnemy_0 63 | rect: 64 | serializedVersion: 2 65 | x: 5 66 | y: 50 67 | width: 46 68 | height: 38 69 | alignment: 1 70 | pivot: {x: 0, y: 1} 71 | border: {x: 0, y: 0, z: 0, w: 0} 72 | - name: CloudEnemy_1 73 | rect: 74 | serializedVersion: 2 75 | x: 52 76 | y: 50 77 | width: 47 78 | height: 38 79 | alignment: 1 80 | pivot: {x: 0, y: 1} 81 | border: {x: 0, y: 0, z: 0, w: 0} 82 | - name: CloudEnemy_2 83 | rect: 84 | serializedVersion: 2 85 | x: 148 86 | y: 50 87 | width: 46 88 | height: 38 89 | alignment: 1 90 | pivot: {x: 0, y: 1} 91 | border: {x: 0, y: 0, z: 0, w: 0} 92 | - name: CloudEnemy_3 93 | rect: 94 | serializedVersion: 2 95 | x: 197 96 | y: 50 97 | width: 46 98 | height: 38 99 | alignment: 1 100 | pivot: {x: 0, y: 1} 101 | border: {x: 0, y: 0, z: 0, w: 0} 102 | - name: CloudEnemy_4 103 | rect: 104 | serializedVersion: 2 105 | x: 4 106 | y: 3 107 | width: 47 108 | height: 37 109 | alignment: 1 110 | pivot: {x: 0, y: 1} 111 | border: {x: 0, y: 0, z: 0, w: 0} 112 | - name: CloudEnemy_5 113 | rect: 114 | serializedVersion: 2 115 | x: 53 116 | y: 3 117 | width: 46 118 | height: 37 119 | alignment: 1 120 | pivot: {x: 0, y: 1} 121 | border: {x: 0, y: 0, z: 0, w: 0} 122 | - name: CloudEnemy_6 123 | rect: 124 | serializedVersion: 2 125 | x: 101 126 | y: 3 127 | width: 46 128 | height: 37 129 | alignment: 1 130 | pivot: {x: 0, y: 1} 131 | border: {x: 0, y: 0, z: 0, w: 0} 132 | - name: CloudEnemy_7 133 | rect: 134 | serializedVersion: 2 135 | x: 149 136 | y: 3 137 | width: 46 138 | height: 37 139 | alignment: 1 140 | pivot: {x: 0, y: 1} 141 | border: {x: 0, y: 0, z: 0, w: 0} 142 | - name: CloudEnemy_8 143 | rect: 144 | serializedVersion: 2 145 | x: 197 146 | y: 3 147 | width: 46 148 | height: 37 149 | alignment: 1 150 | pivot: {x: 0, y: 1} 151 | border: {x: 0, y: 0, z: 0, w: 0} 152 | - name: CloudEnemy_9 153 | rect: 154 | serializedVersion: 2 155 | x: 99 156 | y: 50 157 | width: 47 158 | height: 38 159 | alignment: 0 160 | pivot: {x: .5, y: .5} 161 | border: {x: 0, y: 0, z: 0, w: 0} 162 | spritePackingTag: 163 | userData: 164 | assetBundleName: 165 | assetBundleVariant: 166 | -------------------------------------------------------------------------------- /Assets/Sprites/Mario.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Sprites/Mario.png -------------------------------------------------------------------------------- /Assets/Sprites/Run.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Sprites/Run.anim -------------------------------------------------------------------------------- /Assets/Sprites/Run.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f555156df347e4f60a3c85f237e00ec4 3 | timeCreated: 1439262420 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Standard Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4c6d393ff339462096e6ce79ea592d9 3 | folderAsset: yes 4 | timeCreated: 1439260808 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Tiles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b0919f2dd76f4db6b608d2a9f4c281a 3 | folderAsset: yes 4 | timeCreated: 1439343137 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Tiles/BrickTile.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Tiles/BrickTile.prefab -------------------------------------------------------------------------------- /Assets/Tiles/BrickTile.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90789cd57ea4546d89b811c9257a7129 3 | timeCreated: 1439344786 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Tiles/Enemy.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Tiles/Enemy.prefab -------------------------------------------------------------------------------- /Assets/Tiles/Enemy.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fee38acdf0d445b1bf320a344949db9 3 | timeCreated: 1439357472 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Tiles/Mario.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Tiles/Mario.prefab -------------------------------------------------------------------------------- /Assets/Tiles/Mario.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24ec0ae513db143eea49b457b7d1f8fc 3 | timeCreated: 1439345253 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Tiles/MovingLeftRightTile.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Tiles/MovingLeftRightTile.prefab -------------------------------------------------------------------------------- /Assets/Tiles/MovingLeftRightTile.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42b08d5e47a75419c86894faf99f11e8 3 | timeCreated: 1439354706 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Tiles/MovingUpDownTile.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/Assets/Tiles/MovingUpDownTile.prefab -------------------------------------------------------------------------------- /Assets/Tiles/MovingUpDownTile.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a7504926c8b44f778b31dae54120c55 3 | timeCreated: 1439350785 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /MarioTutorial-csharp.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{E6DD705D-0F76-48B8-3F2A-B3A5AFF9DA4C}") = "MarioTutorial", "Assembly-CSharp-firstpass-vs.csproj", "{5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}" 5 | EndProject 6 | Project("{E6DD705D-0F76-48B8-3F2A-B3A5AFF9DA4C}") = "MarioTutorial", "Assembly-CSharp-vs.csproj", "{402B272C-F835-6B14-ED34-3CFBA79D845E}" 7 | EndProject 8 | Project("{E6DD705D-0F76-48B8-3F2A-B3A5AFF9DA4C}") = "MarioTutorial", "Assembly-CSharp-Editor-firstpass-vs.csproj", "{690EC088-17D4-0744-2F0E-4F77D1F25882}" 9 | EndProject 10 | Project("{E6DD705D-0F76-48B8-3F2A-B3A5AFF9DA4C}") = "MarioTutorial", "Assembly-CSharp-Editor-vs.csproj", "{E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {402B272C-F835-6B14-ED34-3CFBA79D845E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {402B272C-F835-6B14-ED34-3CFBA79D845E}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {402B272C-F835-6B14-ED34-3CFBA79D845E}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {402B272C-F835-6B14-ED34-3CFBA79D845E}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {690EC088-17D4-0744-2F0E-4F77D1F25882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {690EC088-17D4-0744-2F0E-4F77D1F25882}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {690EC088-17D4-0744-2F0E-4F77D1F25882}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {690EC088-17D4-0744-2F0E-4F77D1F25882}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}.Release|Any CPU.Build.0 = Release|Any CPU 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(MonoDevelopProperties) = preSolution 39 | StartupItem = Assembly-CSharp.csproj 40 | Policies = $0 41 | $0.TextStylePolicy = $1 42 | $1.inheritsSet = null 43 | $1.scope = text/x-csharp 44 | $0.CSharpFormattingPolicy = $2 45 | $2.inheritsSet = Mono 46 | $2.inheritsScope = text/x-csharp 47 | $2.scope = text/x-csharp 48 | $0.TextStylePolicy = $3 49 | $3.FileWidth = 120 50 | $3.TabWidth = 4 51 | $3.IndentWidth = 4 52 | $3.EolMarker = Unix 53 | $3.inheritsSet = Mono 54 | $3.inheritsScope = text/plain 55 | $3.scope = text/plain 56 | EndGlobalSection 57 | 58 | EndGlobal 59 | -------------------------------------------------------------------------------- /MarioTutorial.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{E6DD705D-0F76-48B8-3F2A-B3A5AFF9DA4C}") = "MarioTutorial", "Assembly-CSharp-firstpass.csproj", "{5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}" 5 | EndProject 6 | Project("{E6DD705D-0F76-48B8-3F2A-B3A5AFF9DA4C}") = "MarioTutorial", "Assembly-CSharp.csproj", "{402B272C-F835-6B14-ED34-3CFBA79D845E}" 7 | EndProject 8 | Project("{E6DD705D-0F76-48B8-3F2A-B3A5AFF9DA4C}") = "MarioTutorial", "Assembly-CSharp-Editor-firstpass.csproj", "{690EC088-17D4-0744-2F0E-4F77D1F25882}" 9 | EndProject 10 | Project("{E6DD705D-0F76-48B8-3F2A-B3A5AFF9DA4C}") = "MarioTutorial", "Assembly-CSharp-Editor.csproj", "{E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {5B6A76B4-C145-A0FB-F5AB-3B43ED5DC890}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {402B272C-F835-6B14-ED34-3CFBA79D845E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {402B272C-F835-6B14-ED34-3CFBA79D845E}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {402B272C-F835-6B14-ED34-3CFBA79D845E}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {402B272C-F835-6B14-ED34-3CFBA79D845E}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {690EC088-17D4-0744-2F0E-4F77D1F25882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {690EC088-17D4-0744-2F0E-4F77D1F25882}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {690EC088-17D4-0744-2F0E-4F77D1F25882}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {690EC088-17D4-0744-2F0E-4F77D1F25882}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {E37B9B13-DFB8-ED27-C854-9DF9096F1BBA}.Release|Any CPU.Build.0 = Release|Any CPU 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(MonoDevelopProperties) = preSolution 39 | StartupItem = Assembly-CSharp.csproj 40 | Policies = $0 41 | $0.TextStylePolicy = $1 42 | $1.inheritsSet = null 43 | $1.scope = text/x-csharp 44 | $0.CSharpFormattingPolicy = $2 45 | $2.inheritsSet = Mono 46 | $2.inheritsScope = text/x-csharp 47 | $2.scope = text/x-csharp 48 | $0.TextStylePolicy = $3 49 | $3.FileWidth = 120 50 | $3.TabWidth = 4 51 | $3.IndentWidth = 4 52 | $3.EolMarker = Unix 53 | $3.inheritsSet = Mono 54 | $3.inheritsScope = text/plain 55 | $3.scope = text/plain 56 | EndGlobalSection 57 | 58 | EndGlobal 59 | -------------------------------------------------------------------------------- /MarioTutorial.userprefs: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.1.2f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomitrescak/Unity-2D-Platformer-Tutorial/99472c0a537f72d8531fcc7bc2f364984366c9da/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity 2D Platformer Tutorial 2 | 3 | Watch and learn how to create a simple 2D platformer in Unity 5.0 4 | 5 | # Instructions 6 | 7 | 1. Download Files 8 | 2. Add Standard Assets -> 2D 9 | 3. Open scene "Default" 10 | 4. Watch instruction videos from the link below 11 | 12 | Tutorial Video 15 | 16 | https://www.youtube.com/playlist?list=PLo35hhxbk9J6xOECWUQbVainn5kCJQNbt 17 | 18 | Enjoy! 19 | 20 | Dr. LLama 21 | 22 | # Scripts 23 | 24 | Level Manager 25 | 26 | ```csharp 27 | using UnityEngine; 28 | using System.Collections; 29 | using System.Collections.Generic; 30 | using System; 31 | 32 | public class LevelManager: MonoBehaviour { 33 | 34 | public enum Orientation { 35 | XY, 36 | XZ 37 | } 38 | 39 | // holds the definition of a tile 40 | [Serializable] 41 | public class Tile { 42 | // id of the tile, should be a single letter 43 | public char id; 44 | // reference to the tile 45 | public GameObject tile; 46 | } 47 | 48 | public Orientation orientation; 49 | public List tiles; 50 | public string startLevel; 51 | 52 | void Start() { 53 | if (!string.IsNullOrEmpty (startLevel)) { 54 | this.LoadWorld(startLevel); 55 | } 56 | } 57 | 58 | public void LoadWorld(string definitionFile) { 59 | // load file from the resource folder (Assets/Resources) 60 | // the file has text format 61 | var world = Resources.Load ("Levels/" + definitionFile); 62 | 63 | // the structure of the file is 64 | // 1.......2........ 65 | // ......1111......4 66 | 67 | var worldText = world.text; 68 | var worldLines = world.text.Split('\n'); 69 | 70 | // browse all lines and instantiate objects at desired positions 71 | for (var reverseRowIndex=worldLines.Length - 1; reverseRowIndex>=0; reverseRowIndex--) { 72 | var line = worldLines[reverseRowIndex]; 73 | var rowIndex = worldLines.Length - reverseRowIndex; 74 | 75 | for (var columnIndex=0; columnIndex w.id == tileId); 85 | 86 | // if tile does not exists, notify developer 87 | if (tile == null) { 88 | Debug.LogErrorFormat("Tile with id '{0}' does not exists!", tileId); 89 | } 90 | 91 | // instantiate tile at a given position according to orientation 92 | if (this.orientation == Orientation.XY) { 93 | Instantiate(tile.tile, new Vector3(columnIndex, rowIndex, 0), Quaternion.identity); 94 | } else if (this.orientation == Orientation.XZ) { 95 | Instantiate(tile.tile, new Vector3(columnIndex, 0, rowIndex), Quaternion.identity); 96 | } 97 | 98 | } 99 | } 100 | 101 | // make camera follow player 102 | var follow = Camera.main.GetComponent(); 103 | follow.target = GameObject.FindGameObjectWithTag("Player").transform; 104 | 105 | } 106 | 107 | } 108 | ``` 109 | 110 | SmoothFollow2D 111 | 112 | ```csharp 113 | using UnityEngine; 114 | 115 | 116 | public class SmoothFollow2D : MonoBehaviour 117 | { 118 | 119 | // The target we are following 120 | [SerializeField] 121 | public Transform target; 122 | // the height we want the camera to be above the target 123 | [SerializeField] 124 | private float height = 0.0f; 125 | 126 | [SerializeField] 127 | private float moveDamping = 1; 128 | 129 | private Transform trans; 130 | 131 | // Use this for initialization 132 | void Start() { 133 | this.trans = transform; 134 | } 135 | 136 | // Update is called once per frame 137 | void LateUpdate() 138 | { 139 | // Early out if we don't have a target 140 | if (!target) 141 | return; 142 | 143 | // Calculate the current rotation angles 144 | var wantedHeight = target.position.y + height; 145 | 146 | // Damp the height 147 | trans.position = Vector3.Lerp(trans.position, new Vector3(target.position.x, wantedHeight, trans.position.z), moveDamping * Time.deltaTime); 148 | } 149 | } 150 | ``` 151 | 152 | ```csharp 153 | using UnityEngine; 154 | using System.Collections; 155 | 156 | public class MarioController : MonoBehaviour { 157 | 158 | public float maximumSpeed = 10f; 159 | public float jumpHeight = 3f; 160 | public LayerMask whatIsGround; 161 | public float airControlHandicap = 0.5f; 162 | 163 | bool grounded = false; 164 | Rigidbody2D r2d; 165 | Animator anim; 166 | bool jump; 167 | 168 | // Use this for initialization 169 | void Start () { 170 | r2d = GetComponent (); 171 | anim = GetComponentInChildren (); 172 | } 173 | 174 | private void Update() 175 | { 176 | if (!jump) 177 | { 178 | // Read the jump input in Update so button presses aren't missed. 179 | jump = Input.GetButtonDown("Jump"); 180 | } 181 | } 182 | 183 | // Update is called once per frame 184 | void FixedUpdate () { 185 | float h = Input.GetAxis("Horizontal"); 186 | 187 | grounded = false; 188 | // find all colliders that are under player's feet 189 | Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, 0.2f, whatIsGround); 190 | for (int i = 0; i < colliders.Length; i++) 191 | { 192 | if (colliders[i].gameObject != gameObject) 193 | grounded = true; 194 | } 195 | 196 | anim.SetBool("Grounded", grounded); 197 | 198 | // Pass all parameters to the character control script. 199 | Move(h, jump); 200 | 201 | // set that we are not jumping anymore 202 | jump = false; 203 | } 204 | 205 | void Move(float move, bool jump) { 206 | 207 | // if we are not in air, we allow character to move 208 | if (grounded || airControlHandicap > 0) { 209 | 210 | // set velocity which player is moving 211 | // if player is in the air handicap is added 212 | 213 | r2d.velocity = new Vector2 ( 214 | move * maximumSpeed * (grounded ? 1 : airControlHandicap), 215 | r2d.velocity.y); 216 | 217 | anim.SetFloat ("Speed", Mathf.Abs (move)); 218 | 219 | // AUTO FLIP 220 | if (move > 0) { 221 | if (transform.localScale.x != 1) { 222 | transform.localScale = new Vector3(1f, 1f, 1f); 223 | } 224 | } 225 | // going right 226 | else if (move < 0) { 227 | if (transform.localScale.x != -1) { 228 | transform.localScale = new Vector3(-1f, 1f, 1f); 229 | } 230 | } 231 | } 232 | 233 | // If the player should jump... 234 | if (grounded && jump && anim.GetBool("Grounded")) 235 | { 236 | // Add a vertical force to the player. 237 | grounded = false; 238 | anim.SetBool("Grounded", false); 239 | r2d.AddForce(new Vector2(0f, jumpHeight)); 240 | } 241 | } 242 | 243 | } 244 | ``` 245 | 246 | ```csharp 247 | using UnityEngine; 248 | using System.Collections; 249 | 250 | public class PlatformMoveLeftRight : MonoBehaviour { 251 | 252 | public float span = 2; 253 | public float speed = 1; 254 | 255 | private bool goingRight = true; 256 | private Vector3 leftPosition; 257 | private Vector3 rightPosition; 258 | private Transform trans; 259 | private Rigidbody2D r2d; 260 | 261 | // Use this for initialization 262 | void Start () { 263 | // remember original position 264 | leftPosition = transform.position; 265 | r2d = GetComponent(); 266 | 267 | // remember up position 268 | rightPosition = new Vector3( 269 | transform.position.x + span, 270 | transform.position.y, 271 | transform.position.z 272 | ); 273 | 274 | trans = this.transform; 275 | } 276 | 277 | // Update is called once per frame 278 | void FixedUpdate () { 279 | if (goingRight) { 280 | //trans.Translate(Time.deltaTime * speed, 0f, 0f); 281 | 282 | r2d.MovePosition(new Vector2(trans.position.x + Time.deltaTime * speed, trans.position.y)); 283 | if (trans.position.x > rightPosition.x) { 284 | goingRight = false; 285 | 286 | } 287 | } else { 288 | 289 | r2d.MovePosition(new Vector2(trans.position.x - Time.deltaTime * speed, trans.position.y)); 290 | //trans.Translate(- Time.deltaTime * speed, 0f, 0f); 291 | 292 | 293 | if (trans.position.x < leftPosition.x) { 294 | goingRight = true; 295 | 296 | } 297 | } 298 | } 299 | } 300 | ``` 301 | 302 | ```csharp 303 | using UnityEngine; 304 | using System.Collections; 305 | 306 | public class PlatformMoveUpDown : MonoBehaviour { 307 | 308 | public float verticalSpan = 2; 309 | public float speed = 1; 310 | 311 | private bool goingUp = true; 312 | private Vector3 bottomPosition; 313 | private Vector3 upPosition; 314 | private Transform trans; 315 | 316 | private Rigidbody2D r2d; 317 | 318 | // Use this for initialization 319 | void Start () { 320 | // remember original position 321 | bottomPosition = transform.position; 322 | 323 | // remember up position 324 | upPosition = new Vector3( 325 | transform.position.x, 326 | transform.position.y + verticalSpan, 327 | transform.position.z 328 | ); 329 | 330 | trans = this.transform; 331 | r2d = GetComponent(); 332 | } 333 | 334 | // Update is called once per frame 335 | void FixedUpdate () { 336 | if (goingUp) { 337 | r2d.MovePosition(new Vector2(trans.position.x, trans.position.y + Time.deltaTime * speed)); 338 | 339 | if (trans.position.y > upPosition.y) { 340 | goingUp = false; 341 | 342 | } 343 | } else { 344 | r2d.MovePosition(new Vector2(trans.position.x, trans.position.y - Time.deltaTime * speed)); 345 | 346 | 347 | if (trans.position.y < bottomPosition.y) { 348 | goingUp = true; 349 | 350 | } 351 | } 352 | } 353 | } 354 | ``` 355 | 356 | ```csharp 357 | using UnityEngine; 358 | using System.Collections; 359 | 360 | public class AutoFlip : MonoBehaviour { 361 | 362 | float lastX; 363 | 364 | // initialise 365 | void Start() { 366 | lastX = transform.position.x; 367 | } 368 | 369 | // Update is called once per frame 370 | void Update () { 371 | 372 | // going left 373 | if (lastX > transform.position.x) { 374 | if (transform.localScale.x != 1) { 375 | transform.localScale = new Vector3(1f, 1f, 1f); 376 | } 377 | 378 | } 379 | // going right 380 | else { 381 | 382 | if (transform.localScale.x != -1) { 383 | transform.localScale = new Vector3(-1f, 1f, 1f); 384 | } 385 | } 386 | lastX = transform.position.x; 387 | } 388 | } 389 | ``` 390 | 391 | --------------------------------------------------------------------------------