├── .gitignore ├── Assets ├── Demo.meta ├── Demo │ ├── Prefab.meta │ ├── Prefab │ │ ├── Player.prefab │ │ └── Player.prefab.meta │ ├── Scene.meta │ └── Scene │ │ ├── demo.unity │ │ └── demo.unity.meta ├── Editor.meta ├── Editor │ ├── CrossPlatformInput.meta │ └── CrossPlatformInput │ │ ├── CrossPlatformInputInitialize.cs │ │ └── CrossPlatformInputInitialize.cs.meta ├── Resources.meta ├── Resources │ ├── Art.meta │ ├── Art │ │ ├── Materials.meta │ │ └── Materials │ │ │ ├── GhostMaterial.mat │ │ │ ├── GhostMaterial.mat.meta │ │ │ ├── Shaders.meta │ │ │ └── Shaders │ │ │ ├── SkeletonGhostShader.shader │ │ │ └── SkeletonGhostShader.shader.meta │ ├── fonts.meta │ └── fonts │ │ ├── SlimJim.ttf │ │ └── SlimJim.ttf.meta ├── RobotBoyIdleSprite.png.meta ├── Scripts.meta ├── Scripts │ ├── game.meta │ └── game │ │ ├── sfx.meta │ │ └── sfx │ │ ├── GhostingContainer.cs │ │ ├── GhostingContainer.cs.meta │ │ ├── GhostingSprite.cs │ │ └── GhostingSprite.cs.meta ├── Standard Assets.meta ├── Standard Assets │ ├── 2D.meta │ ├── 2D │ │ ├── Animations.meta │ │ ├── Animations │ │ │ ├── RobotBoyCrouch.anim │ │ │ ├── RobotBoyCrouch.anim.meta │ │ │ ├── RobotBoyCrouchingWalk.anim │ │ │ ├── RobotBoyCrouchingWalk.anim.meta │ │ │ ├── RobotBoyFalling.anim │ │ │ ├── RobotBoyFalling.anim.meta │ │ │ ├── RobotBoyIdle.anim │ │ │ ├── RobotBoyIdle.anim.meta │ │ │ ├── RobotBoyJump01.anim │ │ │ ├── RobotBoyJump01.anim.meta │ │ │ ├── RobotBoyJump02.anim │ │ │ ├── RobotBoyJump02.anim.meta │ │ │ ├── RobotBoyJump03.anim │ │ │ ├── RobotBoyJump03.anim.meta │ │ │ ├── RobotBoyJump04.anim │ │ │ ├── RobotBoyJump04.anim.meta │ │ │ ├── RobotBoyJump05.anim │ │ │ ├── RobotBoyJump05.anim.meta │ │ │ ├── RobotBoyJump06.anim │ │ │ ├── RobotBoyJump06.anim.meta │ │ │ ├── RobotBoyJump07.anim │ │ │ ├── RobotBoyJump07.anim.meta │ │ │ ├── RobotBoyJump08.anim │ │ │ ├── RobotBoyJump08.anim.meta │ │ │ ├── RobotBoyJump09.anim │ │ │ ├── RobotBoyJump09.anim.meta │ │ │ ├── RobotBoyJump10.anim │ │ │ ├── RobotBoyJump10.anim.meta │ │ │ ├── RobotBoyJump11.anim │ │ │ ├── RobotBoyJump11.anim.meta │ │ │ ├── RobotBoyRun.anim │ │ │ ├── RobotBoyRun.anim.meta │ │ │ ├── RobotBoyWalk.anim │ │ │ └── RobotBoyWalk.anim.meta │ │ ├── Animator.meta │ │ ├── Animator │ │ │ ├── 2dCharacterAnimator.controller │ │ │ └── 2dCharacterAnimator.controller.meta │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── SpriteLit.mat │ │ │ └── SpriteLit.mat.meta │ │ ├── PhysicsMaterials.meta │ │ ├── PhysicsMaterials │ │ │ ├── BouncyBox.physicsMaterial2D │ │ │ ├── BouncyBox.physicsMaterial2D.meta │ │ │ ├── Slippery.physicsMaterial2D │ │ │ ├── Slippery.physicsMaterial2D.meta │ │ │ ├── Sticky.physicsMaterial2D │ │ │ └── Sticky.physicsMaterial2D.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── CharacterRobotBoy.prefab │ │ │ ├── CharacterRobotBoy.prefab.meta │ │ │ ├── CollisionSlider.prefab │ │ │ ├── CollisionSlider.prefab.meta │ │ │ ├── CratePink.prefab │ │ │ ├── CratePink.prefab.meta │ │ │ ├── ExtentsLeft.prefab │ │ │ ├── ExtentsLeft.prefab.meta │ │ │ ├── ExtentsRight.prefab │ │ │ ├── ExtentsRight.prefab.meta │ │ │ ├── Killzone.prefab │ │ │ ├── Killzone.prefab.meta │ │ │ ├── Platform04x01.prefab │ │ │ ├── Platform04x01.prefab.meta │ │ │ ├── Platform08x01.prefab │ │ │ ├── Platform08x01.prefab.meta │ │ │ ├── Platform12x01.prefab │ │ │ ├── Platform12x01.prefab.meta │ │ │ ├── Platform16x01.prefab │ │ │ ├── Platform16x01.prefab.meta │ │ │ ├── Platform36x01.prefab │ │ │ ├── Platform36x01.prefab.meta │ │ │ ├── PlatformRamp.prefab │ │ │ └── PlatformRamp.prefab.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ │ ├── Camera2DFollow.cs │ │ │ ├── Camera2DFollow.cs.meta │ │ │ ├── CameraFollow.cs │ │ │ ├── CameraFollow.cs.meta │ │ │ ├── Platformer2DUserControl.cs │ │ │ ├── Platformer2DUserControl.cs.meta │ │ │ ├── PlatformerCharacter2D.cs │ │ │ ├── PlatformerCharacter2D.cs.meta │ │ │ ├── Restarter.cs │ │ │ └── Restarter.cs.meta │ │ ├── Sprites.meta │ │ └── Sprites │ │ │ ├── BackgroundGreyGridSprite.png.meta │ │ │ ├── BackgroundNavyGridSprite.png.meta │ │ │ ├── CratePinkGridSprite.png.meta │ │ │ ├── PlatformWhiteSprite.png.meta │ │ │ ├── RobotBoyCrouchSprite.png.meta │ │ │ ├── RobotBoyDeathSprite.png.meta │ │ │ ├── RobotBoyIdleSprite.png.meta │ │ │ ├── RobotBoyJumpSprite.png.meta │ │ │ ├── RobotBoyRollSprite.png.meta │ │ │ ├── RobotBoyRunSprite.png.meta │ │ │ └── RobotBoyWalkSprite.png.meta │ ├── CrossPlatformInput.meta │ ├── CrossPlatformInput │ │ ├── CrossPlatformInputGuidelines.txt │ │ ├── CrossPlatformInputGuidelines.txt.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── CarTiltControls.prefab │ │ │ ├── CarTiltControls.prefab.meta │ │ │ ├── DualTouchControls.prefab │ │ │ ├── DualTouchControls.prefab.meta │ │ │ ├── MobileAircraftControls.prefab │ │ │ ├── MobileAircraftControls.prefab.meta │ │ │ ├── MobileSingleStickControl.prefab │ │ │ ├── MobileSingleStickControl.prefab.meta │ │ │ ├── MobileTiltControlRig.prefab │ │ │ └── MobileTiltControlRig.prefab.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ │ ├── AxisTouchButton.cs │ │ │ ├── AxisTouchButton.cs.meta │ │ │ ├── ButtonHandler.cs │ │ │ ├── ButtonHandler.cs.meta │ │ │ ├── CrossPlatformInputManager.cs │ │ │ ├── CrossPlatformInputManager.cs.meta │ │ │ ├── InputAxisScrollbar.cs │ │ │ ├── InputAxisScrollbar.cs.meta │ │ │ ├── Joystick.cs │ │ │ ├── Joystick.cs.meta │ │ │ ├── MobileControlRig.cs │ │ │ ├── MobileControlRig.cs.meta │ │ │ ├── PlatformSpecific.meta │ │ │ ├── PlatformSpecific │ │ │ │ ├── MobileInput.cs │ │ │ │ ├── MobileInput.cs.meta │ │ │ │ ├── StandaloneInput.cs │ │ │ │ └── StandaloneInput.cs.meta │ │ │ ├── TiltInput.cs │ │ │ ├── TiltInput.cs.meta │ │ │ ├── TouchPad.cs │ │ │ ├── TouchPad.cs.meta │ │ │ ├── VirtualInput.cs │ │ │ └── VirtualInput.cs.meta │ │ ├── Sprites.meta │ │ └── Sprites │ │ │ ├── ButtonAcceleratorOverSprite.png.meta │ │ │ ├── ButtonAcceleratorUpSprite.png.meta │ │ │ ├── ButtonArrowOverSprite.png.meta │ │ │ ├── ButtonArrowUpSprite.png.meta │ │ │ ├── ButtonBrakeOverSprite.png.meta │ │ │ ├── ButtonBrakeUpSprite.png.meta │ │ │ ├── ButtonCameraCycleUpSprite.png.meta │ │ │ ├── ButtonResetSprite.png.meta │ │ │ ├── ButtonSpacebarSprite.png.meta │ │ │ ├── ButtonThumbstickOverSprite.png.meta │ │ │ ├── ButtonThumbstickUpSprite.png.meta │ │ │ ├── ButtonTimescaleFullUpSprite.png.meta │ │ │ ├── ButtonTimescaleSlowUpSprite.png.meta │ │ │ ├── SliderBackgroundSprite.png.meta │ │ │ ├── SliderHandleSprite.png.meta │ │ │ └── TouchpadSprite.png.meta │ ├── Utility.meta │ └── Utility │ │ ├── ActivateTrigger.cs │ │ ├── ActivateTrigger.cs.meta │ │ ├── AutoMobileShaderSwitch.cs │ │ ├── AutoMobileShaderSwitch.cs.meta │ │ ├── AutoMoveAndRotate.cs │ │ ├── AutoMoveAndRotate.cs.meta │ │ ├── CameraRefocus.cs │ │ ├── CameraRefocus.cs.meta │ │ ├── CurveControlledBob.cs │ │ ├── CurveControlledBob.cs.meta │ │ ├── DragRigidbody.cs │ │ ├── DragRigidbody.cs.meta │ │ ├── DynamicShadowSettings.cs │ │ ├── DynamicShadowSettings.cs.meta │ │ ├── FOVKick.cs │ │ ├── FOVKick.cs.meta │ │ ├── FPSCounter.cs │ │ ├── FPSCounter.cs.meta │ │ ├── FollowTarget.cs │ │ ├── FollowTarget.cs.meta │ │ ├── ForcedReset.cs │ │ ├── ForcedReset.cs.meta │ │ ├── LerpControlledBob.cs │ │ ├── LerpControlledBob.cs.meta │ │ ├── ObjectResetter.cs │ │ ├── ObjectResetter.cs.meta │ │ ├── ParticleSystemDestroyer.cs │ │ ├── ParticleSystemDestroyer.cs.meta │ │ ├── PlatformSpecificContent.cs │ │ ├── PlatformSpecificContent.cs.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ ├── FramerateCounter.prefab │ │ └── FramerateCounter.prefab.meta │ │ ├── SimpleActivatorMenu.cs │ │ ├── SimpleActivatorMenu.cs.meta │ │ ├── SimpleMouseRotator.cs │ │ ├── SimpleMouseRotator.cs.meta │ │ ├── SmoothFollow.cs │ │ ├── SmoothFollow.cs.meta │ │ ├── TimedObjectActivator.cs │ │ ├── TimedObjectActivator.cs.meta │ │ ├── TimedObjectDestructor.cs │ │ ├── TimedObjectDestructor.cs.meta │ │ ├── WaypointCircuit.cs │ │ ├── WaypointCircuit.cs.meta │ │ ├── WaypointProgressTracker.cs │ │ └── WaypointProgressTracker.cs.meta ├── ThirdPartyAssets.meta ├── WrapAroundScreen.cs ├── WrapAroundScreen.cs.meta ├── testingGhosting.cs └── testingGhosting.cs.meta └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # =============== # 2 | # Unity generated # 3 | # =============== # 4 | # temporary files that you do not want to share with other users 5 | Temp/ 6 | Obj/ 7 | UnityGenerated/ 8 | Library/ 9 | Build/ 10 | 11 | # ============================================= # 12 | # Assets that shouldn't be uploaded # 13 | # ============================================= # 14 | Assets/ThirdPartyAssets 15 | Assets/StrangeIoC 16 | Assets/Resources/Art/Sprites/Tazo_2D 17 | Assets/Modelling 18 | # ============================================= # 19 | # Assets ignored to save space # 20 | # ============================================= # 21 | *.mp3 22 | *.wav 23 | *.ogg 24 | *.jpg 25 | *.jpeg 26 | *.png 27 | *.bmp 28 | 29 | # ===================================== # 30 | # Visual Studio / MonoDevelop generated # 31 | # ===================================== # 32 | # these are generated by Mono itself are specific to the user and machine 33 | # sharing these with others in your repo will lead to issues 34 | ExportedObj/ 35 | *.svd 36 | *.userprefs 37 | *.csproj 38 | *.pidb 39 | *.suo 40 | *.sln 41 | *.user 42 | *.unityproj 43 | *.booproj 44 | 45 | # ============ # 46 | # OS generated # 47 | # ============ # 48 | # Mac OS X 49 | .DS_Store 50 | .DS_Store? 51 | ._* 52 | .Spotlight-V100 53 | .Trashes 54 | Icon? 55 | ehthumbs.db 56 | Thumbs.db -------------------------------------------------------------------------------- /Assets/Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 288b27ad73d22a14db5acb1a615ad636 3 | folderAsset: yes 4 | timeCreated: 1441065336 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Demo/Prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c46df644f3bb2245a017e696de89700 3 | folderAsset: yes 4 | timeCreated: 1441065336 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Demo/Prefab/Player.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad4af534b6ee4ab449c9516cea660e01 3 | timeCreated: 1441068443 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Scene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f710ed4d4de0f36439d077c82bd34eb6 3 | folderAsset: yes 4 | timeCreated: 1441067465 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Demo/Scene/demo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1202a5edbe70fe4d829573b8837df15 3 | timeCreated: 1441067466 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee5b0599fc635234ab5d989e985b3945 3 | folderAsset: yes 4 | timeCreated: 1441120149 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.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/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a0a8ff287ffa5e459dc9e2c6d7b4405 3 | folderAsset: yes 4 | timeCreated: 1441067710 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Art.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 478159d952f279c42a58edc3c9aba582 3 | folderAsset: yes 4 | timeCreated: 1441067710 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Art/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 033b07ec2710a3349af48999f95172c0 3 | folderAsset: yes 4 | timeCreated: 1441067763 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Art/Materials/GhostMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: GhostMaterial 10 | m_Shader: {fileID: 4800000, guid: 949a353c41d5f8e4e957418a2b6567b3, type: 3} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _ParallaxMap 42 | second: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | data: 47 | first: 48 | name: _OcclusionMap 49 | second: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | data: 54 | first: 55 | name: _EmissionMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | data: 61 | first: 62 | name: _DetailMask 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | data: 68 | first: 69 | name: _DetailAlbedoMap 70 | second: 71 | m_Texture: {fileID: 0} 72 | m_Scale: {x: 1, y: 1} 73 | m_Offset: {x: 0, y: 0} 74 | data: 75 | first: 76 | name: _MetallicGlossMap 77 | second: 78 | m_Texture: {fileID: 0} 79 | m_Scale: {x: 1, y: 1} 80 | m_Offset: {x: 0, y: 0} 81 | m_Floats: 82 | data: 83 | first: 84 | name: _SrcBlend 85 | second: 1 86 | data: 87 | first: 88 | name: _DstBlend 89 | second: 0 90 | data: 91 | first: 92 | name: _Cutoff 93 | second: .5 94 | data: 95 | first: 96 | name: _Parallax 97 | second: .0199999996 98 | data: 99 | first: 100 | name: _ZWrite 101 | second: 1 102 | data: 103 | first: 104 | name: _Glossiness 105 | second: .5 106 | data: 107 | first: 108 | name: _BumpScale 109 | second: 1 110 | data: 111 | first: 112 | name: _OcclusionStrength 113 | second: 1 114 | data: 115 | first: 116 | name: _DetailNormalMapScale 117 | second: 1 118 | data: 119 | first: 120 | name: _UVSec 121 | second: 0 122 | data: 123 | first: 124 | name: _Mode 125 | second: 0 126 | data: 127 | first: 128 | name: _Metallic 129 | second: 0 130 | data: 131 | first: 132 | name: _TextureFade 133 | second: .102835082 134 | m_Colors: 135 | data: 136 | first: 137 | name: _EmissionColor 138 | second: {r: 0, g: 0, b: 0, a: 1} 139 | data: 140 | first: 141 | name: _Color 142 | second: {r: 1, g: 1, b: 1, a: .102835082} 143 | -------------------------------------------------------------------------------- /Assets/Resources/Art/Materials/GhostMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 388d8120c37161a4a85c56f84a485b48 3 | timeCreated: 1441067711 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Art/Materials/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b722f8878c558c468f5be1037d643ff 3 | folderAsset: yes 4 | timeCreated: 1441067710 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/Art/Materials/Shaders/SkeletonGhostShader.shader: -------------------------------------------------------------------------------- 1 | //Shader written by Alex Dixon 2 | Shader "Spine/SkeletonGhost" 3 | { 4 | Properties 5 | { 6 | _Color ("Main Color", Color) = (1,1,1,1) 7 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 8 | _TextureFade ("Texture Fade Out", Range(0,1)) = 0 9 | } 10 | SubShader 11 | { 12 | 13 | Tags {"Queue"="Transparent" "IgnoreProjector"="False" "RenderType"="Transparent"} 14 | Fog { Mode Off } 15 | Blend One OneMinusSrcAlpha 16 | ZWrite Off 17 | Cull Off 18 | 19 | Pass 20 | { 21 | Tags {"LightMode" = "Always"} // This Pass tag is important or Unity may not give it the correct light information. 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | //#pragma multi_compile_fwdbase // This line tells Unity to compile this pass for forward base. 26 | 27 | #include "UnityCG.cginc" 28 | //#include "AutoLight.cginc" 29 | 30 | struct vertex_input 31 | { 32 | float4 vertex : POSITION; 33 | float2 texcoord : TEXCOORD0; 34 | float4 color : COLOR; 35 | 36 | }; 37 | 38 | struct vertex_output 39 | { 40 | float4 pos : SV_POSITION; 41 | float2 uv : TEXCOORD0; 42 | 43 | float4 color : COLOR; 44 | }; 45 | 46 | sampler2D _MainTex; 47 | fixed4 _Color; 48 | fixed _TextureFade; 49 | 50 | vertex_output vert (vertex_input v) 51 | { 52 | vertex_output o; 53 | o.pos = mul( UNITY_MATRIX_MVP, v.vertex); 54 | o.uv = v.texcoord.xy; 55 | o.color = v.color; 56 | 57 | 58 | return o; 59 | } 60 | 61 | fixed4 frag(vertex_output i) : COLOR 62 | { 63 | fixed4 tex = tex2D(_MainTex, i.uv); 64 | 65 | tex = fixed4(max(_TextureFade, tex.r), max(_TextureFade, tex.g), max(_TextureFade, tex.b), tex.a); 66 | 67 | return tex * ((i.color * _Color) * tex.a); 68 | 69 | 70 | 71 | //float finalAlpha = tex.a * i.color.a * _Color.a; 72 | 73 | /* 74 | TODO: Add basic lighting stuff in later? 75 | fixed4 c; 76 | c.rgb = (UNITY_LIGHTMODEL_AMBIENT.rgb * tex.rgb); // Ambient term. Only do this in Forward Base. It only needs calculating once. 77 | c.rgb += tex.rgb; // Diffuse and specular. 78 | //Unity 4: c.rgb = (UNITY_LIGHTMODEL_AMBIENT.rgb * tex.rgb * 2); // Ambient term. Only do this in Forward Base. It only needs calculating once. 79 | //Unity 4: c.rgb += (tex.rgb * _LightColor0.rgb * diff) * (atten * 2); // Diffuse and specular. 80 | c.a = tex.a; // + _LightColor0.a * atten; 81 | return c; 82 | */ 83 | } 84 | ENDCG 85 | } 86 | 87 | 88 | } 89 | //FallBack "Transparent/Cutout/VertexLit" // Use VertexLit's shadow caster/receiver passes. 90 | } -------------------------------------------------------------------------------- /Assets/Resources/Art/Materials/Shaders/SkeletonGhostShader.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 949a353c41d5f8e4e957418a2b6567b3 3 | timeCreated: 1441046882 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/fonts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e8d6a14df6a47043bdc2e82efd04ad0 3 | folderAsset: yes 4 | timeCreated: 1441121237 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources/fonts/SlimJim.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohaider/UnityGhostingEffect/5aacd8419b7a99d9708296ceef128a60cb598229/Assets/Resources/fonts/SlimJim.ttf -------------------------------------------------------------------------------- /Assets/Resources/fonts/SlimJim.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1df8386ba597b741ab7f0a754d4655d 3 | timeCreated: 1441121238 4 | licenseType: Free 5 | TrueTypeFontImporter: 6 | serializedVersion: 2 7 | fontSize: 16 8 | forceTextureCase: -2 9 | characterSpacing: 1 10 | characterPadding: 0 11 | includeFontData: 1 12 | use2xBehaviour: 0 13 | fontNames: [] 14 | customCharacters: 15 | fontRenderingMode: 0 16 | userData: 17 | assetBundleName: 18 | assetBundleVariant: 19 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b846111e47fc774fa7e2c3b5a390209 3 | folderAsset: yes 4 | timeCreated: 1441065336 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/game.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 951909bb7a82cbd4ba46372a25762fe1 3 | folderAsset: yes 4 | timeCreated: 1441065336 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/game/sfx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4422c6e2d732d324b8a1ea3df5e5a3d2 3 | folderAsset: yes 4 | timeCreated: 1441065336 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/game/sfx/GhostingContainer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcc9df91a8e0527438e17bb18464cd55 3 | timeCreated: 1440992018 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/game/sfx/GhostingSprite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bd94042085ee8e4f90754b0e192de62 3 | timeCreated: 1440992002 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/Standard Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3105f61b72eef549b07b6eace304a7d 3 | folderAsset: yes 4 | timeCreated: 1441120149 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d8bb7944760b84429768013f749b102 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8134e4dd9a11c6468abfb1683315eab 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyCrouch.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19bf9c5d4c01a864baffb3ac0dc54a9b 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyCrouchingWalk.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d139426e5e4404f31a1a8d663355003e 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyFalling.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyFalling 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300014, guid: 76d13a61287547d4fb40bfa27eca4e94, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 24 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300014, guid: 76d13a61287547d4fb40bfa27eca4e94, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0416666679 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyFalling.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03bedf7094c479549beb9434f2033c2e 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyIdle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0a32aa5206b400428f52a44b234c97f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump01.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump01 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300006, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 24 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300006, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0416666679 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump01.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d8caf2b5dcc5414c8d319d27f73828e 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump02.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump02 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300010, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 24 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300010, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0416666679 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump02.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 078bf204f06fcac44978d49dd094b43e 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump03.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump03 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300014, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 24 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300014, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0416666679 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump03.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d73a8b77a39f57843b3a434596ae2bc7 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump04.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump04 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300018, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 24 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300018, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0416666679 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump04.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bffb643e1be1ea84387be9145bc4e150 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump05.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump05 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300018, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 60 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300018, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0166666675 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump05.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1829b8c50e4108f4b936e37f91181337 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump06.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump06 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300026, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 60 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300026, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0166666675 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump06.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e0c47d6f0bab234794fcdf9b91e10ca 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump07.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump07 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300030, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 60 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300030, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0166666675 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump07.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e21ceef391a4b284a9ac47a7961c0c1a 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump08.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump08 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300034, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 60 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300034, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0166666675 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump08.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04c2ee985bb1a9849b5a6e8bee482aed 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump09.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump09 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300038, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 60 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300038, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0166666675 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump09.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57f38812aafe77142bf0c4ec50ff9c3a 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump10.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump10 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300042, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 60 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300042, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0166666675 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump10.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87defe4543f47ef41b345453900fe949 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump11.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyJump11 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300046, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 22 | attribute: m_Sprite 23 | path: 24 | classID: 212 25 | script: {fileID: 0} 26 | m_SampleRate: 60 27 | m_WrapMode: 0 28 | m_Bounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 0, y: 0, z: 0} 31 | m_ClipBindingConstant: 32 | genericBindings: 33 | - path: 0 34 | attribute: 0 35 | script: {fileID: 0} 36 | classID: 212 37 | customType: 23 38 | isPPtrCurve: 1 39 | pptrCurveMapping: 40 | - {fileID: 21300046, guid: 9e1a2edf6149977479db158e4fbf9671, type: 3} 41 | m_AnimationClipSettings: 42 | serializedVersion: 2 43 | m_StartTime: 0 44 | m_StopTime: .0166666675 45 | m_OrientationOffsetY: 0 46 | m_Level: 0 47 | m_CycleOffset: 0 48 | m_LoopTime: 1 49 | m_LoopBlend: 0 50 | m_LoopBlendOrientation: 0 51 | m_LoopBlendPositionY: 0 52 | m_LoopBlendPositionXZ: 0 53 | m_KeepOriginalOrientation: 0 54 | m_KeepOriginalPositionY: 1 55 | m_KeepOriginalPositionXZ: 0 56 | m_HeightFromFeet: 0 57 | m_Mirror: 0 58 | m_EditorCurves: [] 59 | m_EulerEditorCurves: [] 60 | m_HasGenericRootTransform: 0 61 | m_GenerateMotionCurves: 0 62 | m_Events: [] 63 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyJump11.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5944ac50c6dc9442844cef438bb36fe 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyRun.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyRun 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300000, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 22 | - time: .0416666679 23 | value: {fileID: 21300002, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 24 | - time: .0833333358 25 | value: {fileID: 21300004, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 26 | - time: .125 27 | value: {fileID: 21300006, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 28 | - time: .166666672 29 | value: {fileID: 21300008, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 30 | - time: .208333343 31 | value: {fileID: 21300010, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 32 | - time: .25 33 | value: {fileID: 21300012, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 34 | - time: .291666657 35 | value: {fileID: 21300014, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 36 | - time: .333333313 37 | value: {fileID: 21300016, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 38 | - time: .37499997 39 | value: {fileID: 21300018, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 40 | - time: .416666627 41 | value: {fileID: 21300020, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 42 | - time: .458333284 43 | value: {fileID: 21300022, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 44 | - time: .49999994 45 | value: {fileID: 21300024, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 46 | - time: .541666627 47 | value: {fileID: 21300026, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 48 | - time: .583333313 49 | value: {fileID: 21300028, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 50 | - time: .625 51 | value: {fileID: 21300030, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 52 | attribute: m_Sprite 53 | path: 54 | classID: 212 55 | script: {fileID: 0} 56 | m_SampleRate: 24 57 | m_WrapMode: 0 58 | m_Bounds: 59 | m_Center: {x: 0, y: 0, z: 0} 60 | m_Extent: {x: 0, y: 0, z: 0} 61 | m_ClipBindingConstant: 62 | genericBindings: 63 | - path: 0 64 | attribute: 0 65 | script: {fileID: 0} 66 | classID: 212 67 | customType: 23 68 | isPPtrCurve: 1 69 | pptrCurveMapping: 70 | - {fileID: 21300000, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 71 | - {fileID: 21300002, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 72 | - {fileID: 21300004, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 73 | - {fileID: 21300006, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 74 | - {fileID: 21300008, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 75 | - {fileID: 21300010, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 76 | - {fileID: 21300012, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 77 | - {fileID: 21300014, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 78 | - {fileID: 21300016, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 79 | - {fileID: 21300018, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 80 | - {fileID: 21300020, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 81 | - {fileID: 21300022, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 82 | - {fileID: 21300024, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 83 | - {fileID: 21300026, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 84 | - {fileID: 21300028, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 85 | - {fileID: 21300030, guid: 803baf1ea73913f46b25e07d0a79df22, type: 3} 86 | m_AnimationClipSettings: 87 | serializedVersion: 2 88 | m_StartTime: 0 89 | m_StopTime: .666666687 90 | m_OrientationOffsetY: 0 91 | m_Level: 0 92 | m_CycleOffset: 0 93 | m_LoopTime: 1 94 | m_LoopBlend: 0 95 | m_LoopBlendOrientation: 0 96 | m_LoopBlendPositionY: 0 97 | m_LoopBlendPositionXZ: 0 98 | m_KeepOriginalOrientation: 0 99 | m_KeepOriginalPositionY: 1 100 | m_KeepOriginalPositionXZ: 0 101 | m_HeightFromFeet: 0 102 | m_Mirror: 0 103 | m_EditorCurves: [] 104 | m_EulerEditorCurves: [] 105 | m_HasGenericRootTransform: 0 106 | m_GenerateMotionCurves: 0 107 | m_Events: [] 108 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyRun.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c4aa503092e12040ac412fec79b5d67 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyWalk.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RobotBoyWalk 9 | serializedVersion: 5 10 | m_AnimationType: 2 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_PositionCurves: [] 16 | m_ScaleCurves: [] 17 | m_FloatCurves: [] 18 | m_PPtrCurves: 19 | - curve: 20 | - time: 0 21 | value: {fileID: 21300000, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 22 | - time: .0416666679 23 | value: {fileID: 21300002, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 24 | - time: .0833333358 25 | value: {fileID: 21300004, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 26 | - time: .125 27 | value: {fileID: 21300006, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 28 | - time: .166666672 29 | value: {fileID: 21300008, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 30 | - time: .208333343 31 | value: {fileID: 21300010, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 32 | - time: .25 33 | value: {fileID: 21300012, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 34 | - time: .291666657 35 | value: {fileID: 21300014, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 36 | - time: .333333313 37 | value: {fileID: 21300016, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 38 | - time: .37499997 39 | value: {fileID: 21300018, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 40 | - time: .416666627 41 | value: {fileID: 21300020, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 42 | - time: .458333284 43 | value: {fileID: 21300022, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 44 | - time: .49999994 45 | value: {fileID: 21300024, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 46 | - time: .541666627 47 | value: {fileID: 21300026, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 48 | - time: .583333313 49 | value: {fileID: 21300028, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 50 | - time: .625 51 | value: {fileID: 21300030, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 52 | attribute: m_Sprite 53 | path: 54 | classID: 212 55 | script: {fileID: 0} 56 | m_SampleRate: 24 57 | m_WrapMode: 0 58 | m_Bounds: 59 | m_Center: {x: 0, y: 0, z: 0} 60 | m_Extent: {x: 0, y: 0, z: 0} 61 | m_ClipBindingConstant: 62 | genericBindings: 63 | - path: 0 64 | attribute: 0 65 | script: {fileID: 0} 66 | classID: 212 67 | customType: 23 68 | isPPtrCurve: 1 69 | pptrCurveMapping: 70 | - {fileID: 21300000, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 71 | - {fileID: 21300002, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 72 | - {fileID: 21300004, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 73 | - {fileID: 21300006, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 74 | - {fileID: 21300008, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 75 | - {fileID: 21300010, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 76 | - {fileID: 21300012, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 77 | - {fileID: 21300014, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 78 | - {fileID: 21300016, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 79 | - {fileID: 21300018, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 80 | - {fileID: 21300020, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 81 | - {fileID: 21300022, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 82 | - {fileID: 21300024, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 83 | - {fileID: 21300026, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 84 | - {fileID: 21300028, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 85 | - {fileID: 21300030, guid: feda0c18015b3284cabbc0da85254f9a, type: 3} 86 | m_AnimationClipSettings: 87 | serializedVersion: 2 88 | m_StartTime: 0 89 | m_StopTime: .666666687 90 | m_OrientationOffsetY: 0 91 | m_Level: 0 92 | m_CycleOffset: 0 93 | m_LoopTime: 1 94 | m_LoopBlend: 0 95 | m_LoopBlendOrientation: 0 96 | m_LoopBlendPositionY: 0 97 | m_LoopBlendPositionXZ: 0 98 | m_KeepOriginalOrientation: 0 99 | m_KeepOriginalPositionY: 1 100 | m_KeepOriginalPositionXZ: 0 101 | m_HeightFromFeet: 0 102 | m_Mirror: 0 103 | m_EditorCurves: [] 104 | m_EulerEditorCurves: [] 105 | m_HasGenericRootTransform: 0 106 | m_GenerateMotionCurves: 0 107 | m_Events: [] 108 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animations/RobotBoyWalk.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f88bded061933e41a9ed57ae1d07946 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6fac374594252145b045395449bc9b2 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Animator/2dCharacterAnimator.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fc43f0c4b413534ba12c51c0e5e5f6f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8360d6cbb0b24d30ad943985708a039 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Materials/SpriteLit.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: SpriteLit 10 | m_Shader: {fileID: 10753, guid: 0000000000000000e000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: 24 | data: 25 | first: 26 | name: PixelSnap 27 | second: 0 28 | m_Colors: 29 | data: 30 | first: 31 | name: _Color 32 | second: {r: 1, g: 1, b: 1, a: 1} 33 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Materials/SpriteLit.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 272ba847f100d4251bb8260575189042 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/PhysicsMaterials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acf5e119c54034bd8bfbd5f21cc246db 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/PhysicsMaterials/BouncyBox.physicsMaterial2D: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!62 &6200000 4 | PhysicsMaterial2D: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: BouncyBox 9 | friction: .400000006 10 | bounciness: .400000006 11 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/PhysicsMaterials/BouncyBox.physicsMaterial2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8be6341e1ce3f4cec9902bc34f72d20a 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/PhysicsMaterials/Slippery.physicsMaterial2D: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!62 &6200000 4 | PhysicsMaterial2D: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: Slippery 9 | friction: 0 10 | bounciness: 0 11 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/PhysicsMaterials/Slippery.physicsMaterial2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3626fe8e008014f6bbd19bb72937b311 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/PhysicsMaterials/Sticky.physicsMaterial2D: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!62 &6200000 4 | PhysicsMaterial2D: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: Sticky 9 | friction: 1 10 | bounciness: 0 11 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/PhysicsMaterials/Sticky.physicsMaterial2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cb77231a430b454fb792ff7ffcc3943 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6569085fafaa4cd1b747c51376fa329 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/CharacterRobotBoy.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87a2357765801c34292d6718d8b4d770 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/CollisionSlider.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 61: {fileID: 6100000} 12 | m_Layer: 0 13 | m_Name: CollisionSlider 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &400000 20 | Transform: 21 | m_ObjectHideFlags: 1 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | m_GameObject: {fileID: 100000} 25 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 26 | m_LocalPosition: {x: -9.38811588, y: -.612371027, z: 0} 27 | m_LocalScale: {x: 1, y: 1, z: 1} 28 | m_Children: [] 29 | m_Father: {fileID: 0} 30 | m_RootOrder: 0 31 | --- !u!61 &6100000 32 | BoxCollider2D: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 100000} 37 | m_Enabled: 1 38 | m_Material: {fileID: 6200000, guid: 3626fe8e008014f6bbd19bb72937b311, type: 2} 39 | m_IsTrigger: 0 40 | m_Size: {x: .321795791, y: .64172399} 41 | m_Center: {x: -.036658287, y: -.0611513853} 42 | --- !u!1001 &100100000 43 | Prefab: 44 | m_ObjectHideFlags: 1 45 | serializedVersion: 2 46 | m_Modification: 47 | m_TransformParent: {fileID: 0} 48 | m_Modifications: [] 49 | m_RemovedComponents: [] 50 | m_DeprecatedTransformRoot: {fileID: 0} 51 | m_DeprecatedTransformMap: {} 52 | m_DeprecatedTransformComplete: 1 53 | m_ParentPrefab: {fileID: 0} 54 | m_RootGameObject: {fileID: 100000} 55 | m_IsPrefabParent: 1 56 | m_IsExploded: 1 57 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/CollisionSlider.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a71c12ae885e4f80b5144a4652bbeb4 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/CratePink.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 212: {fileID: 21200000} 12 | - 61: {fileID: 6100000} 13 | - 50: {fileID: 5000000} 14 | m_Layer: 0 15 | m_Name: CratePink 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &400000 22 | Transform: 23 | m_ObjectHideFlags: 1 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | m_GameObject: {fileID: 100000} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 26.875, y: 3.5, z: 0} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | --- !u!50 &5000000 34 | Rigidbody2D: 35 | m_ObjectHideFlags: 1 36 | m_PrefabParentObject: {fileID: 0} 37 | m_PrefabInternal: {fileID: 100100000} 38 | m_GameObject: {fileID: 100000} 39 | m_Mass: 1 40 | m_LinearDrag: 0 41 | m_AngularDrag: .0500000007 42 | m_GravityScale: 3 43 | m_FixedAngle: 0 44 | m_IsKinematic: 0 45 | m_Interpolate: 0 46 | m_SleepingMode: 1 47 | m_CollisionDetection: 0 48 | --- !u!61 &6100000 49 | BoxCollider2D: 50 | m_ObjectHideFlags: 1 51 | m_PrefabParentObject: {fileID: 0} 52 | m_PrefabInternal: {fileID: 100100000} 53 | m_GameObject: {fileID: 100000} 54 | m_Enabled: 1 55 | m_Material: {fileID: 6200000, guid: 8be6341e1ce3f4cec9902bc34f72d20a, type: 2} 56 | m_IsTrigger: 0 57 | m_UsedByEffector: 0 58 | m_Offset: {x: .625009537, y: .625220299} 59 | serializedVersion: 2 60 | m_Size: {x: 1.23269653, y: 1.23209572} 61 | --- !u!212 &21200000 62 | SpriteRenderer: 63 | m_ObjectHideFlags: 1 64 | m_PrefabParentObject: {fileID: 0} 65 | m_PrefabInternal: {fileID: 100100000} 66 | m_GameObject: {fileID: 100000} 67 | m_Enabled: 1 68 | m_CastShadows: 0 69 | m_ReceiveShadows: 0 70 | m_LightmapIndex: 255 71 | m_LightmapIndexDynamic: 255 72 | m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0} 73 | m_LightmapTilingOffsetDynamic: {x: 1, y: 1, z: 0, w: 0} 74 | m_Materials: 75 | - {fileID: 2100000, guid: 272ba847f100d4251bb8260575189042, type: 2} 76 | m_SubsetIndices: 77 | m_StaticBatchRoot: {fileID: 0} 78 | m_UseLightProbes: 0 79 | m_UseReflectionProbes: 1 80 | m_ProbeAnchor: {fileID: 0} 81 | m_ScaleInLightmap: 1 82 | m_PreserveUVs: 0 83 | m_AutoUVMaxDistance: .5 84 | m_AutoUVMaxAngle: 89 85 | m_LightmapParameters: {fileID: 0} 86 | m_SortingLayerID: 1859086223 87 | m_SortingOrder: 0 88 | m_Sprite: {fileID: 21300000, guid: 12ef7cbdfe0e143fa858a324456c8979, type: 3} 89 | m_Color: {r: 1, g: 1, b: 1, a: 1} 90 | --- !u!1001 &100100000 91 | Prefab: 92 | m_ObjectHideFlags: 1 93 | serializedVersion: 2 94 | m_Modification: 95 | m_TransformParent: {fileID: 0} 96 | m_Modifications: [] 97 | m_RemovedComponents: [] 98 | m_ParentPrefab: {fileID: 0} 99 | m_RootGameObject: {fileID: 100000} 100 | m_IsPrefabParent: 1 101 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/CratePink.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18fcd494ab71841d695135246693eb3a 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/ExtentsLeft.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0eb16b4b3e362ef4f97494dd0e686c46 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/ExtentsRight.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b241b59d6a89aff4fbf0bce77e644761 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/Killzone.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 61: {fileID: 6100000} 12 | - 114: {fileID: 11400000} 13 | m_Layer: 0 14 | m_Name: Killzone 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &400000 21 | Transform: 22 | m_ObjectHideFlags: 1 23 | m_PrefabParentObject: {fileID: 0} 24 | m_PrefabInternal: {fileID: 100100000} 25 | m_GameObject: {fileID: 100000} 26 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 27 | m_LocalPosition: {x: 0, y: 0, z: 0} 28 | m_LocalScale: {x: 1, y: 1, z: 1} 29 | m_Children: [] 30 | m_Father: {fileID: 0} 31 | m_RootOrder: 0 32 | --- !u!61 &6100000 33 | BoxCollider2D: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 100000} 38 | m_Enabled: 1 39 | m_Material: {fileID: 0} 40 | m_IsTrigger: 1 41 | m_Size: {x: 72.5612183, y: 4.95154667} 42 | m_Center: {x: 26.250351, y: -7.49113798} 43 | --- !u!114 &11400000 44 | MonoBehaviour: 45 | m_ObjectHideFlags: 1 46 | m_PrefabParentObject: {fileID: 0} 47 | m_PrefabInternal: {fileID: 100100000} 48 | m_GameObject: {fileID: 100000} 49 | m_Enabled: 1 50 | m_EditorHideFlags: 0 51 | m_Script: {fileID: 11500000, guid: e053b0a94752146e79954ce4df1b5565, type: 3} 52 | m_Name: 53 | m_EditorClassIdentifier: 54 | --- !u!1001 &100100000 55 | Prefab: 56 | m_ObjectHideFlags: 1 57 | serializedVersion: 2 58 | m_Modification: 59 | m_TransformParent: {fileID: 0} 60 | m_Modifications: [] 61 | m_RemovedComponents: [] 62 | m_DeprecatedTransformRoot: {fileID: 0} 63 | m_DeprecatedTransformMap: {} 64 | m_DeprecatedTransformComplete: 1 65 | m_ParentPrefab: {fileID: 0} 66 | m_RootGameObject: {fileID: 100000} 67 | m_IsPrefabParent: 1 68 | m_IsExploded: 1 69 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/Killzone.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a038b284634e29f4aaf058814aa61a6f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/Platform04x01.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57977547c59abb546bbb1501e3c417db 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/Platform08x01.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 674c23718320e9d498cdad2a5bcd576a 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/Platform12x01.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ce4cbc241d3aca4da0b94a0ffa0d51f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/Platform16x01.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba4eef1c1bb56b444b143beb8d3e30d5 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/Platform36x01.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d024aaa09f4080d448d16f62d1a97b0b 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Prefabs/PlatformRamp.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47d3e747b2e87de4c8358aaa436365ea 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b656cca21e797074a84563027a508ce1 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/Camera2DFollow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets._2D 5 | { 6 | public class Camera2DFollow : MonoBehaviour 7 | { 8 | public Transform target; 9 | public float damping = 1; 10 | public float lookAheadFactor = 3; 11 | public float lookAheadReturnSpeed = 0.5f; 12 | public float lookAheadMoveThreshold = 0.1f; 13 | 14 | private float m_OffsetZ; 15 | private Vector3 m_LastTargetPosition; 16 | private Vector3 m_CurrentVelocity; 17 | private Vector3 m_LookAheadPos; 18 | 19 | // Use this for initialization 20 | private void Start() 21 | { 22 | m_LastTargetPosition = target.position; 23 | m_OffsetZ = (transform.position - target.position).z; 24 | transform.parent = null; 25 | } 26 | 27 | 28 | // Update is called once per frame 29 | private void Update() 30 | { 31 | // only update lookahead pos if accelerating or changed direction 32 | float xMoveDelta = (target.position - m_LastTargetPosition).x; 33 | 34 | bool updateLookAheadTarget = Mathf.Abs(xMoveDelta) > lookAheadMoveThreshold; 35 | 36 | if (updateLookAheadTarget) 37 | { 38 | m_LookAheadPos = lookAheadFactor*Vector3.right*Mathf.Sign(xMoveDelta); 39 | } 40 | else 41 | { 42 | m_LookAheadPos = Vector3.MoveTowards(m_LookAheadPos, Vector3.zero, Time.deltaTime*lookAheadReturnSpeed); 43 | } 44 | 45 | Vector3 aheadTargetPos = target.position + m_LookAheadPos + Vector3.forward*m_OffsetZ; 46 | Vector3 newPos = Vector3.SmoothDamp(transform.position, aheadTargetPos, ref m_CurrentVelocity, damping); 47 | 48 | transform.position = newPos; 49 | 50 | m_LastTargetPosition = target.position; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/Camera2DFollow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d8238cc53530b64fbb7828c3d3bb591 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/CameraFollow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UnityStandardAssets._2D 6 | { 7 | public class CameraFollow : MonoBehaviour 8 | { 9 | public float xMargin = 1f; // Distance in the x axis the player can move before the camera follows. 10 | public float yMargin = 1f; // Distance in the y axis the player can move before the camera follows. 11 | public float xSmooth = 8f; // How smoothly the camera catches up with it's target movement in the x axis. 12 | public float ySmooth = 8f; // How smoothly the camera catches up with it's target movement in the y axis. 13 | public Vector2 maxXAndY; // The maximum x and y coordinates the camera can have. 14 | public Vector2 minXAndY; // The minimum x and y coordinates the camera can have. 15 | 16 | private Transform m_Player; // Reference to the player's transform. 17 | 18 | 19 | private void Awake() 20 | { 21 | // Setting up the reference. 22 | m_Player = GameObject.FindGameObjectWithTag("Player").transform; 23 | } 24 | 25 | 26 | private bool CheckXMargin() 27 | { 28 | // Returns true if the distance between the camera and the player in the x axis is greater than the x margin. 29 | return Mathf.Abs(transform.position.x - m_Player.position.x) > xMargin; 30 | } 31 | 32 | 33 | private bool CheckYMargin() 34 | { 35 | // Returns true if the distance between the camera and the player in the y axis is greater than the y margin. 36 | return Mathf.Abs(transform.position.y - m_Player.position.y) > yMargin; 37 | } 38 | 39 | 40 | private void Update() 41 | { 42 | TrackPlayer(); 43 | } 44 | 45 | 46 | private void TrackPlayer() 47 | { 48 | // By default the target x and y coordinates of the camera are it's current x and y coordinates. 49 | float targetX = transform.position.x; 50 | float targetY = transform.position.y; 51 | 52 | // If the player has moved beyond the x margin... 53 | if (CheckXMargin()) 54 | { 55 | // ... the target x coordinate should be a Lerp between the camera's current x position and the player's current x position. 56 | targetX = Mathf.Lerp(transform.position.x, m_Player.position.x, xSmooth*Time.deltaTime); 57 | } 58 | 59 | // If the player has moved beyond the y margin... 60 | if (CheckYMargin()) 61 | { 62 | // ... the target y coordinate should be a Lerp between the camera's current y position and the player's current y position. 63 | targetY = Mathf.Lerp(transform.position.y, m_Player.position.y, ySmooth*Time.deltaTime); 64 | } 65 | 66 | // The target x and y coordinates should not be larger than the maximum or smaller than the minimum. 67 | targetX = Mathf.Clamp(targetX, minXAndY.x, maxXAndY.x); 68 | targetY = Mathf.Clamp(targetY, minXAndY.y, maxXAndY.y); 69 | 70 | // Set the camera's position to the target position with the same z component. 71 | transform.position = new Vector3(targetX, targetY, transform.position.z); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/CameraFollow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9dfad760b6e9455593192a6d869f7ed 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/Platformer2DUserControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | namespace UnityStandardAssets._2D 6 | { 7 | [RequireComponent(typeof (PlatformerCharacter2D))] 8 | public class Platformer2DUserControl : MonoBehaviour 9 | { 10 | private PlatformerCharacter2D m_Character; 11 | private bool m_Jump; 12 | 13 | 14 | private void Awake() 15 | { 16 | m_Character = GetComponent(); 17 | } 18 | 19 | 20 | private void Update() 21 | { 22 | if (!m_Jump) 23 | { 24 | // Read the jump input in Update so button presses aren't missed. 25 | m_Jump = CrossPlatformInputManager.GetButtonDown("Jump"); 26 | } 27 | } 28 | 29 | 30 | private void FixedUpdate() 31 | { 32 | // Read the inputs. 33 | bool crouch = Input.GetKey(KeyCode.LeftControl); 34 | float h = CrossPlatformInputManager.GetAxis("Horizontal"); 35 | // Pass all parameters to the character control script. 36 | m_Character.Move(h, crouch, m_Jump); 37 | m_Jump = false; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/Platformer2DUserControl.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3d7b34a3bb2d4e4b926e7e729d3d410 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/PlatformerCharacter2D.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets._2D 5 | { 6 | public class PlatformerCharacter2D : MonoBehaviour 7 | { 8 | [SerializeField] private float m_MaxSpeed = 10f; // The fastest the player can travel in the x axis. 9 | [SerializeField] private float m_JumpForce = 400f; // Amount of force added when the player jumps. 10 | [Range(0, 1)] [SerializeField] private float m_CrouchSpeed = .36f; // Amount of maxSpeed applied to crouching movement. 1 = 100% 11 | [SerializeField] private bool m_AirControl = false; // Whether or not a player can steer while jumping; 12 | [SerializeField] private LayerMask m_WhatIsGround; // A mask determining what is ground to the character 13 | 14 | private Transform m_GroundCheck; // A position marking where to check if the player is grounded. 15 | const float k_GroundedRadius = .2f; // Radius of the overlap circle to determine if grounded 16 | private bool m_Grounded; // Whether or not the player is grounded. 17 | private Transform m_CeilingCheck; // A position marking where to check for ceilings 18 | const float k_CeilingRadius = .01f; // Radius of the overlap circle to determine if the player can stand up 19 | private Animator m_Anim; // Reference to the player's animator component. 20 | private Rigidbody2D m_Rigidbody2D; 21 | private bool m_FacingRight = true; // For determining which way the player is currently facing. 22 | 23 | private void Awake() 24 | { 25 | // Setting up references. 26 | m_GroundCheck = transform.Find("GroundCheck"); 27 | m_CeilingCheck = transform.Find("CeilingCheck"); 28 | m_Anim = GetComponent(); 29 | m_Rigidbody2D = GetComponent(); 30 | } 31 | 32 | 33 | private void FixedUpdate() 34 | { 35 | m_Grounded = false; 36 | 37 | // The player is grounded if a circlecast to the groundcheck position hits anything designated as ground 38 | // This can be done using layers instead but Sample Assets will not overwrite your project settings. 39 | Collider2D[] colliders = Physics2D.OverlapCircleAll(m_GroundCheck.position, k_GroundedRadius, m_WhatIsGround); 40 | for (int i = 0; i < colliders.Length; i++) 41 | { 42 | if (colliders[i].gameObject != gameObject) 43 | m_Grounded = true; 44 | } 45 | m_Anim.SetBool("Ground", m_Grounded); 46 | 47 | // Set the vertical animation 48 | m_Anim.SetFloat("vSpeed", m_Rigidbody2D.velocity.y); 49 | } 50 | 51 | 52 | public void Move(float move, bool crouch, bool jump) 53 | { 54 | // If crouching, check to see if the character can stand up 55 | if (!crouch && m_Anim.GetBool("Crouch")) 56 | { 57 | // If the character has a ceiling preventing them from standing up, keep them crouching 58 | if (Physics2D.OverlapCircle(m_CeilingCheck.position, k_CeilingRadius, m_WhatIsGround)) 59 | { 60 | crouch = true; 61 | } 62 | } 63 | 64 | // Set whether or not the character is crouching in the animator 65 | m_Anim.SetBool("Crouch", crouch); 66 | 67 | //only control the player if grounded or airControl is turned on 68 | if (m_Grounded || m_AirControl) 69 | { 70 | // Reduce the speed if crouching by the crouchSpeed multiplier 71 | move = (crouch ? move*m_CrouchSpeed : move); 72 | 73 | // The Speed animator parameter is set to the absolute value of the horizontal input. 74 | m_Anim.SetFloat("Speed", Mathf.Abs(move)); 75 | 76 | // Move the character 77 | m_Rigidbody2D.velocity = new Vector2(move*m_MaxSpeed, m_Rigidbody2D.velocity.y); 78 | 79 | // If the input is moving the player right and the player is facing left... 80 | if (move > 0 && !m_FacingRight) 81 | { 82 | // ... flip the player. 83 | Flip(); 84 | } 85 | // Otherwise if the input is moving the player left and the player is facing right... 86 | else if (move < 0 && m_FacingRight) 87 | { 88 | // ... flip the player. 89 | Flip(); 90 | } 91 | } 92 | // If the player should jump... 93 | if (m_Grounded && jump && m_Anim.GetBool("Ground")) 94 | { 95 | // Add a vertical force to the player. 96 | m_Grounded = false; 97 | m_Anim.SetBool("Ground", false); 98 | m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce)); 99 | } 100 | } 101 | 102 | 103 | private void Flip() 104 | { 105 | // Switch the way the player is labelled as facing. 106 | m_FacingRight = !m_FacingRight; 107 | 108 | // Multiply the player's x local scale by -1. 109 | Vector3 theScale = transform.localScale; 110 | theScale.x *= -1; 111 | transform.localScale = theScale; 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/PlatformerCharacter2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d08f91df3bd212f429df17f53ce2f364 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/Restarter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets._2D 5 | { 6 | public class Restarter : MonoBehaviour 7 | { 8 | private void OnTriggerEnter2D(Collider2D other) 9 | { 10 | if (other.tag == "Player") 11 | { 12 | Application.LoadLevel(Application.loadedLevelName); 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Scripts/Restarter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e053b0a94752146e79954ce4df1b5565 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 018119012bd4d014daf775b5c28fdc9b 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Sprites/BackgroundGreyGridSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbbabe9e292f5604897926494bb38fef 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: PrototypeGrey04x04 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 512 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 6 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 204.800003 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Sprites/BackgroundNavyGridSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d0c184845252df44a655359de388cb8 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: PrototypeBlue04x04 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 512 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 6 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 204.800003 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: 49 | - buildTarget: iPhone 50 | maxTextureSize: 512 51 | textureFormat: -1 52 | compressionQuality: 50 53 | - buildTarget: Android 54 | maxTextureSize: 512 55 | textureFormat: -1 56 | compressionQuality: 50 57 | - buildTarget: BlackBerry 58 | maxTextureSize: 512 59 | textureFormat: -1 60 | compressionQuality: 50 61 | - buildTarget: FlashPlayer 62 | maxTextureSize: 1024 63 | textureFormat: -1 64 | compressionQuality: 50 65 | - buildTarget: WP8 66 | maxTextureSize: 512 67 | textureFormat: -1 68 | compressionQuality: 50 69 | spriteSheet: 70 | sprites: [] 71 | spritePackingTag: 72 | userData: 73 | assetBundleName: 74 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Sprites/CratePinkGridSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12ef7cbdfe0e143fa858a324456c8979 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: PrototypeGreen02x02 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 1024 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 6 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 204.800003 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: 49 | - buildTarget: iPhone 50 | maxTextureSize: 64 51 | textureFormat: -1 52 | compressionQuality: 50 53 | - buildTarget: Android 54 | maxTextureSize: 64 55 | textureFormat: -1 56 | compressionQuality: 50 57 | - buildTarget: BlackBerry 58 | maxTextureSize: 64 59 | textureFormat: -1 60 | compressionQuality: 50 61 | - buildTarget: WP8 62 | maxTextureSize: 64 63 | textureFormat: -1 64 | compressionQuality: 50 65 | spriteSheet: 66 | sprites: [] 67 | spritePackingTag: 68 | userData: 69 | assetBundleName: 70 | -------------------------------------------------------------------------------- /Assets/Standard Assets/2D/Sprites/PlatformWhiteSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d90a8faf6fb9540b084ef2825cc3a5dc 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: PrototypeWhite04x01 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 512 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 6 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 204.800003 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: 49 | - buildTarget: iPhone 50 | maxTextureSize: 128 51 | textureFormat: -1 52 | compressionQuality: 50 53 | - buildTarget: Android 54 | maxTextureSize: 128 55 | textureFormat: -1 56 | compressionQuality: 50 57 | - buildTarget: BlackBerry 58 | maxTextureSize: 128 59 | textureFormat: -1 60 | compressionQuality: 50 61 | - buildTarget: WP8 62 | maxTextureSize: 128 63 | textureFormat: -1 64 | compressionQuality: 50 65 | spriteSheet: 66 | sprites: [] 67 | spritePackingTag: 68 | userData: 69 | assetBundleName: 70 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb6d0d11aa24844488ea026462c8b6aa 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/CrossPlatformInputGuidelines.txt: -------------------------------------------------------------------------------- 1 | 2 | Importing the CrossPlatformInput package adds a menu item to Unity, "CrossPlatformInput", which allows you to enable or disable the CrossPlatformInput in the editor. You must enable the CrossPlatformInput in order to see the control rigs in the editor, and to start using Unity Remote to control your game. 3 | 4 | The CrossPlatformInput sample assets contains two main sections. 5 | 6 | 1) The folder of prefabs provide a variety of ready-to-use "MobileControlRigs". Each control rig is suitable for a different purpose, and each implements the touch or tilt-based equivalent of some of the default standalone axes or buttons. These are ready to drop into your scene, and to use them you simply need to read the axes via the CrossPlatformInput class, rather than Unity's regular Input class. 7 | 8 | 2) The set of scripts provided are the scripts we used to put together the control rigs prefabs. They provide a simplified way of reading basic mobile input, such as tilt, taps and swipe gestures. They are designed so that various mobile controls can be read in the same way as regular Unity axes and buttons. You can use these scripts to build your own MobileControlRigs. 9 | 10 | 11 | 12 | For example the Car control rig feeds the tilt input of the mobile device to the "Horizontal" axis, and has an accelerator and brake touch button which are fed as a pair into the "Vertical" axis. These are virtual equivalents of the real "Horizontal" and "Vertical" axes defined in Unity's Input Manager. 13 | 14 | Therefore when you read CrossPlatformInput.GetAxis("Horizontal"), you will either get the "real" input value - if your build target is non-mobile, or the value from the mobile control rig - if your build target is set to a mobile platform. 15 | 16 | The CrossPlatformInput scripts and prefabs are provided together as an example of how you can implement a cross-platform control solution in Unity. They also allow us to provide our other sample scenes in a form that can be published as standalone or to mobile targets with no modification. 17 | 18 | To use the CrossPlatformInput, you need to drop a "Mobile Control Rig" into your scene (or create your own), and then make calls to CrossPlatformInput functions, referring to the axes and buttons that the Rig implements. 19 | 20 | When reading input from the CrossPlatformInput class, the values returned will be taken either from Unity's Input Manager settings, or from the mobile-specific controls set up, depending on which build target you have selected. 21 | 22 | The CrossPlatformInput class is designed to be called instead of Unity's own Input class, and so mirrors certain parts of the Input API - specifically the functions relating to Axes and Buttons: 23 | GetAxis, GetAxisRaw 24 | GetButton, GetButtonDown, GetButtonUp 25 | 26 | Notes for coders: 27 | This package sets two compiler define symbols. One is always set automatically, the other is optionally set from a menu item. 28 | 29 | Importing the "CrossPlatformInput" package will automatically add a compiler define symbol, "CROSS_PLATFORM_INPUT". This enables the CrossPlatformInput functions defined in some of the other Sample Asset packages (such as the Characters, Planes, etc). Without this symbol defined, those packages use Unity's regular Input class, which means they can be imported alone and still work without the CrossPlatformInput package. 30 | 31 | The optional define (which is set by default, but can be disabled using the "Mobile Input" menu), is "MOBILE_INPUT". This causes the MobileControlRigs to become active when a mobile build target is selected. It also enables certain mobile-specific control nuances in some of the packages, which make more sense when the character or vehicle is being controlled using mobile input (such as auto-leveling the character's look direction). This define is optional because some developers prefer to use standalone input methods instead of the Unity Remote app, when testing mobile apps in the editor's play mode. 32 | 33 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/CrossPlatformInputGuidelines.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3b997593a4f12c4c991490593f3b513 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f030ca9293dfc164c8bc07b982e19f38 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/CarTiltControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 174090ae7f9eff84abe76f0ff062efac 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/DualTouchControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2169821f0567671499a5c10104c69c24 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileAircraftControls.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3369231b1ed7ad34e84d9240a571db81 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileSingleStickControl.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9529ecc3d479da5499993355e6c2cb4f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileTiltControlRig.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 114: {fileID: 11400004} 12 | m_Layer: 0 13 | m_Name: MobileTiltControlRig 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!1 &100002 20 | GameObject: 21 | m_ObjectHideFlags: 0 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | serializedVersion: 4 25 | m_Component: 26 | - 4: {fileID: 400002} 27 | - 114: {fileID: 11400000} 28 | m_Layer: 0 29 | m_Name: TiltSteerInputH 30 | m_TagString: Untagged 31 | m_Icon: {fileID: 0} 32 | m_NavMeshLayer: 0 33 | m_StaticEditorFlags: 0 34 | m_IsActive: 1 35 | --- !u!1 &100004 36 | GameObject: 37 | m_ObjectHideFlags: 0 38 | m_PrefabParentObject: {fileID: 0} 39 | m_PrefabInternal: {fileID: 100100000} 40 | serializedVersion: 4 41 | m_Component: 42 | - 4: {fileID: 400004} 43 | - 114: {fileID: 11400002} 44 | m_Layer: 0 45 | m_Name: TiltSteerInputV 46 | m_TagString: Untagged 47 | m_Icon: {fileID: 0} 48 | m_NavMeshLayer: 0 49 | m_StaticEditorFlags: 0 50 | m_IsActive: 1 51 | --- !u!4 &400000 52 | Transform: 53 | m_ObjectHideFlags: 1 54 | m_PrefabParentObject: {fileID: 0} 55 | m_PrefabInternal: {fileID: 100100000} 56 | m_GameObject: {fileID: 100000} 57 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 58 | m_LocalPosition: {x: 385.509033, y: 268.018066, z: -62.2695312} 59 | m_LocalScale: {x: 1, y: 1, z: 1} 60 | m_Children: 61 | - {fileID: 400004} 62 | - {fileID: 400002} 63 | m_Father: {fileID: 0} 64 | m_RootOrder: 0 65 | --- !u!4 &400002 66 | Transform: 67 | m_ObjectHideFlags: 1 68 | m_PrefabParentObject: {fileID: 0} 69 | m_PrefabInternal: {fileID: 100100000} 70 | m_GameObject: {fileID: 100002} 71 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 72 | m_LocalPosition: {x: -928.193604, y: -473.736786, z: -.00032043457} 73 | m_LocalScale: {x: 1, y: 1, z: 1} 74 | m_Children: [] 75 | m_Father: {fileID: 400000} 76 | m_RootOrder: 1 77 | --- !u!4 &400004 78 | Transform: 79 | m_ObjectHideFlags: 1 80 | m_PrefabParentObject: {fileID: 0} 81 | m_PrefabInternal: {fileID: 100100000} 82 | m_GameObject: {fileID: 100004} 83 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 84 | m_LocalPosition: {x: -928.193604, y: -473.736786, z: -.00032043457} 85 | m_LocalScale: {x: 1, y: 1, z: 1} 86 | m_Children: [] 87 | m_Father: {fileID: 400000} 88 | m_RootOrder: 0 89 | --- !u!114 &11400000 90 | MonoBehaviour: 91 | m_ObjectHideFlags: 1 92 | m_PrefabParentObject: {fileID: 0} 93 | m_PrefabInternal: {fileID: 100100000} 94 | m_GameObject: {fileID: 100002} 95 | m_Enabled: 1 96 | m_EditorHideFlags: 0 97 | m_Script: {fileID: 11500000, guid: 5c2d84226fbbaf94e9c1451f1c39b06a, type: 3} 98 | m_Name: 99 | m_EditorClassIdentifier: 100 | mapping: 101 | type: 0 102 | axisName: Horizontal 103 | tiltAroundAxis: 0 104 | fullTiltAngle: 50 105 | centreAngleOffset: 0 106 | --- !u!114 &11400002 107 | MonoBehaviour: 108 | m_ObjectHideFlags: 1 109 | m_PrefabParentObject: {fileID: 0} 110 | m_PrefabInternal: {fileID: 100100000} 111 | m_GameObject: {fileID: 100004} 112 | m_Enabled: 1 113 | m_EditorHideFlags: 0 114 | m_Script: {fileID: 11500000, guid: 5c2d84226fbbaf94e9c1451f1c39b06a, type: 3} 115 | m_Name: 116 | m_EditorClassIdentifier: 117 | mapping: 118 | type: 0 119 | axisName: Vertical 120 | tiltAroundAxis: 1 121 | fullTiltAngle: -35 122 | centreAngleOffset: 45 123 | --- !u!114 &11400004 124 | MonoBehaviour: 125 | m_ObjectHideFlags: 1 126 | m_PrefabParentObject: {fileID: 0} 127 | m_PrefabInternal: {fileID: 100100000} 128 | m_GameObject: {fileID: 100000} 129 | m_Enabled: 1 130 | m_EditorHideFlags: 0 131 | m_Script: {fileID: 11500000, guid: 71398ce7fbc3a5b4fa50b50bd54317a7, type: 3} 132 | m_Name: 133 | m_EditorClassIdentifier: 134 | --- !u!1001 &100100000 135 | Prefab: 136 | m_ObjectHideFlags: 1 137 | serializedVersion: 2 138 | m_Modification: 139 | m_TransformParent: {fileID: 0} 140 | m_Modifications: [] 141 | m_RemovedComponents: [] 142 | m_ParentPrefab: {fileID: 0} 143 | m_RootGameObject: {fileID: 100000} 144 | m_IsPrefabParent: 1 145 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Prefabs/MobileTiltControlRig.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 999388b68bb99b44099461bfbed94358 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d88a0b7dd92c5524aaf2d65e569a6213 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput 6 | { 7 | public class AxisTouchButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler 8 | { 9 | // designed to work in a pair with another axis touch button 10 | // (typically with one having -1 and one having 1 axisValues) 11 | public string axisName = "Horizontal"; // The name of the axis 12 | public float axisValue = 1; // The axis that the value has 13 | public float responseSpeed = 3; // The speed at which the axis touch button responds 14 | public float returnToCentreSpeed = 3; // The speed at which the button will return to its centre 15 | 16 | AxisTouchButton m_PairedWith; // Which button this one is paired with 17 | CrossPlatformInputManager.VirtualAxis m_Axis; // A reference to the virtual axis as it is in the cross platform input 18 | 19 | void OnEnable() 20 | { 21 | if (!CrossPlatformInputManager.AxisExists(axisName)) 22 | { 23 | // if the axis doesnt exist create a new one in cross platform input 24 | m_Axis = new CrossPlatformInputManager.VirtualAxis(axisName); 25 | CrossPlatformInputManager.RegisterVirtualAxis(m_Axis); 26 | } 27 | else 28 | { 29 | m_Axis = CrossPlatformInputManager.VirtualAxisReference(axisName); 30 | } 31 | FindPairedButton(); 32 | } 33 | 34 | void FindPairedButton() 35 | { 36 | // find the other button witch which this button should be paired 37 | // (it should have the same axisName) 38 | var otherAxisButtons = FindObjectsOfType(typeof(AxisTouchButton)) as AxisTouchButton[]; 39 | 40 | if (otherAxisButtons != null) 41 | { 42 | for (int i = 0; i < otherAxisButtons.Length; i++) 43 | { 44 | if (otherAxisButtons[i].axisName == axisName && otherAxisButtons[i] != this) 45 | { 46 | m_PairedWith = otherAxisButtons[i]; 47 | } 48 | } 49 | } 50 | } 51 | 52 | void OnDisable() 53 | { 54 | // The object is disabled so remove it from the cross platform input system 55 | m_Axis.Remove(); 56 | } 57 | 58 | 59 | public void OnPointerDown(PointerEventData data) 60 | { 61 | if (m_PairedWith == null) 62 | { 63 | FindPairedButton(); 64 | } 65 | // update the axis and record that the button has been pressed this frame 66 | m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, axisValue, responseSpeed * Time.deltaTime)); 67 | } 68 | 69 | 70 | public void OnPointerUp(PointerEventData data) 71 | { 72 | m_Axis.Update(Mathf.MoveTowards(m_Axis.GetValue, 0, responseSpeed * Time.deltaTime)); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/AxisTouchButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ab98b66288df7b4fa182075f2f12bd6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/ButtonHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput 5 | { 6 | public class ButtonHandler : MonoBehaviour 7 | { 8 | 9 | public string Name; 10 | 11 | void OnEnable() 12 | { 13 | 14 | } 15 | 16 | public void SetDownState() 17 | { 18 | CrossPlatformInputManager.SetButtonDown(Name); 19 | } 20 | 21 | 22 | public void SetUpState() 23 | { 24 | CrossPlatformInputManager.SetButtonUp(Name); 25 | } 26 | 27 | 28 | public void SetAxisPositiveState() 29 | { 30 | CrossPlatformInputManager.SetAxisPositive(Name); 31 | } 32 | 33 | 34 | public void SetAxisNeutralState() 35 | { 36 | CrossPlatformInputManager.SetAxisZero(Name); 37 | } 38 | 39 | 40 | public void SetAxisNegativeState() 41 | { 42 | CrossPlatformInputManager.SetAxisNegative(Name); 43 | } 44 | 45 | public void Update() 46 | { 47 | 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/ButtonHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85bf3be603548374ca46f521a3aa7fda 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/CrossPlatformInputManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ac1ce5a5adfd9f46adbf5b6f752a47c 3 | labels: 4 | - Done 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: -1010 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/InputAxisScrollbar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput 5 | { 6 | public class InputAxisScrollbar : MonoBehaviour 7 | { 8 | public string axis; 9 | 10 | void Update() { } 11 | 12 | public void HandleInput(float value) 13 | { 14 | CrossPlatformInputManager.SetAxis(axis, (value*2f) - 1f); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/InputAxisScrollbar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d3269566d48b8447bb48d2259e28f8b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput 6 | { 7 | public class Joystick : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IDragHandler 8 | { 9 | public enum AxisOption 10 | { 11 | // Options for which axes to use 12 | Both, // Use both 13 | OnlyHorizontal, // Only horizontal 14 | OnlyVertical // Only vertical 15 | } 16 | 17 | public int MovementRange = 100; 18 | public AxisOption axesToUse = AxisOption.Both; // The options for the axes that the still will use 19 | public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input 20 | public string verticalAxisName = "Vertical"; // The name given to the vertical axis for the cross platform input 21 | 22 | Vector3 m_StartPos; 23 | bool m_UseX; // Toggle for using the x axis 24 | bool m_UseY; // Toggle for using the Y axis 25 | CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis; // Reference to the joystick in the cross platform input 26 | CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input 27 | 28 | void OnEnable() 29 | { 30 | CreateVirtualAxes(); 31 | } 32 | 33 | void Start() 34 | { 35 | m_StartPos = transform.position; 36 | } 37 | 38 | void UpdateVirtualAxes(Vector3 value) 39 | { 40 | var delta = m_StartPos - value; 41 | delta.y = -delta.y; 42 | delta /= MovementRange; 43 | if (m_UseX) 44 | { 45 | m_HorizontalVirtualAxis.Update(-delta.x); 46 | } 47 | 48 | if (m_UseY) 49 | { 50 | m_VerticalVirtualAxis.Update(delta.y); 51 | } 52 | } 53 | 54 | void CreateVirtualAxes() 55 | { 56 | // set axes to use 57 | m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal); 58 | m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical); 59 | 60 | // create new axes based on axes to use 61 | if (m_UseX) 62 | { 63 | m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); 64 | CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis); 65 | } 66 | if (m_UseY) 67 | { 68 | m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName); 69 | CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis); 70 | } 71 | } 72 | 73 | 74 | public void OnDrag(PointerEventData data) 75 | { 76 | Vector3 newPos = Vector3.zero; 77 | 78 | if (m_UseX) 79 | { 80 | int delta = (int)(data.position.x - m_StartPos.x); 81 | delta = Mathf.Clamp(delta, - MovementRange, MovementRange); 82 | newPos.x = delta; 83 | } 84 | 85 | if (m_UseY) 86 | { 87 | int delta = (int)(data.position.y - m_StartPos.y); 88 | delta = Mathf.Clamp(delta, -MovementRange, MovementRange); 89 | newPos.y = delta; 90 | } 91 | transform.position = new Vector3(m_StartPos.x + newPos.x, m_StartPos.y + newPos.y, m_StartPos.z + newPos.z); 92 | UpdateVirtualAxes(transform.position); 93 | } 94 | 95 | 96 | public void OnPointerUp(PointerEventData data) 97 | { 98 | transform.position = m_StartPos; 99 | UpdateVirtualAxes(m_StartPos); 100 | } 101 | 102 | 103 | public void OnPointerDown(PointerEventData data) { } 104 | 105 | void OnDisable() 106 | { 107 | // remove the joysticks from the cross platform input 108 | if (m_UseX) 109 | { 110 | m_HorizontalVirtualAxis.Remove(); 111 | } 112 | if (m_UseY) 113 | { 114 | m_VerticalVirtualAxis.Remove(); 115 | } 116 | } 117 | } 118 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/Joystick.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00c3c865782347f41b6358d9fba14b48 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | #if UNITY_EDITOR 3 | using UnityEditor; 4 | #endif 5 | using UnityEngine; 6 | 7 | 8 | namespace UnityStandardAssets.CrossPlatformInput 9 | { 10 | [ExecuteInEditMode] 11 | public class MobileControlRig : MonoBehaviour 12 | { 13 | // this script enables or disables the child objects of a control rig 14 | // depending on whether the USE_MOBILE_INPUT define is declared. 15 | 16 | // This define is set or unset by a menu item that is included with 17 | // the Cross Platform Input package. 18 | 19 | #if !UNITY_EDITOR 20 | void OnEnable() 21 | { 22 | CheckEnableControlRig(); 23 | } 24 | #endif 25 | 26 | private void Start() 27 | { 28 | #if UNITY_EDITOR 29 | if (Application.isPlaying) //if in the editor, need to check if we are playing, as start is also called just after exiting play 30 | #endif 31 | { 32 | UnityEngine.EventSystems.EventSystem system = GameObject.FindObjectOfType(); 33 | 34 | if (system == null) 35 | {//the scene have no event system, spawn one 36 | GameObject o = new GameObject("EventSystem"); 37 | 38 | o.AddComponent(); 39 | o.AddComponent(); 40 | o.AddComponent(); 41 | } 42 | } 43 | } 44 | 45 | #if UNITY_EDITOR 46 | 47 | private void OnEnable() 48 | { 49 | EditorUserBuildSettings.activeBuildTargetChanged += Update; 50 | EditorApplication.update += Update; 51 | } 52 | 53 | 54 | private void OnDisable() 55 | { 56 | EditorUserBuildSettings.activeBuildTargetChanged -= Update; 57 | EditorApplication.update -= Update; 58 | } 59 | 60 | 61 | private void Update() 62 | { 63 | CheckEnableControlRig(); 64 | } 65 | #endif 66 | 67 | 68 | private void CheckEnableControlRig() 69 | { 70 | #if MOBILE_INPUT 71 | EnableControlRig(true); 72 | #else 73 | EnableControlRig(false); 74 | #endif 75 | } 76 | 77 | 78 | private void EnableControlRig(bool enabled) 79 | { 80 | foreach (Transform t in transform) 81 | { 82 | t.gameObject.SetActive(enabled); 83 | } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71398ce7fbc3a5b4fa50b50bd54317a7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3f33f034733d9f4f9d439d80e26bdce 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/MobileInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific 5 | { 6 | public class MobileInput : VirtualInput 7 | { 8 | private void AddButton(string name) 9 | { 10 | // we have not registered this button yet so add it, happens in the constructor 11 | CrossPlatformInputManager.RegisterVirtualButton(new CrossPlatformInputManager.VirtualButton(name)); 12 | } 13 | 14 | 15 | private void AddAxes(string name) 16 | { 17 | // we have not registered this button yet so add it, happens in the constructor 18 | CrossPlatformInputManager.RegisterVirtualAxis(new CrossPlatformInputManager.VirtualAxis(name)); 19 | } 20 | 21 | 22 | public override float GetAxis(string name, bool raw) 23 | { 24 | if (!m_VirtualAxes.ContainsKey(name)) 25 | { 26 | AddAxes(name); 27 | } 28 | return m_VirtualAxes[name].GetValue; 29 | } 30 | 31 | 32 | public override void SetButtonDown(string name) 33 | { 34 | if (!m_VirtualButtons.ContainsKey(name)) 35 | { 36 | AddButton(name); 37 | } 38 | m_VirtualButtons[name].Pressed(); 39 | } 40 | 41 | 42 | public override void SetButtonUp(string name) 43 | { 44 | if (!m_VirtualButtons.ContainsKey(name)) 45 | { 46 | AddButton(name); 47 | } 48 | m_VirtualButtons[name].Released(); 49 | } 50 | 51 | 52 | public override void SetAxisPositive(string name) 53 | { 54 | if (!m_VirtualAxes.ContainsKey(name)) 55 | { 56 | AddAxes(name); 57 | } 58 | m_VirtualAxes[name].Update(1f); 59 | } 60 | 61 | 62 | public override void SetAxisNegative(string name) 63 | { 64 | if (!m_VirtualAxes.ContainsKey(name)) 65 | { 66 | AddAxes(name); 67 | } 68 | m_VirtualAxes[name].Update(-1f); 69 | } 70 | 71 | 72 | public override void SetAxisZero(string name) 73 | { 74 | if (!m_VirtualAxes.ContainsKey(name)) 75 | { 76 | AddAxes(name); 77 | } 78 | m_VirtualAxes[name].Update(0f); 79 | } 80 | 81 | 82 | public override void SetAxis(string name, float value) 83 | { 84 | if (!m_VirtualAxes.ContainsKey(name)) 85 | { 86 | AddAxes(name); 87 | } 88 | m_VirtualAxes[name].Update(value); 89 | } 90 | 91 | 92 | public override bool GetButtonDown(string name) 93 | { 94 | if (m_VirtualButtons.ContainsKey(name)) 95 | { 96 | return m_VirtualButtons[name].GetButtonDown; 97 | } 98 | 99 | AddButton(name); 100 | return m_VirtualButtons[name].GetButtonDown; 101 | } 102 | 103 | 104 | public override bool GetButtonUp(string name) 105 | { 106 | if (m_VirtualButtons.ContainsKey(name)) 107 | { 108 | return m_VirtualButtons[name].GetButtonUp; 109 | } 110 | 111 | AddButton(name); 112 | return m_VirtualButtons[name].GetButtonUp; 113 | } 114 | 115 | 116 | public override bool GetButton(string name) 117 | { 118 | if (m_VirtualButtons.ContainsKey(name)) 119 | { 120 | return m_VirtualButtons[name].GetButton; 121 | } 122 | 123 | AddButton(name); 124 | return m_VirtualButtons[name].GetButton; 125 | } 126 | 127 | 128 | public override Vector3 MousePosition() 129 | { 130 | return virtualMousePosition; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/MobileInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9703d53e47195aa4190acd11369ccd1b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.CrossPlatformInput.PlatformSpecific 5 | { 6 | public class StandaloneInput : VirtualInput 7 | { 8 | public override float GetAxis(string name, bool raw) 9 | { 10 | return raw ? Input.GetAxisRaw(name) : Input.GetAxis(name); 11 | } 12 | 13 | 14 | public override bool GetButton(string name) 15 | { 16 | return Input.GetButton(name); 17 | } 18 | 19 | 20 | public override bool GetButtonDown(string name) 21 | { 22 | return Input.GetButtonDown(name); 23 | } 24 | 25 | 26 | public override bool GetButtonUp(string name) 27 | { 28 | return Input.GetButtonUp(name); 29 | } 30 | 31 | 32 | public override void SetButtonDown(string name) 33 | { 34 | throw new Exception( 35 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 36 | } 37 | 38 | 39 | public override void SetButtonUp(string name) 40 | { 41 | throw new Exception( 42 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 43 | } 44 | 45 | 46 | public override void SetAxisPositive(string name) 47 | { 48 | throw new Exception( 49 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 50 | } 51 | 52 | 53 | public override void SetAxisNegative(string name) 54 | { 55 | throw new Exception( 56 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 57 | } 58 | 59 | 60 | public override void SetAxisZero(string name) 61 | { 62 | throw new Exception( 63 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 64 | } 65 | 66 | 67 | public override void SetAxis(string name, float value) 68 | { 69 | throw new Exception( 70 | " This is not possible to be called for standalone input. Please check your platform and code where this is called"); 71 | } 72 | 73 | 74 | public override Vector3 MousePosition() 75 | { 76 | return Input.mousePosition; 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/PlatformSpecific/StandaloneInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9961032f4f02c4f41997c3ea399d2f22 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TiltInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | 7 | namespace UnityStandardAssets.CrossPlatformInput 8 | { 9 | // helps with managing tilt input on mobile devices 10 | public class TiltInput : MonoBehaviour 11 | { 12 | // options for the various orientations 13 | public enum AxisOptions 14 | { 15 | ForwardAxis, 16 | SidewaysAxis, 17 | } 18 | 19 | 20 | [Serializable] 21 | public class AxisMapping 22 | { 23 | public enum MappingType 24 | { 25 | NamedAxis, 26 | MousePositionX, 27 | MousePositionY, 28 | MousePositionZ 29 | }; 30 | 31 | 32 | public MappingType type; 33 | public string axisName; 34 | } 35 | 36 | 37 | public AxisMapping mapping; 38 | public AxisOptions tiltAroundAxis = AxisOptions.ForwardAxis; 39 | public float fullTiltAngle = 25; 40 | public float centreAngleOffset = 0; 41 | 42 | 43 | private CrossPlatformInputManager.VirtualAxis m_SteerAxis; 44 | 45 | 46 | private void OnEnable() 47 | { 48 | if (mapping.type == AxisMapping.MappingType.NamedAxis) 49 | { 50 | m_SteerAxis = new CrossPlatformInputManager.VirtualAxis(mapping.axisName); 51 | CrossPlatformInputManager.RegisterVirtualAxis(m_SteerAxis); 52 | } 53 | } 54 | 55 | 56 | private void Update() 57 | { 58 | float angle = 0; 59 | if (Input.acceleration != Vector3.zero) 60 | { 61 | switch (tiltAroundAxis) 62 | { 63 | case AxisOptions.ForwardAxis: 64 | angle = Mathf.Atan2(Input.acceleration.x, -Input.acceleration.y)*Mathf.Rad2Deg + 65 | centreAngleOffset; 66 | break; 67 | case AxisOptions.SidewaysAxis: 68 | angle = Mathf.Atan2(Input.acceleration.z, -Input.acceleration.y)*Mathf.Rad2Deg + 69 | centreAngleOffset; 70 | break; 71 | } 72 | } 73 | 74 | float axisValue = Mathf.InverseLerp(-fullTiltAngle, fullTiltAngle, angle)*2 - 1; 75 | switch (mapping.type) 76 | { 77 | case AxisMapping.MappingType.NamedAxis: 78 | m_SteerAxis.Update(axisValue); 79 | break; 80 | case AxisMapping.MappingType.MousePositionX: 81 | CrossPlatformInputManager.SetVirtualMousePositionX(axisValue*Screen.width); 82 | break; 83 | case AxisMapping.MappingType.MousePositionY: 84 | CrossPlatformInputManager.SetVirtualMousePositionY(axisValue*Screen.width); 85 | break; 86 | case AxisMapping.MappingType.MousePositionZ: 87 | CrossPlatformInputManager.SetVirtualMousePositionZ(axisValue*Screen.width); 88 | break; 89 | } 90 | } 91 | 92 | 93 | private void OnDisable() 94 | { 95 | m_SteerAxis.Remove(); 96 | } 97 | } 98 | } 99 | 100 | 101 | namespace UnityStandardAssets.CrossPlatformInput.Inspector 102 | { 103 | #if UNITY_EDITOR 104 | [CustomPropertyDrawer(typeof (TiltInput.AxisMapping))] 105 | public class TiltInputAxisStylePropertyDrawer : PropertyDrawer 106 | { 107 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 108 | { 109 | EditorGUI.BeginProperty(position, label, property); 110 | 111 | float x = position.x; 112 | float y = position.y; 113 | float inspectorWidth = position.width; 114 | 115 | // Don't make child fields be indented 116 | var indent = EditorGUI.indentLevel; 117 | EditorGUI.indentLevel = 0; 118 | 119 | var props = new[] {"type", "axisName"}; 120 | var widths = new[] {.4f, .6f}; 121 | if (property.FindPropertyRelative("type").enumValueIndex > 0) 122 | { 123 | // hide name if not a named axis 124 | props = new[] {"type"}; 125 | widths = new[] {1f}; 126 | } 127 | const float lineHeight = 18; 128 | for (int n = 0; n < props.Length; ++n) 129 | { 130 | float w = widths[n]*inspectorWidth; 131 | 132 | // Calculate rects 133 | Rect rect = new Rect(x, y, w, lineHeight); 134 | x += w; 135 | 136 | EditorGUI.PropertyField(rect, property.FindPropertyRelative(props[n]), GUIContent.none); 137 | } 138 | 139 | // Set indent back to what it was 140 | EditorGUI.indentLevel = indent; 141 | EditorGUI.EndProperty(); 142 | } 143 | } 144 | #endif 145 | } 146 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TiltInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c2d84226fbbaf94e9c1451f1c39b06a 3 | labels: 4 | - Not 5 | - Fully 6 | - Implemented 7 | MonoImporter: 8 | serializedVersion: 2 9 | defaultReferences: [] 10 | executionOrder: -1001 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | using UnityEngine.UI; 5 | 6 | namespace UnityStandardAssets.CrossPlatformInput 7 | { 8 | [RequireComponent(typeof(Image))] 9 | public class TouchPad : MonoBehaviour, IPointerDownHandler, IPointerUpHandler 10 | { 11 | // Options for which axes to use 12 | public enum AxisOption 13 | { 14 | Both, // Use both 15 | OnlyHorizontal, // Only horizontal 16 | OnlyVertical // Only vertical 17 | } 18 | 19 | 20 | public enum ControlStyle 21 | { 22 | Absolute, // operates from teh center of the image 23 | Relative, // operates from the center of the initial touch 24 | Swipe, // swipe to touch touch no maintained center 25 | } 26 | 27 | 28 | public AxisOption axesToUse = AxisOption.Both; // The options for the axes that the still will use 29 | public ControlStyle controlStyle = ControlStyle.Absolute; // control style to use 30 | public string horizontalAxisName = "Horizontal"; // The name given to the horizontal axis for the cross platform input 31 | public string verticalAxisName = "Vertical"; // The name given to the vertical axis for the cross platform input 32 | public float Xsensitivity = 1f; 33 | public float Ysensitivity = 1f; 34 | 35 | Vector3 m_StartPos; 36 | Vector2 m_PreviousDelta; 37 | Vector3 m_JoytickOutput; 38 | bool m_UseX; // Toggle for using the x axis 39 | bool m_UseY; // Toggle for using the Y axis 40 | CrossPlatformInputManager.VirtualAxis m_HorizontalVirtualAxis; // Reference to the joystick in the cross platform input 41 | CrossPlatformInputManager.VirtualAxis m_VerticalVirtualAxis; // Reference to the joystick in the cross platform input 42 | bool m_Dragging; 43 | int m_Id = -1; 44 | Vector2 m_PreviousTouchPos; // swipe style control touch 45 | 46 | 47 | #if !UNITY_EDITOR 48 | private Vector3 m_Center; 49 | private Image m_Image; 50 | #else 51 | Vector3 m_PreviousMouse; 52 | #endif 53 | 54 | void OnEnable() 55 | { 56 | CreateVirtualAxes(); 57 | } 58 | 59 | void Start() 60 | { 61 | #if !UNITY_EDITOR 62 | m_Image = GetComponent(); 63 | m_Center = m_Image.transform.position; 64 | #endif 65 | } 66 | 67 | void CreateVirtualAxes() 68 | { 69 | // set axes to use 70 | m_UseX = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyHorizontal); 71 | m_UseY = (axesToUse == AxisOption.Both || axesToUse == AxisOption.OnlyVertical); 72 | 73 | // create new axes based on axes to use 74 | if (m_UseX) 75 | { 76 | m_HorizontalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(horizontalAxisName); 77 | CrossPlatformInputManager.RegisterVirtualAxis(m_HorizontalVirtualAxis); 78 | } 79 | if (m_UseY) 80 | { 81 | m_VerticalVirtualAxis = new CrossPlatformInputManager.VirtualAxis(verticalAxisName); 82 | CrossPlatformInputManager.RegisterVirtualAxis(m_VerticalVirtualAxis); 83 | } 84 | } 85 | 86 | void UpdateVirtualAxes(Vector3 value) 87 | { 88 | value = value.normalized; 89 | if (m_UseX) 90 | { 91 | m_HorizontalVirtualAxis.Update(value.x); 92 | } 93 | 94 | if (m_UseY) 95 | { 96 | m_VerticalVirtualAxis.Update(value.y); 97 | } 98 | } 99 | 100 | 101 | public void OnPointerDown(PointerEventData data) 102 | { 103 | m_Dragging = true; 104 | m_Id = data.pointerId; 105 | #if !UNITY_EDITOR 106 | if (controlStyle != ControlStyle.Absolute ) 107 | m_Center = data.position; 108 | #endif 109 | } 110 | 111 | void Update() 112 | { 113 | if (!m_Dragging) 114 | { 115 | return; 116 | } 117 | if (Input.touchCount >= m_Id + 1 && m_Id != -1) 118 | { 119 | #if !UNITY_EDITOR 120 | 121 | if (controlStyle == ControlStyle.Swipe) 122 | { 123 | m_Center = m_PreviousTouchPos; 124 | m_PreviousTouchPos = Input.touches[m_Id].position; 125 | } 126 | Vector2 pointerDelta = new Vector2(Input.touches[m_Id].position.x - m_Center.x , Input.touches[m_Id].position.y - m_Center.y).normalized; 127 | pointerDelta.x *= Xsensitivity; 128 | pointerDelta.y *= Ysensitivity; 129 | #else 130 | Vector2 pointerDelta; 131 | pointerDelta.x = Input.mousePosition.x - m_PreviousMouse.x; 132 | pointerDelta.y = Input.mousePosition.y - m_PreviousMouse.y; 133 | m_PreviousMouse = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0f); 134 | #endif 135 | UpdateVirtualAxes(new Vector3(pointerDelta.x, pointerDelta.y, 0)); 136 | } 137 | } 138 | 139 | 140 | public void OnPointerUp(PointerEventData data) 141 | { 142 | m_Dragging = false; 143 | m_Id = -1; 144 | UpdateVirtualAxes(Vector3.zero); 145 | } 146 | 147 | void OnDisable() 148 | { 149 | if (CrossPlatformInputManager.AxisExists(horizontalAxisName)) 150 | CrossPlatformInputManager.UnRegisterVirtualAxis(horizontalAxisName); 151 | 152 | if (CrossPlatformInputManager.AxisExists(verticalAxisName)) 153 | CrossPlatformInputManager.UnRegisterVirtualAxis(verticalAxisName); 154 | } 155 | } 156 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/TouchPad.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1caf40fc8bebb6b43b2550c05ca791d6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/VirtualInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace UnityStandardAssets.CrossPlatformInput 7 | { 8 | public abstract class VirtualInput 9 | { 10 | public Vector3 virtualMousePosition { get; private set; } 11 | 12 | 13 | protected Dictionary m_VirtualAxes = 14 | new Dictionary(); 15 | // Dictionary to store the name relating to the virtual axes 16 | protected Dictionary m_VirtualButtons = 17 | new Dictionary(); 18 | protected List m_AlwaysUseVirtual = new List(); 19 | // list of the axis and button names that have been flagged to always use a virtual axis or button 20 | 21 | 22 | public bool AxisExists(string name) 23 | { 24 | return m_VirtualAxes.ContainsKey(name); 25 | } 26 | 27 | public bool ButtonExists(string name) 28 | { 29 | return m_VirtualButtons.ContainsKey(name); 30 | } 31 | 32 | 33 | public void RegisterVirtualAxis(CrossPlatformInputManager.VirtualAxis axis) 34 | { 35 | // check if we already have an axis with that name and log and error if we do 36 | if (m_VirtualAxes.ContainsKey(axis.name)) 37 | { 38 | Debug.LogError("There is already a virtual axis named " + axis.name + " registered."); 39 | } 40 | else 41 | { 42 | // add any new axes 43 | m_VirtualAxes.Add(axis.name, axis); 44 | 45 | // if we dont want to match with the input manager setting then revert to always using virtual 46 | if (!axis.matchWithInputManager) 47 | { 48 | m_AlwaysUseVirtual.Add(axis.name); 49 | } 50 | } 51 | } 52 | 53 | 54 | public void RegisterVirtualButton(CrossPlatformInputManager.VirtualButton button) 55 | { 56 | // check if already have a buttin with that name and log an error if we do 57 | if (m_VirtualButtons.ContainsKey(button.name)) 58 | { 59 | Debug.LogError("There is already a virtual button named " + button.name + " registered."); 60 | } 61 | else 62 | { 63 | // add any new buttons 64 | m_VirtualButtons.Add(button.name, button); 65 | 66 | // if we dont want to match to the input manager then always use a virtual axis 67 | if (!button.matchWithInputManager) 68 | { 69 | m_AlwaysUseVirtual.Add(button.name); 70 | } 71 | } 72 | } 73 | 74 | 75 | public void UnRegisterVirtualAxis(string name) 76 | { 77 | // if we have an axis with that name then remove it from our dictionary of registered axes 78 | if (m_VirtualAxes.ContainsKey(name)) 79 | { 80 | m_VirtualAxes.Remove(name); 81 | } 82 | } 83 | 84 | 85 | public void UnRegisterVirtualButton(string name) 86 | { 87 | // if we have a button with this name then remove it from our dictionary of registered buttons 88 | if (m_VirtualButtons.ContainsKey(name)) 89 | { 90 | m_VirtualButtons.Remove(name); 91 | } 92 | } 93 | 94 | 95 | // returns a reference to a named virtual axis if it exists otherwise null 96 | public CrossPlatformInputManager.VirtualAxis VirtualAxisReference(string name) 97 | { 98 | return m_VirtualAxes.ContainsKey(name) ? m_VirtualAxes[name] : null; 99 | } 100 | 101 | 102 | public void SetVirtualMousePositionX(float f) 103 | { 104 | virtualMousePosition = new Vector3(f, virtualMousePosition.y, virtualMousePosition.z); 105 | } 106 | 107 | 108 | public void SetVirtualMousePositionY(float f) 109 | { 110 | virtualMousePosition = new Vector3(virtualMousePosition.x, f, virtualMousePosition.z); 111 | } 112 | 113 | 114 | public void SetVirtualMousePositionZ(float f) 115 | { 116 | virtualMousePosition = new Vector3(virtualMousePosition.x, virtualMousePosition.y, f); 117 | } 118 | 119 | 120 | public abstract float GetAxis(string name, bool raw); 121 | 122 | public abstract bool GetButton(string name); 123 | public abstract bool GetButtonDown(string name); 124 | public abstract bool GetButtonUp(string name); 125 | 126 | public abstract void SetButtonDown(string name); 127 | public abstract void SetButtonUp(string name); 128 | public abstract void SetAxisPositive(string name); 129 | public abstract void SetAxisNegative(string name); 130 | public abstract void SetAxisZero(string name); 131 | public abstract void SetAxis(string name, float value); 132 | public abstract Vector3 MousePosition(); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Scripts/VirtualInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f57aeb1b8dce3342bea5c28ac17db24 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c4bc148459cd764dbb1d4e94e49299b 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb5f6e2757c821940b69cf1456f7865a 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonAcceleratorUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f588d850485d0ae479d73cf3bd0b7b00 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49b611e658efbf443b686a4036f74fe3 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonArrowUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4db017495c69e8140a56a0e2b669e3f8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b1a64ea234fb2343b8d0686c51280de 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonBrakeUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 827c9cd4a3943534f909ac6473e17288 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonCameraCycleUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3983c59ebf804b4abba687bd7c9e92f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonResetSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a94c9a7eb94ceec4a8d67a1890e22e51 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: ResetButton 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 256 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonSpacebarSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d8675433a508ec47b8f895201eacf20 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: JumpButton 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 1024 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 40, y: 40, z: 40, w: 40} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickOverSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5485e2f56028a3c4cb54f5caa167377e 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonThumbstickUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9866a92691696b346901281f2b329034 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleFullUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c6271a290ef75b4c97d58746c86c5b8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/ButtonTimescaleSlowUpSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d7c6e4896067aa4fa512a00f692ac1c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderBackgroundSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea5873cfd9158664f89459f0c9e1d853 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: SliderBackground 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 256 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 31, y: 15, z: 31, w: 15} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/SliderHandleSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0626b924325d1c34cafa6b22297f4e4f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 256 29 | textureSettings: 30 | filterMode: 1 31 | aniso: 16 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 1 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 8 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/CrossPlatformInput/Sprites/TouchpadSprite.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4f1fee3de32377429fd1348fae62b10 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: JumpButton 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 1 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .25 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 0 24 | cubemapConvolution: 0 25 | cubemapConvolutionSteps: 8 26 | cubemapConvolutionExponent: 1.5 27 | seamlessCubemap: 0 28 | textureFormat: -1 29 | maxTextureSize: 1024 30 | textureSettings: 31 | filterMode: 1 32 | aniso: 16 33 | mipBias: -1 34 | wrapMode: 1 35 | nPOTScale: 0 36 | lightmap: 0 37 | rGBM: 0 38 | compressionQuality: 50 39 | spriteMode: 1 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 65, y: 65, z: 65, w: 65} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 1 47 | textureType: 8 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fb26caddeedb41c9ae5c09a23c52942 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ActivateTrigger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using Object = UnityEngine.Object; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class ActivateTrigger : MonoBehaviour 8 | { 9 | // A multi-purpose script which causes an action to occur when 10 | // a trigger collider is entered. 11 | public enum Mode 12 | { 13 | Trigger = 0, // Just broadcast the action on to the target 14 | Replace = 1, // replace target with source 15 | Activate = 2, // Activate the target GameObject 16 | Enable = 3, // Enable a component 17 | Animate = 4, // Start animation on target 18 | Deactivate = 5 // Decativate target GameObject 19 | } 20 | 21 | public Mode action = Mode.Activate; // The action to accomplish 22 | public Object target; // The game object to affect. If none, the trigger work on this game object 23 | public GameObject source; 24 | public int triggerCount = 1; 25 | public bool repeatTrigger = false; 26 | 27 | 28 | private void DoActivateTrigger() 29 | { 30 | triggerCount--; 31 | 32 | if (triggerCount == 0 || repeatTrigger) 33 | { 34 | Object currentTarget = target ?? gameObject; 35 | Behaviour targetBehaviour = currentTarget as Behaviour; 36 | GameObject targetGameObject = currentTarget as GameObject; 37 | if (targetBehaviour != null) 38 | { 39 | targetGameObject = targetBehaviour.gameObject; 40 | } 41 | 42 | switch (action) 43 | { 44 | case Mode.Trigger: 45 | if (targetGameObject != null) 46 | { 47 | targetGameObject.BroadcastMessage("DoActivateTrigger"); 48 | } 49 | break; 50 | case Mode.Replace: 51 | if (source != null) 52 | { 53 | if (targetGameObject != null) 54 | { 55 | Instantiate(source, targetGameObject.transform.position, 56 | targetGameObject.transform.rotation); 57 | DestroyObject(targetGameObject); 58 | } 59 | } 60 | break; 61 | case Mode.Activate: 62 | if (targetGameObject != null) 63 | { 64 | targetGameObject.SetActive(true); 65 | } 66 | break; 67 | case Mode.Enable: 68 | if (targetBehaviour != null) 69 | { 70 | targetBehaviour.enabled = true; 71 | } 72 | break; 73 | case Mode.Animate: 74 | if (targetGameObject != null) 75 | { 76 | targetGameObject.GetComponent().Play(); 77 | } 78 | break; 79 | case Mode.Deactivate: 80 | if (targetGameObject != null) 81 | { 82 | targetGameObject.SetActive(false); 83 | } 84 | break; 85 | } 86 | } 87 | } 88 | 89 | 90 | private void OnTriggerEnter(Collider other) 91 | { 92 | DoActivateTrigger(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ActivateTrigger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8634e062924929664361c08745211fb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AutoMobileShaderSwitch.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c4978ff6447f9040b84acc89b0bbdc8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AutoMoveAndRotate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class AutoMoveAndRotate : MonoBehaviour 7 | { 8 | public Vector3andSpace moveUnitsPerSecond; 9 | public Vector3andSpace rotateDegreesPerSecond; 10 | public bool ignoreTimescale; 11 | private float m_LastRealTime; 12 | 13 | 14 | private void Start() 15 | { 16 | m_LastRealTime = Time.realtimeSinceStartup; 17 | } 18 | 19 | 20 | // Update is called once per frame 21 | private void Update() 22 | { 23 | float deltaTime = Time.deltaTime; 24 | if (ignoreTimescale) 25 | { 26 | deltaTime = (Time.realtimeSinceStartup - m_LastRealTime); 27 | m_LastRealTime = Time.realtimeSinceStartup; 28 | } 29 | transform.Translate(moveUnitsPerSecond.value*deltaTime, moveUnitsPerSecond.space); 30 | transform.Rotate(rotateDegreesPerSecond.value*deltaTime, moveUnitsPerSecond.space); 31 | } 32 | 33 | 34 | [Serializable] 35 | public class Vector3andSpace 36 | { 37 | public Vector3 value; 38 | public Space space = Space.Self; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/AutoMoveAndRotate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1347817507220a4384f3ff6f7c24546 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CameraRefocus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class CameraRefocus 7 | { 8 | public Camera Camera; 9 | public Vector3 Lookatpoint; 10 | public Transform Parent; 11 | 12 | private Vector3 m_OrigCameraPos; 13 | private bool m_Refocus; 14 | 15 | 16 | public CameraRefocus(Camera camera, Transform parent, Vector3 origCameraPos) 17 | { 18 | m_OrigCameraPos = origCameraPos; 19 | Camera = camera; 20 | Parent = parent; 21 | } 22 | 23 | 24 | public void ChangeCamera(Camera camera) 25 | { 26 | Camera = camera; 27 | } 28 | 29 | 30 | public void ChangeParent(Transform parent) 31 | { 32 | Parent = parent; 33 | } 34 | 35 | 36 | public void GetFocusPoint() 37 | { 38 | RaycastHit hitInfo; 39 | if (Physics.Raycast(Parent.transform.position + m_OrigCameraPos, Parent.transform.forward, out hitInfo, 40 | 100f)) 41 | { 42 | Lookatpoint = hitInfo.point; 43 | m_Refocus = true; 44 | return; 45 | } 46 | m_Refocus = false; 47 | } 48 | 49 | 50 | public void SetFocusPoint() 51 | { 52 | if (m_Refocus) 53 | { 54 | Camera.transform.LookAt(Lookatpoint); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CameraRefocus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1e2e7a54dcc8694ab1eca46d072f264 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CurveControlledBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class CurveControlledBob 9 | { 10 | public float HorizontalBobRange = 0.33f; 11 | public float VerticalBobRange = 0.33f; 12 | public AnimationCurve Bobcurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.5f, 1f), 13 | new Keyframe(1f, 0f), new Keyframe(1.5f, -1f), 14 | new Keyframe(2f, 0f)); // sin curve for head bob 15 | public float VerticaltoHorizontalRatio = 1f; 16 | 17 | private float m_CyclePositionX; 18 | private float m_CyclePositionY; 19 | private float m_BobBaseInterval; 20 | private Vector3 m_OriginalCameraPosition; 21 | private float m_Time; 22 | 23 | 24 | public void Setup(Camera camera, float bobBaseInterval) 25 | { 26 | m_BobBaseInterval = bobBaseInterval; 27 | m_OriginalCameraPosition = camera.transform.localPosition; 28 | 29 | // get the length of the curve in time 30 | m_Time = Bobcurve[Bobcurve.length - 1].time; 31 | } 32 | 33 | 34 | public Vector3 DoHeadBob(float speed) 35 | { 36 | float xPos = m_OriginalCameraPosition.x + (Bobcurve.Evaluate(m_CyclePositionX)*HorizontalBobRange); 37 | float yPos = m_OriginalCameraPosition.y + (Bobcurve.Evaluate(m_CyclePositionY)*VerticalBobRange); 38 | 39 | m_CyclePositionX += (speed*Time.deltaTime)/m_BobBaseInterval; 40 | m_CyclePositionY += ((speed*Time.deltaTime)/m_BobBaseInterval)*VerticaltoHorizontalRatio; 41 | 42 | if (m_CyclePositionX > m_Time) 43 | { 44 | m_CyclePositionX = m_CyclePositionX - m_Time; 45 | } 46 | if (m_CyclePositionY > m_Time) 47 | { 48 | m_CyclePositionY = m_CyclePositionY - m_Time; 49 | } 50 | 51 | return new Vector3(xPos, yPos, 0f); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/CurveControlledBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 492f54f4accf00440828ffcb9e4fcc19 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DragRigidbody.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class DragRigidbody : MonoBehaviour 8 | { 9 | const float k_Spring = 50.0f; 10 | const float k_Damper = 5.0f; 11 | const float k_Drag = 10.0f; 12 | const float k_AngularDrag = 5.0f; 13 | const float k_Distance = 0.2f; 14 | const bool k_AttachToCenterOfMass = false; 15 | 16 | private SpringJoint m_SpringJoint; 17 | 18 | 19 | private void Update() 20 | { 21 | // Make sure the user pressed the mouse down 22 | if (!Input.GetMouseButtonDown(0)) 23 | { 24 | return; 25 | } 26 | 27 | var mainCamera = FindCamera(); 28 | 29 | // We need to actually hit an object 30 | RaycastHit hit = new RaycastHit(); 31 | if ( 32 | !Physics.Raycast(mainCamera.ScreenPointToRay(Input.mousePosition).origin, 33 | mainCamera.ScreenPointToRay(Input.mousePosition).direction, out hit, 100, 34 | Physics.DefaultRaycastLayers)) 35 | { 36 | return; 37 | } 38 | // We need to hit a rigidbody that is not kinematic 39 | if (!hit.rigidbody || hit.rigidbody.isKinematic) 40 | { 41 | return; 42 | } 43 | 44 | if (!m_SpringJoint) 45 | { 46 | var go = new GameObject("Rigidbody dragger"); 47 | Rigidbody body = go.AddComponent(); 48 | m_SpringJoint = go.AddComponent(); 49 | body.isKinematic = true; 50 | } 51 | 52 | m_SpringJoint.transform.position = hit.point; 53 | m_SpringJoint.anchor = Vector3.zero; 54 | 55 | m_SpringJoint.spring = k_Spring; 56 | m_SpringJoint.damper = k_Damper; 57 | m_SpringJoint.maxDistance = k_Distance; 58 | m_SpringJoint.connectedBody = hit.rigidbody; 59 | 60 | StartCoroutine("DragObject", hit.distance); 61 | } 62 | 63 | 64 | private IEnumerator DragObject(float distance) 65 | { 66 | var oldDrag = m_SpringJoint.connectedBody.drag; 67 | var oldAngularDrag = m_SpringJoint.connectedBody.angularDrag; 68 | m_SpringJoint.connectedBody.drag = k_Drag; 69 | m_SpringJoint.connectedBody.angularDrag = k_AngularDrag; 70 | var mainCamera = FindCamera(); 71 | while (Input.GetMouseButton(0)) 72 | { 73 | var ray = mainCamera.ScreenPointToRay(Input.mousePosition); 74 | m_SpringJoint.transform.position = ray.GetPoint(distance); 75 | yield return null; 76 | } 77 | if (m_SpringJoint.connectedBody) 78 | { 79 | m_SpringJoint.connectedBody.drag = oldDrag; 80 | m_SpringJoint.connectedBody.angularDrag = oldAngularDrag; 81 | m_SpringJoint.connectedBody = null; 82 | } 83 | } 84 | 85 | 86 | private Camera FindCamera() 87 | { 88 | if (GetComponent()) 89 | { 90 | return GetComponent(); 91 | } 92 | 93 | return Camera.main; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DragRigidbody.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58650e15a2607e44daa0f150e0061d89 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DynamicShadowSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class DynamicShadowSettings : MonoBehaviour 7 | { 8 | public Light sunLight; 9 | public float minHeight = 10; 10 | public float minShadowDistance = 80; 11 | public float minShadowBias = 1; 12 | public float maxHeight = 1000; 13 | public float maxShadowDistance = 10000; 14 | public float maxShadowBias = 0.1f; 15 | public float adaptTime = 1; 16 | 17 | private float m_SmoothHeight; 18 | private float m_ChangeSpeed; 19 | private float m_OriginalStrength = 1; 20 | 21 | 22 | private void Start() 23 | { 24 | m_OriginalStrength = sunLight.shadowStrength; 25 | } 26 | 27 | 28 | // Update is called once per frame 29 | private void Update() 30 | { 31 | Ray ray = new Ray(Camera.main.transform.position, -Vector3.up); 32 | RaycastHit hit; 33 | float height = transform.position.y; 34 | if (Physics.Raycast(ray, out hit)) 35 | { 36 | height = hit.distance; 37 | } 38 | 39 | if (Mathf.Abs(height - m_SmoothHeight) > 1) 40 | { 41 | m_SmoothHeight = Mathf.SmoothDamp(m_SmoothHeight, height, ref m_ChangeSpeed, adaptTime); 42 | } 43 | 44 | float i = Mathf.InverseLerp(minHeight, maxHeight, m_SmoothHeight); 45 | 46 | QualitySettings.shadowDistance = Mathf.Lerp(minShadowDistance, maxShadowDistance, i); 47 | sunLight.shadowBias = Mathf.Lerp(minShadowBias, maxShadowBias, 1 - ((1 - i)*(1 - i))); 48 | sunLight.shadowStrength = Mathf.Lerp(m_OriginalStrength, 0, i); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/DynamicShadowSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8566902b50d5bfb4fb7f8b89f9cdbe8b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FOVKick.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class FOVKick 9 | { 10 | public Camera Camera; // optional camera setup, if null the main camera will be used 11 | [HideInInspector] public float originalFov; // the original fov 12 | public float FOVIncrease = 3f; // the amount the field of view increases when going into a run 13 | public float TimeToIncrease = 1f; // the amount of time the field of view will increase over 14 | public float TimeToDecrease = 1f; // the amount of time the field of view will take to return to its original size 15 | public AnimationCurve IncreaseCurve; 16 | 17 | 18 | public void Setup(Camera camera) 19 | { 20 | CheckStatus(camera); 21 | 22 | Camera = camera; 23 | originalFov = camera.fieldOfView; 24 | } 25 | 26 | 27 | private void CheckStatus(Camera camera) 28 | { 29 | if (camera == null) 30 | { 31 | throw new Exception("FOVKick camera is null, please supply the camera to the constructor"); 32 | } 33 | 34 | if (IncreaseCurve == null) 35 | { 36 | throw new Exception( 37 | "FOVKick Increase curve is null, please define the curve for the field of view kicks"); 38 | } 39 | } 40 | 41 | 42 | public void ChangeCamera(Camera camera) 43 | { 44 | Camera = camera; 45 | } 46 | 47 | 48 | public IEnumerator FOVKickUp() 49 | { 50 | float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); 51 | while (t < TimeToIncrease) 52 | { 53 | Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToIncrease)*FOVIncrease); 54 | t += Time.deltaTime; 55 | yield return new WaitForEndOfFrame(); 56 | } 57 | } 58 | 59 | 60 | public IEnumerator FOVKickDown() 61 | { 62 | float t = Mathf.Abs((Camera.fieldOfView - originalFov)/FOVIncrease); 63 | while (t > 0) 64 | { 65 | Camera.fieldOfView = originalFov + (IncreaseCurve.Evaluate(t/TimeToDecrease)*FOVIncrease); 66 | t -= Time.deltaTime; 67 | yield return new WaitForEndOfFrame(); 68 | } 69 | //make sure that fov returns to the original size 70 | Camera.fieldOfView = originalFov; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FOVKick.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6045a93fb05b9c74884821030da2c46c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FPSCounter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | [RequireComponent(typeof (GUIText))] 7 | public class FPSCounter : MonoBehaviour 8 | { 9 | const float fpsMeasurePeriod = 0.5f; 10 | private int m_FpsAccumulator = 0; 11 | private float m_FpsNextPeriod = 0; 12 | private int m_CurrentFps; 13 | const string display = "{0} FPS"; 14 | private GUIText m_GuiText; 15 | 16 | 17 | private void Start() 18 | { 19 | m_FpsNextPeriod = Time.realtimeSinceStartup + fpsMeasurePeriod; 20 | m_GuiText = GetComponent(); 21 | } 22 | 23 | 24 | private void Update() 25 | { 26 | // measure average frames per second 27 | m_FpsAccumulator++; 28 | if (Time.realtimeSinceStartup > m_FpsNextPeriod) 29 | { 30 | m_CurrentFps = (int) (m_FpsAccumulator/fpsMeasurePeriod); 31 | m_FpsAccumulator = 0; 32 | m_FpsNextPeriod += fpsMeasurePeriod; 33 | m_GuiText.text = string.Format(display, m_CurrentFps); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FPSCounter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22bbf57ec543cee42a5aa0ec2dd9e457 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FollowTarget.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class FollowTarget : MonoBehaviour 8 | { 9 | public Transform target; 10 | public Vector3 offset = new Vector3(0f, 7.5f, 0f); 11 | 12 | 13 | private void LateUpdate() 14 | { 15 | transform.position = target.position + offset; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/FollowTarget.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 246cc59c7a84ea44f87f6b70acfe30c5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ForcedReset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | [RequireComponent(typeof (GUITexture))] 6 | public class ForcedReset : MonoBehaviour 7 | { 8 | private void Update() 9 | { 10 | // if we have forced a reset ... 11 | if (CrossPlatformInputManager.GetButtonDown("ResetObject")) 12 | { 13 | //... reload the scene 14 | Application.LoadLevelAsync(Application.loadedLevelName); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ForcedReset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b886447cba80f74e820adb3c9e70c76 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/LerpControlledBob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | [Serializable] 8 | public class LerpControlledBob 9 | { 10 | public float BobDuration; 11 | public float BobAmount; 12 | 13 | private float m_Offset = 0f; 14 | 15 | 16 | // provides the offset that can be used 17 | public float Offset() 18 | { 19 | return m_Offset; 20 | } 21 | 22 | 23 | public IEnumerator DoBobCycle() 24 | { 25 | // make the camera move down slightly 26 | float t = 0f; 27 | while (t < BobDuration) 28 | { 29 | m_Offset = Mathf.Lerp(0f, BobAmount, t/BobDuration); 30 | t += Time.deltaTime; 31 | yield return new WaitForFixedUpdate(); 32 | } 33 | 34 | // make it move back to neutral 35 | t = 0f; 36 | while (t < BobDuration) 37 | { 38 | m_Offset = Mathf.Lerp(BobAmount, 0f, t/BobDuration); 39 | t += Time.deltaTime; 40 | yield return new WaitForFixedUpdate(); 41 | } 42 | m_Offset = 0f; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/LerpControlledBob.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1bbfafbde15c854681023b9e01e12dd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ObjectResetter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace UnityStandardAssets.Utility 7 | { 8 | public class ObjectResetter : MonoBehaviour 9 | { 10 | private Vector3 originalPosition; 11 | private Quaternion originalRotation; 12 | private List originalStructure; 13 | 14 | private Rigidbody Rigidbody; 15 | 16 | // Use this for initialization 17 | private void Start() 18 | { 19 | originalStructure = new List(GetComponentsInChildren()); 20 | originalPosition = transform.position; 21 | originalRotation = transform.rotation; 22 | 23 | Rigidbody = GetComponent(); 24 | } 25 | 26 | 27 | public void DelayedReset(float delay) 28 | { 29 | StartCoroutine(ResetCoroutine(delay)); 30 | } 31 | 32 | 33 | public IEnumerator ResetCoroutine(float delay) 34 | { 35 | yield return new WaitForSeconds(delay); 36 | 37 | // remove any gameobjects added (fire, skid trails, etc) 38 | foreach (var t in GetComponentsInChildren()) 39 | { 40 | if (!originalStructure.Contains(t)) 41 | { 42 | t.parent = null; 43 | } 44 | } 45 | 46 | transform.position = originalPosition; 47 | transform.rotation = originalRotation; 48 | if (Rigidbody) 49 | { 50 | Rigidbody.velocity = Vector3.zero; 51 | Rigidbody.angularVelocity = Vector3.zero; 52 | } 53 | 54 | SendMessage("Reset"); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ObjectResetter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 643c971818f68d3439e84b5d8bdafe07 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ParticleSystemDestroyer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using Random = UnityEngine.Random; 5 | 6 | namespace UnityStandardAssets.Utility 7 | { 8 | public class ParticleSystemDestroyer : MonoBehaviour 9 | { 10 | // allows a particle system to exist for a specified duration, 11 | // then shuts off emission, and waits for all particles to expire 12 | // before destroying the gameObject 13 | 14 | public float minDuration = 8; 15 | public float maxDuration = 10; 16 | 17 | private float m_MaxLifetime; 18 | private bool m_EarlyStop; 19 | 20 | 21 | private IEnumerator Start() 22 | { 23 | var systems = GetComponentsInChildren(); 24 | 25 | // find out the maximum lifetime of any particles in this effect 26 | foreach (var system in systems) 27 | { 28 | m_MaxLifetime = Mathf.Max(system.startLifetime, m_MaxLifetime); 29 | } 30 | 31 | // wait for random duration 32 | 33 | float stopTime = Time.time + Random.Range(minDuration, maxDuration); 34 | 35 | while (Time.time < stopTime || m_EarlyStop) 36 | { 37 | yield return null; 38 | } 39 | Debug.Log("stopping " + name); 40 | 41 | // turn off emission 42 | foreach (var system in systems) 43 | { 44 | system.enableEmission = false; 45 | } 46 | BroadcastMessage("Extinguish", SendMessageOptions.DontRequireReceiver); 47 | 48 | // wait for any remaining particles to expire 49 | yield return new WaitForSeconds(m_MaxLifetime); 50 | 51 | Destroy(gameObject); 52 | } 53 | 54 | 55 | public void Stop() 56 | { 57 | // stops the particle system early 58 | m_EarlyStop = true; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/ParticleSystemDestroyer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29014cd42b6d273408e0ceefd336c0b3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/PlatformSpecificContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | 7 | namespace UnityStandardAssets.Utility 8 | { 9 | #if UNITY_EDITOR 10 | 11 | [ExecuteInEditMode] 12 | #endif 13 | public class PlatformSpecificContent : MonoBehaviour 14 | { 15 | private enum BuildTargetGroup 16 | { 17 | Standalone, 18 | Mobile 19 | } 20 | 21 | [SerializeField] private BuildTargetGroup m_BuildTargetGroup; 22 | [SerializeField] private GameObject[] m_Content = new GameObject[0]; 23 | [SerializeField] private MonoBehaviour[] m_MonoBehaviours = new MonoBehaviour[0]; 24 | [SerializeField] private bool m_ChildrenOfThisObject; 25 | 26 | #if !UNITY_EDITOR 27 | void OnEnable() 28 | { 29 | CheckEnableContent(); 30 | } 31 | #endif 32 | 33 | #if UNITY_EDITOR 34 | 35 | private void OnEnable() 36 | { 37 | EditorUserBuildSettings.activeBuildTargetChanged += Update; 38 | EditorApplication.update += Update; 39 | } 40 | 41 | 42 | private void OnDisable() 43 | { 44 | EditorUserBuildSettings.activeBuildTargetChanged -= Update; 45 | EditorApplication.update -= Update; 46 | } 47 | 48 | 49 | private void Update() 50 | { 51 | CheckEnableContent(); 52 | } 53 | #endif 54 | 55 | 56 | private void CheckEnableContent() 57 | { 58 | #if (UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY ) 59 | if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 60 | { 61 | EnableContent(true); 62 | } else { 63 | EnableContent(false); 64 | } 65 | #endif 66 | 67 | #if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY ) 68 | if (m_BuildTargetGroup == BuildTargetGroup.Mobile) 69 | { 70 | EnableContent(false); 71 | } 72 | else 73 | { 74 | EnableContent(true); 75 | } 76 | #endif 77 | } 78 | 79 | 80 | private void EnableContent(bool enabled) 81 | { 82 | if (m_Content.Length > 0) 83 | { 84 | foreach (var g in m_Content) 85 | { 86 | if (g != null) 87 | { 88 | g.SetActive(enabled); 89 | } 90 | } 91 | } 92 | if (m_ChildrenOfThisObject) 93 | { 94 | foreach (Transform t in transform) 95 | { 96 | t.gameObject.SetActive(enabled); 97 | } 98 | } 99 | if (m_MonoBehaviours.Length > 0) 100 | { 101 | foreach (var monoBehaviour in m_MonoBehaviours) 102 | { 103 | monoBehaviour.enabled = enabled; 104 | } 105 | } 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/PlatformSpecificContent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b27507c5d0efbbd47ac8c1de9a1a0a35 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b43a4ef15621158419a2b639f7a98245 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/Prefabs/FramerateCounter.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 132: {fileID: 13200000} 12 | - 114: {fileID: 11400000} 13 | m_Layer: 0 14 | m_Name: FramerateCounter 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &400000 21 | Transform: 22 | m_ObjectHideFlags: 1 23 | m_PrefabParentObject: {fileID: 0} 24 | m_PrefabInternal: {fileID: 100100000} 25 | m_GameObject: {fileID: 100000} 26 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 27 | m_LocalPosition: {x: .5, y: 1, z: 0} 28 | m_LocalScale: {x: 1, y: 1, z: 1} 29 | m_Children: [] 30 | m_Father: {fileID: 0} 31 | m_RootOrder: 0 32 | --- !u!114 &11400000 33 | MonoBehaviour: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 100000} 38 | m_Enabled: 1 39 | m_EditorHideFlags: 0 40 | m_Script: {fileID: 11500000, guid: 22bbf57ec543cee42a5aa0ec2dd9e457, type: 3} 41 | m_Name: 42 | m_EditorClassIdentifier: 43 | --- !u!132 &13200000 44 | GUIText: 45 | m_ObjectHideFlags: 1 46 | m_PrefabParentObject: {fileID: 0} 47 | m_PrefabInternal: {fileID: 100100000} 48 | m_GameObject: {fileID: 100000} 49 | m_Enabled: 1 50 | serializedVersion: 3 51 | m_Text: FPS 52 | m_Anchor: 1 53 | m_Alignment: 1 54 | m_PixelOffset: {x: 0, y: 0} 55 | m_LineSpacing: 1 56 | m_TabSize: 4 57 | m_Font: {fileID: 12800000, guid: b51a3e520f9164da198dc59c8acfccd6, type: 3} 58 | m_Material: {fileID: 0} 59 | m_FontSize: 0 60 | m_FontStyle: 0 61 | m_Color: 62 | serializedVersion: 2 63 | rgba: 4294967295 64 | m_PixelCorrect: 1 65 | m_RichText: 1 66 | --- !u!1001 &100100000 67 | Prefab: 68 | m_ObjectHideFlags: 1 69 | serializedVersion: 2 70 | m_Modification: 71 | m_TransformParent: {fileID: 0} 72 | m_Modifications: [] 73 | m_RemovedComponents: [] 74 | m_ParentPrefab: {fileID: 0} 75 | m_RootGameObject: {fileID: 100000} 76 | m_IsPrefabParent: 1 77 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/Prefabs/FramerateCounter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81154777d5417884981849c5243f6c01 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleActivatorMenu.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class SimpleActivatorMenu : MonoBehaviour 7 | { 8 | // An incredibly simple menu which, when given references 9 | // to gameobjects in the scene 10 | public GUIText camSwitchButton; 11 | public GameObject[] objects; 12 | 13 | 14 | private int m_CurrentActiveObject; 15 | 16 | 17 | private void OnEnable() 18 | { 19 | // active object starts from first in array 20 | m_CurrentActiveObject = 0; 21 | camSwitchButton.text = objects[m_CurrentActiveObject].name; 22 | } 23 | 24 | 25 | public void NextCamera() 26 | { 27 | int nextactiveobject = m_CurrentActiveObject + 1 >= objects.Length ? 0 : m_CurrentActiveObject + 1; 28 | 29 | for (int i = 0; i < objects.Length; i++) 30 | { 31 | objects[i].SetActive(i == nextactiveobject); 32 | } 33 | 34 | m_CurrentActiveObject = nextactiveobject; 35 | camSwitchButton.text = objects[m_CurrentActiveObject].name; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleActivatorMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69b69a5b0e0a85b4aa97a7edc40c37d1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleMouseRotator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityStandardAssets.CrossPlatformInput; 4 | 5 | namespace UnityStandardAssets.Utility 6 | { 7 | public class SimpleMouseRotator : MonoBehaviour 8 | { 9 | // A mouselook behaviour with constraints which operate relative to 10 | // this gameobject's initial rotation. 11 | // Only rotates around local X and Y. 12 | // Works in local coordinates, so if this object is parented 13 | // to another moving gameobject, its local constraints will 14 | // operate correctly 15 | // (Think: looking out the side window of a car, or a gun turret 16 | // on a moving spaceship with a limited angular range) 17 | // to have no constraints on an axis, set the rotationRange to 360 or greater. 18 | public Vector2 rotationRange = new Vector3(70, 70); 19 | public float rotationSpeed = 10; 20 | public float dampingTime = 0.2f; 21 | public bool autoZeroVerticalOnMobile = true; 22 | public bool autoZeroHorizontalOnMobile = false; 23 | public bool relative = true; 24 | 25 | 26 | private Vector3 m_TargetAngles; 27 | private Vector3 m_FollowAngles; 28 | private Vector3 m_FollowVelocity; 29 | private Quaternion m_OriginalRotation; 30 | 31 | 32 | private void Start() 33 | { 34 | m_OriginalRotation = transform.localRotation; 35 | } 36 | 37 | 38 | private void Update() 39 | { 40 | // we make initial calculations from the original local rotation 41 | transform.localRotation = m_OriginalRotation; 42 | 43 | // read input from mouse or mobile controls 44 | float inputH; 45 | float inputV; 46 | if (relative) 47 | { 48 | inputH = CrossPlatformInputManager.GetAxis("Mouse X"); 49 | inputV = CrossPlatformInputManager.GetAxis("Mouse Y"); 50 | 51 | // wrap values to avoid springing quickly the wrong way from positive to negative 52 | if (m_TargetAngles.y > 180) 53 | { 54 | m_TargetAngles.y -= 360; 55 | m_FollowAngles.y -= 360; 56 | } 57 | if (m_TargetAngles.x > 180) 58 | { 59 | m_TargetAngles.x -= 360; 60 | m_FollowAngles.x -= 360; 61 | } 62 | if (m_TargetAngles.y < -180) 63 | { 64 | m_TargetAngles.y += 360; 65 | m_FollowAngles.y += 360; 66 | } 67 | if (m_TargetAngles.x < -180) 68 | { 69 | m_TargetAngles.x += 360; 70 | m_FollowAngles.x += 360; 71 | } 72 | 73 | #if MOBILE_INPUT 74 | // on mobile, sometimes we want input mapped directly to tilt value, 75 | // so it springs back automatically when the look input is released. 76 | if (autoZeroHorizontalOnMobile) { 77 | m_TargetAngles.y = Mathf.Lerp (-rotationRange.y * 0.5f, rotationRange.y * 0.5f, inputH * .5f + .5f); 78 | } else { 79 | m_TargetAngles.y += inputH * rotationSpeed; 80 | } 81 | if (autoZeroVerticalOnMobile) { 82 | m_TargetAngles.x = Mathf.Lerp (-rotationRange.x * 0.5f, rotationRange.x * 0.5f, inputV * .5f + .5f); 83 | } else { 84 | m_TargetAngles.x += inputV * rotationSpeed; 85 | } 86 | #else 87 | // with mouse input, we have direct control with no springback required. 88 | m_TargetAngles.y += inputH*rotationSpeed; 89 | m_TargetAngles.x += inputV*rotationSpeed; 90 | #endif 91 | 92 | // clamp values to allowed range 93 | m_TargetAngles.y = Mathf.Clamp(m_TargetAngles.y, -rotationRange.y*0.5f, rotationRange.y*0.5f); 94 | m_TargetAngles.x = Mathf.Clamp(m_TargetAngles.x, -rotationRange.x*0.5f, rotationRange.x*0.5f); 95 | } 96 | else 97 | { 98 | inputH = Input.mousePosition.x; 99 | inputV = Input.mousePosition.y; 100 | 101 | // set values to allowed range 102 | m_TargetAngles.y = Mathf.Lerp(-rotationRange.y*0.5f, rotationRange.y*0.5f, inputH/Screen.width); 103 | m_TargetAngles.x = Mathf.Lerp(-rotationRange.x*0.5f, rotationRange.x*0.5f, inputV/Screen.height); 104 | } 105 | 106 | // smoothly interpolate current values to target angles 107 | m_FollowAngles = Vector3.SmoothDamp(m_FollowAngles, m_TargetAngles, ref m_FollowVelocity, dampingTime); 108 | 109 | // update the actual gameobject's rotation 110 | transform.localRotation = m_OriginalRotation*Quaternion.Euler(-m_FollowAngles.x, m_FollowAngles.y, 0); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SimpleMouseRotator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cadd54e4832aeef4b9359f44cbe335cd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SmoothFollow.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityStandardAssets.Utility 4 | { 5 | public class SmoothFollow : MonoBehaviour 6 | { 7 | 8 | // The target we are following 9 | [SerializeField] 10 | private Transform target; 11 | // The distance in the x-z plane to the target 12 | [SerializeField] 13 | private float distance = 10.0f; 14 | // the height we want the camera to be above the target 15 | [SerializeField] 16 | private float height = 5.0f; 17 | 18 | [SerializeField] 19 | private float rotationDamping; 20 | [SerializeField] 21 | private float heightDamping; 22 | 23 | // Use this for initialization 24 | void Start() { } 25 | 26 | // Update is called once per frame 27 | void LateUpdate() 28 | { 29 | // Early out if we don't have a target 30 | if (!target) 31 | return; 32 | 33 | // Calculate the current rotation angles 34 | var wantedRotationAngle = target.eulerAngles.y; 35 | var wantedHeight = target.position.y + height; 36 | 37 | var currentRotationAngle = transform.eulerAngles.y; 38 | var currentHeight = transform.position.y; 39 | 40 | // Damp the rotation around the y-axis 41 | currentRotationAngle = Mathf.LerpAngle(currentRotationAngle, wantedRotationAngle, rotationDamping * Time.deltaTime); 42 | 43 | // Damp the height 44 | currentHeight = Mathf.Lerp(currentHeight, wantedHeight, heightDamping * Time.deltaTime); 45 | 46 | // Convert the angle into a rotation 47 | var currentRotation = Quaternion.Euler(0, currentRotationAngle, 0); 48 | 49 | // Set the position of the camera on the x-z plane to: 50 | // distance meters behind the target 51 | transform.position = target.position; 52 | transform.position -= currentRotation * Vector3.forward * distance; 53 | 54 | // Set the height of the camera 55 | transform.position = new Vector3(transform.position.x ,currentHeight , transform.position.z); 56 | 57 | // Always look at the target 58 | transform.LookAt(target); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/SmoothFollow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f76806479d916a64aa03f8e3eba7912f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectActivator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a7cedf246fca744f90cbdc9dbe41166 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectDestructor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityStandardAssets.Utility 5 | { 6 | public class TimedObjectDestructor : MonoBehaviour 7 | { 8 | [SerializeField] private float m_TimeOut = 1.0f; 9 | [SerializeField] private bool m_DetachChildren = false; 10 | 11 | 12 | private void Awake() 13 | { 14 | Invoke("DestroyNow", m_TimeOut); 15 | } 16 | 17 | 18 | private void DestroyNow() 19 | { 20 | if (m_DetachChildren) 21 | { 22 | transform.DetachChildren(); 23 | } 24 | DestroyObject(gameObject); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/TimedObjectDestructor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37fac21d1f093d344816942d1abce94e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/WaypointCircuit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70852dc981465ea48bb527b9e33a87fd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Utility/WaypointProgressTracker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5cb22d331ef7d64796f917c6a455a32 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/ThirdPartyAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b11f1bc39310bc1448357441e80e7b6c 3 | folderAsset: yes 4 | timeCreated: 1441120227 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/WrapAroundScreen.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | /// 3 | /// code inspired from the algorithm presented in http://gamedevelopment.tutsplus.com/articles/create-an-asteroids-like-screen-wrapping-effect-with-unity--gamedev-15055 4 | /// 5 | public class WrapAroundScreen : MonoBehaviour 6 | { 7 | 8 | private float _offset = 0.5f; 9 | private Renderer[] _renderers; 10 | // Use this for initialization 11 | void Start () 12 | { 13 | _renderers = GetComponentsInChildren(); 14 | } 15 | 16 | // Update is called once per frame 17 | void Update () 18 | { 19 | 20 | bool isVisible = IsVisible(); 21 | bool wrappingX=false, wrappingY =false; 22 | if (isVisible) 23 | { 24 | 25 | wrappingX = wrappingY = false; 26 | return; 27 | } 28 | if (wrappingX && wrappingY) 29 | { 30 | 31 | return; 32 | } 33 | Vector2 pos = transform.position; 34 | 35 | Vector2 viewPortPos = Camera.main.WorldToViewportPoint(pos); 36 | if (!wrappingX && (viewPortPos.x > 1 || viewPortPos.x < 0)) 37 | { 38 | 39 | pos.x = -pos.x; 40 | 41 | wrappingX = true; 42 | } 43 | if (!wrappingY && (viewPortPos.y > 1 || viewPortPos.y < 0)) 44 | { 45 | pos.y = -pos.y; 46 | 47 | wrappingY = true; 48 | } 49 | transform.position = pos; 50 | //left edge of the screen? 51 | 52 | } 53 | 54 | bool IsVisible() 55 | { 56 | foreach (Renderer r in _renderers) 57 | { 58 | if (r.isVisible) 59 | { 60 | return true; 61 | } 62 | } 63 | return false; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Assets/WrapAroundScreen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25040b4707d4f8c4d9266e1408242752 3 | timeCreated: 1441061942 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/testingGhosting.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Assets.Scripts.game.sfx; 3 | 4 | 5 | /// 6 | /// This script should be attached to a target object with a sprite renderer. 7 | /// 8 | public class testingGhosting : MonoBehaviour 9 | { 10 | #region ghosting effec fields 11 | public Color GhostTintColor; 12 | private GhostingContainer _gcContainer; 13 | private SpriteRenderer _srSpriteRenderer; 14 | public float EffectDuration; //how long does the effect last for? 15 | public float SpawnRate; //How fast do new ghosts spawn? 16 | public int MaxGhosts;//the maximum number of ghosts in any given time. 17 | private Animator _animator; 18 | #endregion 19 | 20 | public float Speed; //speed of the player object. 21 | private Vector3 _originalpos; //the original position of the player 22 | void Start() 23 | { 24 | _gcContainer = GetComponent(); 25 | _srSpriteRenderer = GetComponent(); 26 | _originalpos = transform.position; 27 | _animator = GetComponent (); 28 | _animator.SetBool ("Ground", true); 29 | _animator.SetFloat ("Speed",0.2f); 30 | } 31 | 32 | 33 | // Update is called once per frame 34 | void Update() 35 | { 36 | 37 | if (Input.GetKeyDown(KeyCode.F1)) 38 | _gcContainer.Init(MaxGhosts, SpawnRate, _srSpriteRenderer, EffectDuration,GhostTintColor ); //initiate the ghosting routine 39 | if (Input.GetKeyDown(KeyCode.F2)) 40 | _gcContainer.StopEffect(); 41 | if (Input.GetKeyDown(KeyCode.F3)) 42 | transform.position = _originalpos; 43 | transform.position += (Speed * Time.deltaTime) * Vector3.right; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/testingGhosting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55fdb806b708ea04ba93a7eb633d7709 3 | timeCreated: 1440992128 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityGhostingEffect 2 | A visual effect for unity that leaves a series of transparent copies of sprites behind 3 | 4 | ## How do I install it? 5 | Download the files and open the project in Unity or place them in your own project. Just make sure to leave the Resources folder intact 6 | ## How do I use it? 7 | Attach `GhostingContainer.cs` to a game object that contains a SpriteRenderer. 8 | To start the ghost effect pass in these parameters to the GhostingContainer's init function 9 | 10 | 1. The maximum number of ghosts, of course the more you want the bigger the hit on game performance 11 | 2. Spawning rate: the rate at which the "ghosts" spawn behind your target 12 | 3. The sprite renderer of the target in question. 13 | 4. ~~The duration of the effect: how long do you want the effect to last for?~~ **No longer in use because I had to change the algorithm. This was causing problems as the effect wasn't lining up properly with the number of ghosts on screen but again. I'm not removing this parameter as some people are still using this function and don't want to break their code. I appologize for the inconvienience.** 14 | 5. (Optional ) pass in a color parameter to set the ghosts to a different color. 15 | 16 | 17 | 18 | ## Contributing 19 | 1. Fork it! 20 | 2. Create your feature branch: `git checkout -b my-new-feature` 21 | 3. Commit your changes: `git commit -am 'Add some feature'` 22 | 4. Push to the branch: `git push origin my-new-feature` 23 | 5. Submit a pull request :D 24 | --------------------------------------------------------------------------------