├── .gitattributes ├── .gitignore ├── ExampleProject ├── Assets │ ├── Art.meta │ ├── Art │ │ ├── Body.png │ │ ├── Body.png.meta │ │ ├── Coin.png │ │ ├── Coin.png.meta │ │ ├── GravItemMaterial.mat │ │ └── GravItemMaterial.mat.meta │ ├── Plugins.meta │ ├── Plugins │ │ └── Editor.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── 2D Planet Gravity.unity │ │ ├── 2D Planet Gravity.unity.meta │ │ ├── 3D Planet Gravity.unity │ │ └── 3D Planet Gravity.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── DirectionalGravity.cs │ │ ├── DirectionalGravity.cs.meta │ │ ├── DirectionalGravity2D.cs │ │ ├── DirectionalGravity2D.cs.meta │ │ ├── GravityItem.cs │ │ ├── GravityItem.cs.meta │ │ ├── GravityItem2D.cs │ │ ├── GravityItem2D.cs.meta │ │ ├── Interfaces.meta │ │ ├── Interfaces │ │ ├── IGravitySource.cs │ │ ├── IGravitySource.cs.meta │ │ ├── IGravitySource2D.cs │ │ └── IGravitySource2D.cs.meta │ │ ├── PlanetGravity.cs │ │ ├── PlanetGravity.cs.meta │ │ ├── PlanetGravity2D.cs │ │ └── PlanetGravity2D.cs.meta ├── Logs │ └── Packages-Update.log ├── Packages │ └── manifest.json └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── XRSettings.asset ├── INSTALLING.md ├── LICENSE ├── Packages ├── PlanetGravityPackage-v1.0.0.unitypackage ├── UnityCustomGravity-v1.1.0.unitypackage ├── UnityGravitySystem-v2.0.0.unitypackage ├── UnityGravitySystem-v2.1.0.unitypackage └── UnityGravitySystem-v2.2.0.unitypackage └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Folders 2 | [Ll]ibrary/ 3 | [Tt]emp/ 4 | [Oo]bj/ 5 | [Bb]uild/ 6 | [Bb]uilds/ 7 | [Ss]ite/ 8 | [Ss]ites/ 9 | [Aa]sset[Ss]tore[Tt]ools* 10 | 11 | # Visual Studio cache directory 12 | .vs/ 13 | 14 | # JetBrains Rider directory 15 | .idea/ 16 | JetBrains/ 17 | 18 | # Autogenerated VS/MD/Consulo solution and project files 19 | ExportedObj/ 20 | .consulo/ 21 | *.csproj 22 | *.unityproj 23 | *.sln 24 | *.suo 25 | *.tmp 26 | *.user 27 | *.userprefs 28 | *.pidb 29 | *.booproj 30 | *.svd 31 | *.pdb 32 | *.opendb 33 | 34 | # Unity3D generated meta files 35 | *.pidb.meta 36 | *.pdb.meta 37 | JetBrains.meta 38 | 39 | # Unity3D Generated File On Crash Reports 40 | sysinfo.txt 41 | 42 | # Builds 43 | *.apk 44 | 45 | # Other 46 | *.ahbuildinfo 47 | [Ss]erialized[Bb]uild[Ii]nfo/ -------------------------------------------------------------------------------- /ExampleProject/Assets/Art.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2c66e81906938b449b412759660e1e9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Art/Body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WSWhitehouse/Unity-Gravity-System/5f2bf6119bf7529ef369b0706683808b5e604b81/ExampleProject/Assets/Art/Body.png -------------------------------------------------------------------------------- /ExampleProject/Assets/Art/Body.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c96f177bc0299e14498aba02f4c34409 3 | timeCreated: 1489846171 4 | licenseType: Store 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | spriteSheet: 62 | serializedVersion: 2 63 | sprites: [] 64 | outline: [] 65 | spritePackingTag: 66 | userData: 67 | assetBundleName: 68 | assetBundleVariant: 69 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Art/Coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WSWhitehouse/Unity-Gravity-System/5f2bf6119bf7529ef369b0706683808b5e604b81/ExampleProject/Assets/Art/Coin.png -------------------------------------------------------------------------------- /ExampleProject/Assets/Art/Coin.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ed5157cf45e6ee409511594fb89377b 3 | timeCreated: 1489846160 4 | licenseType: Store 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | spriteSheet: 62 | serializedVersion: 2 63 | sprites: [] 64 | outline: [] 65 | spritePackingTag: 66 | userData: 67 | assetBundleName: 68 | assetBundleVariant: 69 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Art/GravItemMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: GravItemMaterial 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0.10661459, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Art/GravItemMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00767846374b713469b6d4599130e3d3 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 855513e1cd4ae954a930075a9190f3a2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Plugins/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 517753c6691ea0247b8056a032f6314b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a1e870b3f6836f43823c19645590751 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Scenes/2D Planet Gravity.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ShowResolutionOverlay: 1 98 | m_ExportTrainingData: 0 99 | m_LightingDataAsset: {fileID: 0} 100 | m_UseShadowmask: 1 101 | --- !u!196 &4 102 | NavMeshSettings: 103 | serializedVersion: 2 104 | m_ObjectHideFlags: 0 105 | m_BuildSettings: 106 | serializedVersion: 2 107 | agentTypeID: 0 108 | agentRadius: 0.5 109 | agentHeight: 2 110 | agentSlope: 45 111 | agentClimb: 0.4 112 | ledgeDropHeight: 0 113 | maxJumpAcrossDistance: 0 114 | minRegionArea: 2 115 | manualCellSize: 0 116 | cellSize: 0.16666667 117 | manualTileSize: 0 118 | tileSize: 256 119 | accuratePlacement: 0 120 | debug: 121 | m_Flags: 0 122 | m_NavMeshData: {fileID: 0} 123 | --- !u!1 &146155150 124 | GameObject: 125 | m_ObjectHideFlags: 0 126 | m_CorrespondingSourceObject: {fileID: 0} 127 | m_PrefabInstance: {fileID: 0} 128 | m_PrefabAsset: {fileID: 0} 129 | serializedVersion: 6 130 | m_Component: 131 | - component: {fileID: 146155151} 132 | - component: {fileID: 146155152} 133 | - component: {fileID: 146155153} 134 | m_Layer: 0 135 | m_Name: PlanetGravity 136 | m_TagString: Untagged 137 | m_Icon: {fileID: 0} 138 | m_NavMeshLayer: 0 139 | m_StaticEditorFlags: 0 140 | m_IsActive: 1 141 | --- !u!4 &146155151 142 | Transform: 143 | m_ObjectHideFlags: 0 144 | m_CorrespondingSourceObject: {fileID: 0} 145 | m_PrefabInstance: {fileID: 0} 146 | m_PrefabAsset: {fileID: 0} 147 | m_GameObject: {fileID: 146155150} 148 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 149 | m_LocalPosition: {x: 0, y: 0, z: 0} 150 | m_LocalScale: {x: 1, y: 1, z: 1} 151 | m_Children: [] 152 | m_Father: {fileID: 1979611595} 153 | m_RootOrder: 1 154 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 155 | --- !u!58 &146155152 156 | CircleCollider2D: 157 | m_ObjectHideFlags: 0 158 | m_CorrespondingSourceObject: {fileID: 0} 159 | m_PrefabInstance: {fileID: 0} 160 | m_PrefabAsset: {fileID: 0} 161 | m_GameObject: {fileID: 146155150} 162 | m_Enabled: 1 163 | m_Density: 1 164 | m_Material: {fileID: 0} 165 | m_IsTrigger: 1 166 | m_UsedByEffector: 0 167 | m_UsedByComposite: 0 168 | m_Offset: {x: 0, y: 0} 169 | serializedVersion: 2 170 | m_Radius: 3.5 171 | --- !u!114 &146155153 172 | MonoBehaviour: 173 | m_ObjectHideFlags: 0 174 | m_CorrespondingSourceObject: {fileID: 0} 175 | m_PrefabInstance: {fileID: 0} 176 | m_PrefabAsset: {fileID: 0} 177 | m_GameObject: {fileID: 146155150} 178 | m_Enabled: 1 179 | m_EditorHideFlags: 0 180 | m_Script: {fileID: 11500000, guid: 6cab4c5a50664a649f1639d1ec3906c2, type: 3} 181 | m_Name: 182 | m_EditorClassIdentifier: 183 | gravityStrength: 9.8 184 | radius: 5 185 | enableDebug: 1 186 | --- !u!1 &367176082 187 | GameObject: 188 | m_ObjectHideFlags: 0 189 | m_CorrespondingSourceObject: {fileID: 0} 190 | m_PrefabInstance: {fileID: 0} 191 | m_PrefabAsset: {fileID: 0} 192 | serializedVersion: 6 193 | m_Component: 194 | - component: {fileID: 367176087} 195 | - component: {fileID: 367176086} 196 | - component: {fileID: 367176085} 197 | - component: {fileID: 367176084} 198 | - component: {fileID: 367176083} 199 | m_Layer: 0 200 | m_Name: GravityItem2D (4) 201 | m_TagString: Untagged 202 | m_Icon: {fileID: 0} 203 | m_NavMeshLayer: 0 204 | m_StaticEditorFlags: 0 205 | m_IsActive: 1 206 | --- !u!114 &367176083 207 | MonoBehaviour: 208 | m_ObjectHideFlags: 0 209 | m_CorrespondingSourceObject: {fileID: 0} 210 | m_PrefabInstance: {fileID: 0} 211 | m_PrefabAsset: {fileID: 0} 212 | m_GameObject: {fileID: 367176082} 213 | m_Enabled: 1 214 | m_EditorHideFlags: 0 215 | m_Script: {fileID: 11500000, guid: 02da70da7d2da1a44b5988e9521d8de4, type: 3} 216 | m_Name: 217 | m_EditorClassIdentifier: 218 | Up: {x: 0, y: 1} 219 | ActiveFieldCount: 0 220 | CurrentDistance: Infinity 221 | RotateToGround: 0 222 | --- !u!50 &367176084 223 | Rigidbody2D: 224 | serializedVersion: 4 225 | m_ObjectHideFlags: 0 226 | m_CorrespondingSourceObject: {fileID: 0} 227 | m_PrefabInstance: {fileID: 0} 228 | m_PrefabAsset: {fileID: 0} 229 | m_GameObject: {fileID: 367176082} 230 | m_BodyType: 0 231 | m_Simulated: 1 232 | m_UseFullKinematicContacts: 0 233 | m_UseAutoMass: 0 234 | m_Mass: 1 235 | m_LinearDrag: 0 236 | m_AngularDrag: 0.05 237 | m_GravityScale: 1 238 | m_Material: {fileID: 0} 239 | m_Interpolate: 0 240 | m_SleepingMode: 1 241 | m_CollisionDetection: 0 242 | m_Constraints: 0 243 | --- !u!61 &367176085 244 | BoxCollider2D: 245 | m_ObjectHideFlags: 0 246 | m_CorrespondingSourceObject: {fileID: 0} 247 | m_PrefabInstance: {fileID: 0} 248 | m_PrefabAsset: {fileID: 0} 249 | m_GameObject: {fileID: 367176082} 250 | m_Enabled: 1 251 | m_Density: 1 252 | m_Material: {fileID: 0} 253 | m_IsTrigger: 0 254 | m_UsedByEffector: 0 255 | m_UsedByComposite: 0 256 | m_Offset: {x: 0, y: 0} 257 | m_SpriteTilingProperty: 258 | border: {x: 0, y: 0, z: 0, w: 0} 259 | pivot: {x: 0.5, y: 0.5} 260 | oldSize: {x: 1.28, y: 1.28} 261 | newSize: {x: 2.56, y: 2.56} 262 | adaptiveTilingThreshold: 0.5 263 | drawMode: 0 264 | adaptiveTiling: 0 265 | m_AutoTiling: 0 266 | serializedVersion: 2 267 | m_Size: {x: 1.28, y: 1.28} 268 | m_EdgeRadius: 0 269 | --- !u!212 &367176086 270 | SpriteRenderer: 271 | m_ObjectHideFlags: 0 272 | m_CorrespondingSourceObject: {fileID: 0} 273 | m_PrefabInstance: {fileID: 0} 274 | m_PrefabAsset: {fileID: 0} 275 | m_GameObject: {fileID: 367176082} 276 | m_Enabled: 1 277 | m_CastShadows: 0 278 | m_ReceiveShadows: 0 279 | m_DynamicOccludee: 1 280 | m_MotionVectors: 1 281 | m_LightProbeUsage: 1 282 | m_ReflectionProbeUsage: 1 283 | m_RenderingLayerMask: 1 284 | m_RendererPriority: 0 285 | m_Materials: 286 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 287 | m_StaticBatchInfo: 288 | firstSubMesh: 0 289 | subMeshCount: 0 290 | m_StaticBatchRoot: {fileID: 0} 291 | m_ProbeAnchor: {fileID: 0} 292 | m_LightProbeVolumeOverride: {fileID: 0} 293 | m_ScaleInLightmap: 1 294 | m_PreserveUVs: 0 295 | m_IgnoreNormalsForChartDetection: 0 296 | m_ImportantGI: 0 297 | m_StitchLightmapSeams: 1 298 | m_SelectedEditorRenderState: 0 299 | m_MinimumChartSize: 4 300 | m_AutoUVMaxDistance: 0.5 301 | m_AutoUVMaxAngle: 89 302 | m_LightmapParameters: {fileID: 0} 303 | m_SortingLayerID: 0 304 | m_SortingLayer: 0 305 | m_SortingOrder: 0 306 | m_Sprite: {fileID: 21300000, guid: 5ed5157cf45e6ee409511594fb89377b, type: 3} 307 | m_Color: {r: 1, g: 1, b: 1, a: 1} 308 | m_FlipX: 0 309 | m_FlipY: 0 310 | m_DrawMode: 0 311 | m_Size: {x: 2.56, y: 2.56} 312 | m_AdaptiveModeThreshold: 0.5 313 | m_SpriteTileMode: 0 314 | m_WasSpriteAssigned: 1 315 | m_MaskInteraction: 0 316 | m_SpriteSortPoint: 0 317 | --- !u!4 &367176087 318 | Transform: 319 | m_ObjectHideFlags: 0 320 | m_CorrespondingSourceObject: {fileID: 0} 321 | m_PrefabInstance: {fileID: 0} 322 | m_PrefabAsset: {fileID: 0} 323 | m_GameObject: {fileID: 367176082} 324 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 325 | m_LocalPosition: {x: 1.94, y: -1.87, z: 0} 326 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 327 | m_Children: [] 328 | m_Father: {fileID: 0} 329 | m_RootOrder: 6 330 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 331 | --- !u!1 &464719866 332 | GameObject: 333 | m_ObjectHideFlags: 0 334 | m_CorrespondingSourceObject: {fileID: 0} 335 | m_PrefabInstance: {fileID: 0} 336 | m_PrefabAsset: {fileID: 0} 337 | serializedVersion: 6 338 | m_Component: 339 | - component: {fileID: 464719867} 340 | - component: {fileID: 464719869} 341 | - component: {fileID: 464719868} 342 | m_Layer: 0 343 | m_Name: Art 344 | m_TagString: Untagged 345 | m_Icon: {fileID: 0} 346 | m_NavMeshLayer: 0 347 | m_StaticEditorFlags: 0 348 | m_IsActive: 1 349 | --- !u!4 &464719867 350 | Transform: 351 | m_ObjectHideFlags: 0 352 | m_CorrespondingSourceObject: {fileID: 0} 353 | m_PrefabInstance: {fileID: 0} 354 | m_PrefabAsset: {fileID: 0} 355 | m_GameObject: {fileID: 464719866} 356 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 357 | m_LocalPosition: {x: 0, y: 0, z: 0} 358 | m_LocalScale: {x: 1, y: 1, z: 1} 359 | m_Children: [] 360 | m_Father: {fileID: 1979611595} 361 | m_RootOrder: 0 362 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 363 | --- !u!58 &464719868 364 | CircleCollider2D: 365 | m_ObjectHideFlags: 0 366 | m_CorrespondingSourceObject: {fileID: 0} 367 | m_PrefabInstance: {fileID: 0} 368 | m_PrefabAsset: {fileID: 0} 369 | m_GameObject: {fileID: 464719866} 370 | m_Enabled: 1 371 | m_Density: 1 372 | m_Material: {fileID: 0} 373 | m_IsTrigger: 0 374 | m_UsedByEffector: 0 375 | m_UsedByComposite: 0 376 | m_Offset: {x: 0, y: 0} 377 | serializedVersion: 2 378 | m_Radius: 1.285 379 | --- !u!212 &464719869 380 | SpriteRenderer: 381 | m_ObjectHideFlags: 0 382 | m_CorrespondingSourceObject: {fileID: 0} 383 | m_PrefabInstance: {fileID: 0} 384 | m_PrefabAsset: {fileID: 0} 385 | m_GameObject: {fileID: 464719866} 386 | m_Enabled: 1 387 | m_CastShadows: 0 388 | m_ReceiveShadows: 0 389 | m_DynamicOccludee: 1 390 | m_MotionVectors: 1 391 | m_LightProbeUsage: 1 392 | m_ReflectionProbeUsage: 1 393 | m_RenderingLayerMask: 1 394 | m_RendererPriority: 0 395 | m_Materials: 396 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 397 | m_StaticBatchInfo: 398 | firstSubMesh: 0 399 | subMeshCount: 0 400 | m_StaticBatchRoot: {fileID: 0} 401 | m_ProbeAnchor: {fileID: 0} 402 | m_LightProbeVolumeOverride: {fileID: 0} 403 | m_ScaleInLightmap: 1 404 | m_PreserveUVs: 0 405 | m_IgnoreNormalsForChartDetection: 0 406 | m_ImportantGI: 0 407 | m_StitchLightmapSeams: 1 408 | m_SelectedEditorRenderState: 0 409 | m_MinimumChartSize: 4 410 | m_AutoUVMaxDistance: 0.5 411 | m_AutoUVMaxAngle: 89 412 | m_LightmapParameters: {fileID: 0} 413 | m_SortingLayerID: 0 414 | m_SortingLayer: 0 415 | m_SortingOrder: 0 416 | m_Sprite: {fileID: 21300000, guid: c96f177bc0299e14498aba02f4c34409, type: 3} 417 | m_Color: {r: 1, g: 1, b: 1, a: 1} 418 | m_FlipX: 0 419 | m_FlipY: 0 420 | m_DrawMode: 0 421 | m_Size: {x: 20.48, y: 15.36} 422 | m_AdaptiveModeThreshold: 0.5 423 | m_SpriteTileMode: 0 424 | m_WasSpriteAssigned: 1 425 | m_MaskInteraction: 0 426 | m_SpriteSortPoint: 0 427 | --- !u!1 &670629396 428 | GameObject: 429 | m_ObjectHideFlags: 0 430 | m_CorrespondingSourceObject: {fileID: 0} 431 | m_PrefabInstance: {fileID: 0} 432 | m_PrefabAsset: {fileID: 0} 433 | serializedVersion: 6 434 | m_Component: 435 | - component: {fileID: 670629401} 436 | - component: {fileID: 670629400} 437 | - component: {fileID: 670629399} 438 | - component: {fileID: 670629398} 439 | - component: {fileID: 670629397} 440 | m_Layer: 0 441 | m_Name: GravityItem2D (3) 442 | m_TagString: Untagged 443 | m_Icon: {fileID: 0} 444 | m_NavMeshLayer: 0 445 | m_StaticEditorFlags: 0 446 | m_IsActive: 1 447 | --- !u!114 &670629397 448 | MonoBehaviour: 449 | m_ObjectHideFlags: 0 450 | m_CorrespondingSourceObject: {fileID: 0} 451 | m_PrefabInstance: {fileID: 0} 452 | m_PrefabAsset: {fileID: 0} 453 | m_GameObject: {fileID: 670629396} 454 | m_Enabled: 1 455 | m_EditorHideFlags: 0 456 | m_Script: {fileID: 11500000, guid: 02da70da7d2da1a44b5988e9521d8de4, type: 3} 457 | m_Name: 458 | m_EditorClassIdentifier: 459 | Up: {x: 0, y: 1} 460 | ActiveFieldCount: 0 461 | CurrentDistance: Infinity 462 | RotateToGround: 0 463 | --- !u!50 &670629398 464 | Rigidbody2D: 465 | serializedVersion: 4 466 | m_ObjectHideFlags: 0 467 | m_CorrespondingSourceObject: {fileID: 0} 468 | m_PrefabInstance: {fileID: 0} 469 | m_PrefabAsset: {fileID: 0} 470 | m_GameObject: {fileID: 670629396} 471 | m_BodyType: 0 472 | m_Simulated: 1 473 | m_UseFullKinematicContacts: 0 474 | m_UseAutoMass: 0 475 | m_Mass: 1 476 | m_LinearDrag: 0 477 | m_AngularDrag: 0.05 478 | m_GravityScale: 1 479 | m_Material: {fileID: 0} 480 | m_Interpolate: 0 481 | m_SleepingMode: 1 482 | m_CollisionDetection: 0 483 | m_Constraints: 0 484 | --- !u!61 &670629399 485 | BoxCollider2D: 486 | m_ObjectHideFlags: 0 487 | m_CorrespondingSourceObject: {fileID: 0} 488 | m_PrefabInstance: {fileID: 0} 489 | m_PrefabAsset: {fileID: 0} 490 | m_GameObject: {fileID: 670629396} 491 | m_Enabled: 1 492 | m_Density: 1 493 | m_Material: {fileID: 0} 494 | m_IsTrigger: 0 495 | m_UsedByEffector: 0 496 | m_UsedByComposite: 0 497 | m_Offset: {x: 0, y: 0} 498 | m_SpriteTilingProperty: 499 | border: {x: 0, y: 0, z: 0, w: 0} 500 | pivot: {x: 0.5, y: 0.5} 501 | oldSize: {x: 1.28, y: 1.28} 502 | newSize: {x: 2.56, y: 2.56} 503 | adaptiveTilingThreshold: 0.5 504 | drawMode: 0 505 | adaptiveTiling: 0 506 | m_AutoTiling: 0 507 | serializedVersion: 2 508 | m_Size: {x: 1.28, y: 1.28} 509 | m_EdgeRadius: 0 510 | --- !u!212 &670629400 511 | SpriteRenderer: 512 | m_ObjectHideFlags: 0 513 | m_CorrespondingSourceObject: {fileID: 0} 514 | m_PrefabInstance: {fileID: 0} 515 | m_PrefabAsset: {fileID: 0} 516 | m_GameObject: {fileID: 670629396} 517 | m_Enabled: 1 518 | m_CastShadows: 0 519 | m_ReceiveShadows: 0 520 | m_DynamicOccludee: 1 521 | m_MotionVectors: 1 522 | m_LightProbeUsage: 1 523 | m_ReflectionProbeUsage: 1 524 | m_RenderingLayerMask: 1 525 | m_RendererPriority: 0 526 | m_Materials: 527 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 528 | m_StaticBatchInfo: 529 | firstSubMesh: 0 530 | subMeshCount: 0 531 | m_StaticBatchRoot: {fileID: 0} 532 | m_ProbeAnchor: {fileID: 0} 533 | m_LightProbeVolumeOverride: {fileID: 0} 534 | m_ScaleInLightmap: 1 535 | m_PreserveUVs: 0 536 | m_IgnoreNormalsForChartDetection: 0 537 | m_ImportantGI: 0 538 | m_StitchLightmapSeams: 1 539 | m_SelectedEditorRenderState: 0 540 | m_MinimumChartSize: 4 541 | m_AutoUVMaxDistance: 0.5 542 | m_AutoUVMaxAngle: 89 543 | m_LightmapParameters: {fileID: 0} 544 | m_SortingLayerID: 0 545 | m_SortingLayer: 0 546 | m_SortingOrder: 0 547 | m_Sprite: {fileID: 21300000, guid: 5ed5157cf45e6ee409511594fb89377b, type: 3} 548 | m_Color: {r: 1, g: 1, b: 1, a: 1} 549 | m_FlipX: 0 550 | m_FlipY: 0 551 | m_DrawMode: 0 552 | m_Size: {x: 2.56, y: 2.56} 553 | m_AdaptiveModeThreshold: 0.5 554 | m_SpriteTileMode: 0 555 | m_WasSpriteAssigned: 1 556 | m_MaskInteraction: 0 557 | m_SpriteSortPoint: 0 558 | --- !u!4 &670629401 559 | Transform: 560 | m_ObjectHideFlags: 0 561 | m_CorrespondingSourceObject: {fileID: 0} 562 | m_PrefabInstance: {fileID: 0} 563 | m_PrefabAsset: {fileID: 0} 564 | m_GameObject: {fileID: 670629396} 565 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 566 | m_LocalPosition: {x: 3.23, y: -0.16, z: 0} 567 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 568 | m_Children: [] 569 | m_Father: {fileID: 0} 570 | m_RootOrder: 5 571 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 572 | --- !u!1 &676923979 573 | GameObject: 574 | m_ObjectHideFlags: 0 575 | m_CorrespondingSourceObject: {fileID: 0} 576 | m_PrefabInstance: {fileID: 0} 577 | m_PrefabAsset: {fileID: 0} 578 | serializedVersion: 6 579 | m_Component: 580 | - component: {fileID: 676923984} 581 | - component: {fileID: 676923983} 582 | - component: {fileID: 676923982} 583 | - component: {fileID: 676923981} 584 | - component: {fileID: 676923980} 585 | m_Layer: 0 586 | m_Name: GravityItem2D 587 | m_TagString: Untagged 588 | m_Icon: {fileID: 0} 589 | m_NavMeshLayer: 0 590 | m_StaticEditorFlags: 0 591 | m_IsActive: 1 592 | --- !u!114 &676923980 593 | MonoBehaviour: 594 | m_ObjectHideFlags: 0 595 | m_CorrespondingSourceObject: {fileID: 0} 596 | m_PrefabInstance: {fileID: 0} 597 | m_PrefabAsset: {fileID: 0} 598 | m_GameObject: {fileID: 676923979} 599 | m_Enabled: 1 600 | m_EditorHideFlags: 0 601 | m_Script: {fileID: 11500000, guid: 02da70da7d2da1a44b5988e9521d8de4, type: 3} 602 | m_Name: 603 | m_EditorClassIdentifier: 604 | Up: {x: 0, y: 1} 605 | ActiveFieldCount: 0 606 | CurrentDistance: Infinity 607 | RotateToGround: 0 608 | --- !u!50 &676923981 609 | Rigidbody2D: 610 | serializedVersion: 4 611 | m_ObjectHideFlags: 0 612 | m_CorrespondingSourceObject: {fileID: 0} 613 | m_PrefabInstance: {fileID: 0} 614 | m_PrefabAsset: {fileID: 0} 615 | m_GameObject: {fileID: 676923979} 616 | m_BodyType: 0 617 | m_Simulated: 1 618 | m_UseFullKinematicContacts: 0 619 | m_UseAutoMass: 0 620 | m_Mass: 1 621 | m_LinearDrag: 0 622 | m_AngularDrag: 0.05 623 | m_GravityScale: 1 624 | m_Material: {fileID: 0} 625 | m_Interpolate: 0 626 | m_SleepingMode: 1 627 | m_CollisionDetection: 0 628 | m_Constraints: 0 629 | --- !u!61 &676923982 630 | BoxCollider2D: 631 | m_ObjectHideFlags: 0 632 | m_CorrespondingSourceObject: {fileID: 0} 633 | m_PrefabInstance: {fileID: 0} 634 | m_PrefabAsset: {fileID: 0} 635 | m_GameObject: {fileID: 676923979} 636 | m_Enabled: 1 637 | m_Density: 1 638 | m_Material: {fileID: 0} 639 | m_IsTrigger: 0 640 | m_UsedByEffector: 0 641 | m_UsedByComposite: 0 642 | m_Offset: {x: 0, y: 0} 643 | m_SpriteTilingProperty: 644 | border: {x: 0, y: 0, z: 0, w: 0} 645 | pivot: {x: 0.5, y: 0.5} 646 | oldSize: {x: 1.28, y: 1.28} 647 | newSize: {x: 2.56, y: 2.56} 648 | adaptiveTilingThreshold: 0.5 649 | drawMode: 0 650 | adaptiveTiling: 0 651 | m_AutoTiling: 0 652 | serializedVersion: 2 653 | m_Size: {x: 1.28, y: 1.28} 654 | m_EdgeRadius: 0 655 | --- !u!212 &676923983 656 | SpriteRenderer: 657 | m_ObjectHideFlags: 0 658 | m_CorrespondingSourceObject: {fileID: 0} 659 | m_PrefabInstance: {fileID: 0} 660 | m_PrefabAsset: {fileID: 0} 661 | m_GameObject: {fileID: 676923979} 662 | m_Enabled: 1 663 | m_CastShadows: 0 664 | m_ReceiveShadows: 0 665 | m_DynamicOccludee: 1 666 | m_MotionVectors: 1 667 | m_LightProbeUsage: 1 668 | m_ReflectionProbeUsage: 1 669 | m_RenderingLayerMask: 1 670 | m_RendererPriority: 0 671 | m_Materials: 672 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 673 | m_StaticBatchInfo: 674 | firstSubMesh: 0 675 | subMeshCount: 0 676 | m_StaticBatchRoot: {fileID: 0} 677 | m_ProbeAnchor: {fileID: 0} 678 | m_LightProbeVolumeOverride: {fileID: 0} 679 | m_ScaleInLightmap: 1 680 | m_PreserveUVs: 0 681 | m_IgnoreNormalsForChartDetection: 0 682 | m_ImportantGI: 0 683 | m_StitchLightmapSeams: 1 684 | m_SelectedEditorRenderState: 0 685 | m_MinimumChartSize: 4 686 | m_AutoUVMaxDistance: 0.5 687 | m_AutoUVMaxAngle: 89 688 | m_LightmapParameters: {fileID: 0} 689 | m_SortingLayerID: 0 690 | m_SortingLayer: 0 691 | m_SortingOrder: 0 692 | m_Sprite: {fileID: 21300000, guid: 5ed5157cf45e6ee409511594fb89377b, type: 3} 693 | m_Color: {r: 1, g: 1, b: 1, a: 1} 694 | m_FlipX: 0 695 | m_FlipY: 0 696 | m_DrawMode: 0 697 | m_Size: {x: 2.56, y: 2.56} 698 | m_AdaptiveModeThreshold: 0.5 699 | m_SpriteTileMode: 0 700 | m_WasSpriteAssigned: 1 701 | m_MaskInteraction: 0 702 | m_SpriteSortPoint: 0 703 | --- !u!4 &676923984 704 | Transform: 705 | m_ObjectHideFlags: 0 706 | m_CorrespondingSourceObject: {fileID: 0} 707 | m_PrefabInstance: {fileID: 0} 708 | m_PrefabAsset: {fileID: 0} 709 | m_GameObject: {fileID: 676923979} 710 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 711 | m_LocalPosition: {x: -0.05, y: 2.15, z: 0} 712 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 713 | m_Children: [] 714 | m_Father: {fileID: 0} 715 | m_RootOrder: 2 716 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 717 | --- !u!1 &708618738 718 | GameObject: 719 | m_ObjectHideFlags: 0 720 | m_CorrespondingSourceObject: {fileID: 0} 721 | m_PrefabInstance: {fileID: 0} 722 | m_PrefabAsset: {fileID: 0} 723 | serializedVersion: 6 724 | m_Component: 725 | - component: {fileID: 708618743} 726 | - component: {fileID: 708618742} 727 | - component: {fileID: 708618741} 728 | - component: {fileID: 708618740} 729 | - component: {fileID: 708618739} 730 | m_Layer: 0 731 | m_Name: GravityItem2D (1) 732 | m_TagString: Untagged 733 | m_Icon: {fileID: 0} 734 | m_NavMeshLayer: 0 735 | m_StaticEditorFlags: 0 736 | m_IsActive: 1 737 | --- !u!114 &708618739 738 | MonoBehaviour: 739 | m_ObjectHideFlags: 0 740 | m_CorrespondingSourceObject: {fileID: 0} 741 | m_PrefabInstance: {fileID: 0} 742 | m_PrefabAsset: {fileID: 0} 743 | m_GameObject: {fileID: 708618738} 744 | m_Enabled: 1 745 | m_EditorHideFlags: 0 746 | m_Script: {fileID: 11500000, guid: 02da70da7d2da1a44b5988e9521d8de4, type: 3} 747 | m_Name: 748 | m_EditorClassIdentifier: 749 | Up: {x: 0, y: 1} 750 | ActiveFieldCount: 0 751 | CurrentDistance: Infinity 752 | RotateToGround: 0 753 | --- !u!50 &708618740 754 | Rigidbody2D: 755 | serializedVersion: 4 756 | m_ObjectHideFlags: 0 757 | m_CorrespondingSourceObject: {fileID: 0} 758 | m_PrefabInstance: {fileID: 0} 759 | m_PrefabAsset: {fileID: 0} 760 | m_GameObject: {fileID: 708618738} 761 | m_BodyType: 0 762 | m_Simulated: 1 763 | m_UseFullKinematicContacts: 0 764 | m_UseAutoMass: 0 765 | m_Mass: 1 766 | m_LinearDrag: 0 767 | m_AngularDrag: 0.05 768 | m_GravityScale: 1 769 | m_Material: {fileID: 0} 770 | m_Interpolate: 0 771 | m_SleepingMode: 1 772 | m_CollisionDetection: 0 773 | m_Constraints: 0 774 | --- !u!61 &708618741 775 | BoxCollider2D: 776 | m_ObjectHideFlags: 0 777 | m_CorrespondingSourceObject: {fileID: 0} 778 | m_PrefabInstance: {fileID: 0} 779 | m_PrefabAsset: {fileID: 0} 780 | m_GameObject: {fileID: 708618738} 781 | m_Enabled: 1 782 | m_Density: 1 783 | m_Material: {fileID: 0} 784 | m_IsTrigger: 0 785 | m_UsedByEffector: 0 786 | m_UsedByComposite: 0 787 | m_Offset: {x: 0, y: 0} 788 | m_SpriteTilingProperty: 789 | border: {x: 0, y: 0, z: 0, w: 0} 790 | pivot: {x: 0.5, y: 0.5} 791 | oldSize: {x: 1.28, y: 1.28} 792 | newSize: {x: 2.56, y: 2.56} 793 | adaptiveTilingThreshold: 0.5 794 | drawMode: 0 795 | adaptiveTiling: 0 796 | m_AutoTiling: 0 797 | serializedVersion: 2 798 | m_Size: {x: 1.28, y: 1.28} 799 | m_EdgeRadius: 0 800 | --- !u!212 &708618742 801 | SpriteRenderer: 802 | m_ObjectHideFlags: 0 803 | m_CorrespondingSourceObject: {fileID: 0} 804 | m_PrefabInstance: {fileID: 0} 805 | m_PrefabAsset: {fileID: 0} 806 | m_GameObject: {fileID: 708618738} 807 | m_Enabled: 1 808 | m_CastShadows: 0 809 | m_ReceiveShadows: 0 810 | m_DynamicOccludee: 1 811 | m_MotionVectors: 1 812 | m_LightProbeUsage: 1 813 | m_ReflectionProbeUsage: 1 814 | m_RenderingLayerMask: 1 815 | m_RendererPriority: 0 816 | m_Materials: 817 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 818 | m_StaticBatchInfo: 819 | firstSubMesh: 0 820 | subMeshCount: 0 821 | m_StaticBatchRoot: {fileID: 0} 822 | m_ProbeAnchor: {fileID: 0} 823 | m_LightProbeVolumeOverride: {fileID: 0} 824 | m_ScaleInLightmap: 1 825 | m_PreserveUVs: 0 826 | m_IgnoreNormalsForChartDetection: 0 827 | m_ImportantGI: 0 828 | m_StitchLightmapSeams: 1 829 | m_SelectedEditorRenderState: 0 830 | m_MinimumChartSize: 4 831 | m_AutoUVMaxDistance: 0.5 832 | m_AutoUVMaxAngle: 89 833 | m_LightmapParameters: {fileID: 0} 834 | m_SortingLayerID: 0 835 | m_SortingLayer: 0 836 | m_SortingOrder: 0 837 | m_Sprite: {fileID: 21300000, guid: 5ed5157cf45e6ee409511594fb89377b, type: 3} 838 | m_Color: {r: 1, g: 1, b: 1, a: 1} 839 | m_FlipX: 0 840 | m_FlipY: 0 841 | m_DrawMode: 0 842 | m_Size: {x: 2.56, y: 2.56} 843 | m_AdaptiveModeThreshold: 0.5 844 | m_SpriteTileMode: 0 845 | m_WasSpriteAssigned: 1 846 | m_MaskInteraction: 0 847 | m_SpriteSortPoint: 0 848 | --- !u!4 &708618743 849 | Transform: 850 | m_ObjectHideFlags: 0 851 | m_CorrespondingSourceObject: {fileID: 0} 852 | m_PrefabInstance: {fileID: 0} 853 | m_PrefabAsset: {fileID: 0} 854 | m_GameObject: {fileID: 708618738} 855 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 856 | m_LocalPosition: {x: -1.94, y: 1.76, z: 0} 857 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 858 | m_Children: [] 859 | m_Father: {fileID: 0} 860 | m_RootOrder: 3 861 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 862 | --- !u!1 &1042216296 863 | GameObject: 864 | m_ObjectHideFlags: 0 865 | m_CorrespondingSourceObject: {fileID: 0} 866 | m_PrefabInstance: {fileID: 0} 867 | m_PrefabAsset: {fileID: 0} 868 | serializedVersion: 6 869 | m_Component: 870 | - component: {fileID: 1042216301} 871 | - component: {fileID: 1042216300} 872 | - component: {fileID: 1042216299} 873 | - component: {fileID: 1042216298} 874 | - component: {fileID: 1042216297} 875 | m_Layer: 0 876 | m_Name: GravityItem2D (2) 877 | m_TagString: Untagged 878 | m_Icon: {fileID: 0} 879 | m_NavMeshLayer: 0 880 | m_StaticEditorFlags: 0 881 | m_IsActive: 1 882 | --- !u!114 &1042216297 883 | MonoBehaviour: 884 | m_ObjectHideFlags: 0 885 | m_CorrespondingSourceObject: {fileID: 0} 886 | m_PrefabInstance: {fileID: 0} 887 | m_PrefabAsset: {fileID: 0} 888 | m_GameObject: {fileID: 1042216296} 889 | m_Enabled: 1 890 | m_EditorHideFlags: 0 891 | m_Script: {fileID: 11500000, guid: 02da70da7d2da1a44b5988e9521d8de4, type: 3} 892 | m_Name: 893 | m_EditorClassIdentifier: 894 | Up: {x: 0, y: 1} 895 | ActiveFieldCount: 0 896 | CurrentDistance: Infinity 897 | RotateToGround: 0 898 | --- !u!50 &1042216298 899 | Rigidbody2D: 900 | serializedVersion: 4 901 | m_ObjectHideFlags: 0 902 | m_CorrespondingSourceObject: {fileID: 0} 903 | m_PrefabInstance: {fileID: 0} 904 | m_PrefabAsset: {fileID: 0} 905 | m_GameObject: {fileID: 1042216296} 906 | m_BodyType: 0 907 | m_Simulated: 1 908 | m_UseFullKinematicContacts: 0 909 | m_UseAutoMass: 0 910 | m_Mass: 1 911 | m_LinearDrag: 0 912 | m_AngularDrag: 0.05 913 | m_GravityScale: 1 914 | m_Material: {fileID: 0} 915 | m_Interpolate: 0 916 | m_SleepingMode: 1 917 | m_CollisionDetection: 0 918 | m_Constraints: 0 919 | --- !u!61 &1042216299 920 | BoxCollider2D: 921 | m_ObjectHideFlags: 0 922 | m_CorrespondingSourceObject: {fileID: 0} 923 | m_PrefabInstance: {fileID: 0} 924 | m_PrefabAsset: {fileID: 0} 925 | m_GameObject: {fileID: 1042216296} 926 | m_Enabled: 1 927 | m_Density: 1 928 | m_Material: {fileID: 0} 929 | m_IsTrigger: 0 930 | m_UsedByEffector: 0 931 | m_UsedByComposite: 0 932 | m_Offset: {x: 0, y: 0} 933 | m_SpriteTilingProperty: 934 | border: {x: 0, y: 0, z: 0, w: 0} 935 | pivot: {x: 0.5, y: 0.5} 936 | oldSize: {x: 1.28, y: 1.28} 937 | newSize: {x: 2.56, y: 2.56} 938 | adaptiveTilingThreshold: 0.5 939 | drawMode: 0 940 | adaptiveTiling: 0 941 | m_AutoTiling: 0 942 | serializedVersion: 2 943 | m_Size: {x: 1.28, y: 1.28} 944 | m_EdgeRadius: 0 945 | --- !u!212 &1042216300 946 | SpriteRenderer: 947 | m_ObjectHideFlags: 0 948 | m_CorrespondingSourceObject: {fileID: 0} 949 | m_PrefabInstance: {fileID: 0} 950 | m_PrefabAsset: {fileID: 0} 951 | m_GameObject: {fileID: 1042216296} 952 | m_Enabled: 1 953 | m_CastShadows: 0 954 | m_ReceiveShadows: 0 955 | m_DynamicOccludee: 1 956 | m_MotionVectors: 1 957 | m_LightProbeUsage: 1 958 | m_ReflectionProbeUsage: 1 959 | m_RenderingLayerMask: 1 960 | m_RendererPriority: 0 961 | m_Materials: 962 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 963 | m_StaticBatchInfo: 964 | firstSubMesh: 0 965 | subMeshCount: 0 966 | m_StaticBatchRoot: {fileID: 0} 967 | m_ProbeAnchor: {fileID: 0} 968 | m_LightProbeVolumeOverride: {fileID: 0} 969 | m_ScaleInLightmap: 1 970 | m_PreserveUVs: 0 971 | m_IgnoreNormalsForChartDetection: 0 972 | m_ImportantGI: 0 973 | m_StitchLightmapSeams: 1 974 | m_SelectedEditorRenderState: 0 975 | m_MinimumChartSize: 4 976 | m_AutoUVMaxDistance: 0.5 977 | m_AutoUVMaxAngle: 89 978 | m_LightmapParameters: {fileID: 0} 979 | m_SortingLayerID: 0 980 | m_SortingLayer: 0 981 | m_SortingOrder: 0 982 | m_Sprite: {fileID: 21300000, guid: 5ed5157cf45e6ee409511594fb89377b, type: 3} 983 | m_Color: {r: 1, g: 1, b: 1, a: 1} 984 | m_FlipX: 0 985 | m_FlipY: 0 986 | m_DrawMode: 0 987 | m_Size: {x: 2.56, y: 2.56} 988 | m_AdaptiveModeThreshold: 0.5 989 | m_SpriteTileMode: 0 990 | m_WasSpriteAssigned: 1 991 | m_MaskInteraction: 0 992 | m_SpriteSortPoint: 0 993 | --- !u!4 &1042216301 994 | Transform: 995 | m_ObjectHideFlags: 0 996 | m_CorrespondingSourceObject: {fileID: 0} 997 | m_PrefabInstance: {fileID: 0} 998 | m_PrefabAsset: {fileID: 0} 999 | m_GameObject: {fileID: 1042216296} 1000 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1001 | m_LocalPosition: {x: 1.87, y: 1.36, z: 0} 1002 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 1003 | m_Children: [] 1004 | m_Father: {fileID: 0} 1005 | m_RootOrder: 4 1006 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1007 | --- !u!1 &1596358189 1008 | GameObject: 1009 | m_ObjectHideFlags: 0 1010 | m_CorrespondingSourceObject: {fileID: 0} 1011 | m_PrefabInstance: {fileID: 0} 1012 | m_PrefabAsset: {fileID: 0} 1013 | serializedVersion: 6 1014 | m_Component: 1015 | - component: {fileID: 1596358194} 1016 | - component: {fileID: 1596358193} 1017 | - component: {fileID: 1596358192} 1018 | - component: {fileID: 1596358191} 1019 | - component: {fileID: 1596358190} 1020 | m_Layer: 0 1021 | m_Name: GravityItem2D (7) 1022 | m_TagString: Untagged 1023 | m_Icon: {fileID: 0} 1024 | m_NavMeshLayer: 0 1025 | m_StaticEditorFlags: 0 1026 | m_IsActive: 1 1027 | --- !u!114 &1596358190 1028 | MonoBehaviour: 1029 | m_ObjectHideFlags: 0 1030 | m_CorrespondingSourceObject: {fileID: 0} 1031 | m_PrefabInstance: {fileID: 0} 1032 | m_PrefabAsset: {fileID: 0} 1033 | m_GameObject: {fileID: 1596358189} 1034 | m_Enabled: 1 1035 | m_EditorHideFlags: 0 1036 | m_Script: {fileID: 11500000, guid: 02da70da7d2da1a44b5988e9521d8de4, type: 3} 1037 | m_Name: 1038 | m_EditorClassIdentifier: 1039 | Up: {x: 0, y: 1} 1040 | ActiveFieldCount: 0 1041 | CurrentDistance: Infinity 1042 | RotateToGround: 0 1043 | --- !u!50 &1596358191 1044 | Rigidbody2D: 1045 | serializedVersion: 4 1046 | m_ObjectHideFlags: 0 1047 | m_CorrespondingSourceObject: {fileID: 0} 1048 | m_PrefabInstance: {fileID: 0} 1049 | m_PrefabAsset: {fileID: 0} 1050 | m_GameObject: {fileID: 1596358189} 1051 | m_BodyType: 0 1052 | m_Simulated: 1 1053 | m_UseFullKinematicContacts: 0 1054 | m_UseAutoMass: 0 1055 | m_Mass: 1 1056 | m_LinearDrag: 0 1057 | m_AngularDrag: 0.05 1058 | m_GravityScale: 1 1059 | m_Material: {fileID: 0} 1060 | m_Interpolate: 0 1061 | m_SleepingMode: 1 1062 | m_CollisionDetection: 0 1063 | m_Constraints: 0 1064 | --- !u!61 &1596358192 1065 | BoxCollider2D: 1066 | m_ObjectHideFlags: 0 1067 | m_CorrespondingSourceObject: {fileID: 0} 1068 | m_PrefabInstance: {fileID: 0} 1069 | m_PrefabAsset: {fileID: 0} 1070 | m_GameObject: {fileID: 1596358189} 1071 | m_Enabled: 1 1072 | m_Density: 1 1073 | m_Material: {fileID: 0} 1074 | m_IsTrigger: 0 1075 | m_UsedByEffector: 0 1076 | m_UsedByComposite: 0 1077 | m_Offset: {x: 0, y: 0} 1078 | m_SpriteTilingProperty: 1079 | border: {x: 0, y: 0, z: 0, w: 0} 1080 | pivot: {x: 0.5, y: 0.5} 1081 | oldSize: {x: 1.28, y: 1.28} 1082 | newSize: {x: 2.56, y: 2.56} 1083 | adaptiveTilingThreshold: 0.5 1084 | drawMode: 0 1085 | adaptiveTiling: 0 1086 | m_AutoTiling: 0 1087 | serializedVersion: 2 1088 | m_Size: {x: 1.28, y: 1.28} 1089 | m_EdgeRadius: 0 1090 | --- !u!212 &1596358193 1091 | SpriteRenderer: 1092 | m_ObjectHideFlags: 0 1093 | m_CorrespondingSourceObject: {fileID: 0} 1094 | m_PrefabInstance: {fileID: 0} 1095 | m_PrefabAsset: {fileID: 0} 1096 | m_GameObject: {fileID: 1596358189} 1097 | m_Enabled: 1 1098 | m_CastShadows: 0 1099 | m_ReceiveShadows: 0 1100 | m_DynamicOccludee: 1 1101 | m_MotionVectors: 1 1102 | m_LightProbeUsage: 1 1103 | m_ReflectionProbeUsage: 1 1104 | m_RenderingLayerMask: 1 1105 | m_RendererPriority: 0 1106 | m_Materials: 1107 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 1108 | m_StaticBatchInfo: 1109 | firstSubMesh: 0 1110 | subMeshCount: 0 1111 | m_StaticBatchRoot: {fileID: 0} 1112 | m_ProbeAnchor: {fileID: 0} 1113 | m_LightProbeVolumeOverride: {fileID: 0} 1114 | m_ScaleInLightmap: 1 1115 | m_PreserveUVs: 0 1116 | m_IgnoreNormalsForChartDetection: 0 1117 | m_ImportantGI: 0 1118 | m_StitchLightmapSeams: 1 1119 | m_SelectedEditorRenderState: 0 1120 | m_MinimumChartSize: 4 1121 | m_AutoUVMaxDistance: 0.5 1122 | m_AutoUVMaxAngle: 89 1123 | m_LightmapParameters: {fileID: 0} 1124 | m_SortingLayerID: 0 1125 | m_SortingLayer: 0 1126 | m_SortingOrder: 0 1127 | m_Sprite: {fileID: 21300000, guid: 5ed5157cf45e6ee409511594fb89377b, type: 3} 1128 | m_Color: {r: 1, g: 1, b: 1, a: 1} 1129 | m_FlipX: 0 1130 | m_FlipY: 0 1131 | m_DrawMode: 0 1132 | m_Size: {x: 2.56, y: 2.56} 1133 | m_AdaptiveModeThreshold: 0.5 1134 | m_SpriteTileMode: 0 1135 | m_WasSpriteAssigned: 1 1136 | m_MaskInteraction: 0 1137 | m_SpriteSortPoint: 0 1138 | --- !u!4 &1596358194 1139 | Transform: 1140 | m_ObjectHideFlags: 0 1141 | m_CorrespondingSourceObject: {fileID: 0} 1142 | m_PrefabInstance: {fileID: 0} 1143 | m_PrefabAsset: {fileID: 0} 1144 | m_GameObject: {fileID: 1596358189} 1145 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1146 | m_LocalPosition: {x: -2.98, y: -1.74, z: 0} 1147 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 1148 | m_Children: [] 1149 | m_Father: {fileID: 0} 1150 | m_RootOrder: 9 1151 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1152 | --- !u!1 &1736949282 1153 | GameObject: 1154 | m_ObjectHideFlags: 0 1155 | m_CorrespondingSourceObject: {fileID: 0} 1156 | m_PrefabInstance: {fileID: 0} 1157 | m_PrefabAsset: {fileID: 0} 1158 | serializedVersion: 6 1159 | m_Component: 1160 | - component: {fileID: 1736949284} 1161 | - component: {fileID: 1736949283} 1162 | m_Layer: 0 1163 | m_Name: Directional Light 1164 | m_TagString: Untagged 1165 | m_Icon: {fileID: 0} 1166 | m_NavMeshLayer: 0 1167 | m_StaticEditorFlags: 0 1168 | m_IsActive: 1 1169 | --- !u!108 &1736949283 1170 | Light: 1171 | m_ObjectHideFlags: 0 1172 | m_CorrespondingSourceObject: {fileID: 0} 1173 | m_PrefabInstance: {fileID: 0} 1174 | m_PrefabAsset: {fileID: 0} 1175 | m_GameObject: {fileID: 1736949282} 1176 | m_Enabled: 1 1177 | serializedVersion: 9 1178 | m_Type: 1 1179 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 1180 | m_Intensity: 1 1181 | m_Range: 10 1182 | m_SpotAngle: 30 1183 | m_InnerSpotAngle: 21.80208 1184 | m_CookieSize: 10 1185 | m_Shadows: 1186 | m_Type: 2 1187 | m_Resolution: -1 1188 | m_CustomResolution: -1 1189 | m_Strength: 1 1190 | m_Bias: 0.05 1191 | m_NormalBias: 0.4 1192 | m_NearPlane: 0.2 1193 | m_CullingMatrixOverride: 1194 | e00: 1 1195 | e01: 0 1196 | e02: 0 1197 | e03: 0 1198 | e10: 0 1199 | e11: 1 1200 | e12: 0 1201 | e13: 0 1202 | e20: 0 1203 | e21: 0 1204 | e22: 1 1205 | e23: 0 1206 | e30: 0 1207 | e31: 0 1208 | e32: 0 1209 | e33: 1 1210 | m_UseCullingMatrixOverride: 0 1211 | m_Cookie: {fileID: 0} 1212 | m_DrawHalo: 0 1213 | m_Flare: {fileID: 0} 1214 | m_RenderMode: 0 1215 | m_CullingMask: 1216 | serializedVersion: 2 1217 | m_Bits: 4294967295 1218 | m_RenderingLayerMask: 1 1219 | m_Lightmapping: 4 1220 | m_LightShadowCasterMode: 0 1221 | m_AreaSize: {x: 1, y: 1} 1222 | m_BounceIntensity: 1 1223 | m_ColorTemperature: 6570 1224 | m_UseColorTemperature: 0 1225 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 1226 | m_UseBoundingSphereOverride: 0 1227 | m_ShadowRadius: 0 1228 | m_ShadowAngle: 0 1229 | --- !u!4 &1736949284 1230 | Transform: 1231 | m_ObjectHideFlags: 0 1232 | m_CorrespondingSourceObject: {fileID: 0} 1233 | m_PrefabInstance: {fileID: 0} 1234 | m_PrefabAsset: {fileID: 0} 1235 | m_GameObject: {fileID: 1736949282} 1236 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 1237 | m_LocalPosition: {x: 0, y: 3, z: 0} 1238 | m_LocalScale: {x: 1, y: 1, z: 1} 1239 | m_Children: [] 1240 | m_Father: {fileID: 0} 1241 | m_RootOrder: 1 1242 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 1243 | --- !u!1 &1979611594 1244 | GameObject: 1245 | m_ObjectHideFlags: 0 1246 | m_CorrespondingSourceObject: {fileID: 0} 1247 | m_PrefabInstance: {fileID: 0} 1248 | m_PrefabAsset: {fileID: 0} 1249 | serializedVersion: 6 1250 | m_Component: 1251 | - component: {fileID: 1979611595} 1252 | m_Layer: 0 1253 | m_Name: Planet 1254 | m_TagString: Untagged 1255 | m_Icon: {fileID: 0} 1256 | m_NavMeshLayer: 0 1257 | m_StaticEditorFlags: 0 1258 | m_IsActive: 1 1259 | --- !u!4 &1979611595 1260 | Transform: 1261 | m_ObjectHideFlags: 0 1262 | m_CorrespondingSourceObject: {fileID: 0} 1263 | m_PrefabInstance: {fileID: 0} 1264 | m_PrefabAsset: {fileID: 0} 1265 | m_GameObject: {fileID: 1979611594} 1266 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1267 | m_LocalPosition: {x: 0, y: 0, z: 0} 1268 | m_LocalScale: {x: 1, y: 1, z: 1} 1269 | m_Children: 1270 | - {fileID: 464719867} 1271 | - {fileID: 146155151} 1272 | m_Father: {fileID: 0} 1273 | m_RootOrder: 10 1274 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1275 | --- !u!1 &1984790722 1276 | GameObject: 1277 | m_ObjectHideFlags: 0 1278 | m_CorrespondingSourceObject: {fileID: 0} 1279 | m_PrefabInstance: {fileID: 0} 1280 | m_PrefabAsset: {fileID: 0} 1281 | serializedVersion: 6 1282 | m_Component: 1283 | - component: {fileID: 1984790727} 1284 | - component: {fileID: 1984790726} 1285 | - component: {fileID: 1984790725} 1286 | - component: {fileID: 1984790724} 1287 | - component: {fileID: 1984790723} 1288 | m_Layer: 0 1289 | m_Name: GravityItem2D (5) 1290 | m_TagString: Untagged 1291 | m_Icon: {fileID: 0} 1292 | m_NavMeshLayer: 0 1293 | m_StaticEditorFlags: 0 1294 | m_IsActive: 1 1295 | --- !u!114 &1984790723 1296 | MonoBehaviour: 1297 | m_ObjectHideFlags: 0 1298 | m_CorrespondingSourceObject: {fileID: 0} 1299 | m_PrefabInstance: {fileID: 0} 1300 | m_PrefabAsset: {fileID: 0} 1301 | m_GameObject: {fileID: 1984790722} 1302 | m_Enabled: 1 1303 | m_EditorHideFlags: 0 1304 | m_Script: {fileID: 11500000, guid: 02da70da7d2da1a44b5988e9521d8de4, type: 3} 1305 | m_Name: 1306 | m_EditorClassIdentifier: 1307 | Up: {x: 0, y: 1} 1308 | ActiveFieldCount: 0 1309 | CurrentDistance: Infinity 1310 | RotateToGround: 0 1311 | --- !u!50 &1984790724 1312 | Rigidbody2D: 1313 | serializedVersion: 4 1314 | m_ObjectHideFlags: 0 1315 | m_CorrespondingSourceObject: {fileID: 0} 1316 | m_PrefabInstance: {fileID: 0} 1317 | m_PrefabAsset: {fileID: 0} 1318 | m_GameObject: {fileID: 1984790722} 1319 | m_BodyType: 0 1320 | m_Simulated: 1 1321 | m_UseFullKinematicContacts: 0 1322 | m_UseAutoMass: 0 1323 | m_Mass: 1 1324 | m_LinearDrag: 0 1325 | m_AngularDrag: 0.05 1326 | m_GravityScale: 1 1327 | m_Material: {fileID: 0} 1328 | m_Interpolate: 0 1329 | m_SleepingMode: 1 1330 | m_CollisionDetection: 0 1331 | m_Constraints: 0 1332 | --- !u!61 &1984790725 1333 | BoxCollider2D: 1334 | m_ObjectHideFlags: 0 1335 | m_CorrespondingSourceObject: {fileID: 0} 1336 | m_PrefabInstance: {fileID: 0} 1337 | m_PrefabAsset: {fileID: 0} 1338 | m_GameObject: {fileID: 1984790722} 1339 | m_Enabled: 1 1340 | m_Density: 1 1341 | m_Material: {fileID: 0} 1342 | m_IsTrigger: 0 1343 | m_UsedByEffector: 0 1344 | m_UsedByComposite: 0 1345 | m_Offset: {x: 0, y: 0} 1346 | m_SpriteTilingProperty: 1347 | border: {x: 0, y: 0, z: 0, w: 0} 1348 | pivot: {x: 0.5, y: 0.5} 1349 | oldSize: {x: 1.28, y: 1.28} 1350 | newSize: {x: 2.56, y: 2.56} 1351 | adaptiveTilingThreshold: 0.5 1352 | drawMode: 0 1353 | adaptiveTiling: 0 1354 | m_AutoTiling: 0 1355 | serializedVersion: 2 1356 | m_Size: {x: 1.28, y: 1.28} 1357 | m_EdgeRadius: 0 1358 | --- !u!212 &1984790726 1359 | SpriteRenderer: 1360 | m_ObjectHideFlags: 0 1361 | m_CorrespondingSourceObject: {fileID: 0} 1362 | m_PrefabInstance: {fileID: 0} 1363 | m_PrefabAsset: {fileID: 0} 1364 | m_GameObject: {fileID: 1984790722} 1365 | m_Enabled: 1 1366 | m_CastShadows: 0 1367 | m_ReceiveShadows: 0 1368 | m_DynamicOccludee: 1 1369 | m_MotionVectors: 1 1370 | m_LightProbeUsage: 1 1371 | m_ReflectionProbeUsage: 1 1372 | m_RenderingLayerMask: 1 1373 | m_RendererPriority: 0 1374 | m_Materials: 1375 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 1376 | m_StaticBatchInfo: 1377 | firstSubMesh: 0 1378 | subMeshCount: 0 1379 | m_StaticBatchRoot: {fileID: 0} 1380 | m_ProbeAnchor: {fileID: 0} 1381 | m_LightProbeVolumeOverride: {fileID: 0} 1382 | m_ScaleInLightmap: 1 1383 | m_PreserveUVs: 0 1384 | m_IgnoreNormalsForChartDetection: 0 1385 | m_ImportantGI: 0 1386 | m_StitchLightmapSeams: 1 1387 | m_SelectedEditorRenderState: 0 1388 | m_MinimumChartSize: 4 1389 | m_AutoUVMaxDistance: 0.5 1390 | m_AutoUVMaxAngle: 89 1391 | m_LightmapParameters: {fileID: 0} 1392 | m_SortingLayerID: 0 1393 | m_SortingLayer: 0 1394 | m_SortingOrder: 0 1395 | m_Sprite: {fileID: 21300000, guid: 5ed5157cf45e6ee409511594fb89377b, type: 3} 1396 | m_Color: {r: 1, g: 1, b: 1, a: 1} 1397 | m_FlipX: 0 1398 | m_FlipY: 0 1399 | m_DrawMode: 0 1400 | m_Size: {x: 2.56, y: 2.56} 1401 | m_AdaptiveModeThreshold: 0.5 1402 | m_SpriteTileMode: 0 1403 | m_WasSpriteAssigned: 1 1404 | m_MaskInteraction: 0 1405 | m_SpriteSortPoint: 0 1406 | --- !u!4 &1984790727 1407 | Transform: 1408 | m_ObjectHideFlags: 0 1409 | m_CorrespondingSourceObject: {fileID: 0} 1410 | m_PrefabInstance: {fileID: 0} 1411 | m_PrefabAsset: {fileID: 0} 1412 | m_GameObject: {fileID: 1984790722} 1413 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1414 | m_LocalPosition: {x: -1.11, y: -2.39, z: 0} 1415 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 1416 | m_Children: [] 1417 | m_Father: {fileID: 0} 1418 | m_RootOrder: 7 1419 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1420 | --- !u!1 &2099935310 1421 | GameObject: 1422 | m_ObjectHideFlags: 0 1423 | m_CorrespondingSourceObject: {fileID: 0} 1424 | m_PrefabInstance: {fileID: 0} 1425 | m_PrefabAsset: {fileID: 0} 1426 | serializedVersion: 6 1427 | m_Component: 1428 | - component: {fileID: 2099935315} 1429 | - component: {fileID: 2099935314} 1430 | - component: {fileID: 2099935313} 1431 | - component: {fileID: 2099935312} 1432 | - component: {fileID: 2099935311} 1433 | m_Layer: 0 1434 | m_Name: GravityItem2D (6) 1435 | m_TagString: Untagged 1436 | m_Icon: {fileID: 0} 1437 | m_NavMeshLayer: 0 1438 | m_StaticEditorFlags: 0 1439 | m_IsActive: 1 1440 | --- !u!114 &2099935311 1441 | MonoBehaviour: 1442 | m_ObjectHideFlags: 0 1443 | m_CorrespondingSourceObject: {fileID: 0} 1444 | m_PrefabInstance: {fileID: 0} 1445 | m_PrefabAsset: {fileID: 0} 1446 | m_GameObject: {fileID: 2099935310} 1447 | m_Enabled: 1 1448 | m_EditorHideFlags: 0 1449 | m_Script: {fileID: 11500000, guid: 02da70da7d2da1a44b5988e9521d8de4, type: 3} 1450 | m_Name: 1451 | m_EditorClassIdentifier: 1452 | Up: {x: 0, y: 1} 1453 | ActiveFieldCount: 0 1454 | CurrentDistance: Infinity 1455 | RotateToGround: 0 1456 | --- !u!50 &2099935312 1457 | Rigidbody2D: 1458 | serializedVersion: 4 1459 | m_ObjectHideFlags: 0 1460 | m_CorrespondingSourceObject: {fileID: 0} 1461 | m_PrefabInstance: {fileID: 0} 1462 | m_PrefabAsset: {fileID: 0} 1463 | m_GameObject: {fileID: 2099935310} 1464 | m_BodyType: 0 1465 | m_Simulated: 1 1466 | m_UseFullKinematicContacts: 0 1467 | m_UseAutoMass: 0 1468 | m_Mass: 1 1469 | m_LinearDrag: 0 1470 | m_AngularDrag: 0.05 1471 | m_GravityScale: 1 1472 | m_Material: {fileID: 0} 1473 | m_Interpolate: 0 1474 | m_SleepingMode: 1 1475 | m_CollisionDetection: 0 1476 | m_Constraints: 0 1477 | --- !u!61 &2099935313 1478 | BoxCollider2D: 1479 | m_ObjectHideFlags: 0 1480 | m_CorrespondingSourceObject: {fileID: 0} 1481 | m_PrefabInstance: {fileID: 0} 1482 | m_PrefabAsset: {fileID: 0} 1483 | m_GameObject: {fileID: 2099935310} 1484 | m_Enabled: 1 1485 | m_Density: 1 1486 | m_Material: {fileID: 0} 1487 | m_IsTrigger: 0 1488 | m_UsedByEffector: 0 1489 | m_UsedByComposite: 0 1490 | m_Offset: {x: 0, y: 0} 1491 | m_SpriteTilingProperty: 1492 | border: {x: 0, y: 0, z: 0, w: 0} 1493 | pivot: {x: 0.5, y: 0.5} 1494 | oldSize: {x: 1.28, y: 1.28} 1495 | newSize: {x: 2.56, y: 2.56} 1496 | adaptiveTilingThreshold: 0.5 1497 | drawMode: 0 1498 | adaptiveTiling: 0 1499 | m_AutoTiling: 0 1500 | serializedVersion: 2 1501 | m_Size: {x: 1.28, y: 1.28} 1502 | m_EdgeRadius: 0 1503 | --- !u!212 &2099935314 1504 | SpriteRenderer: 1505 | m_ObjectHideFlags: 0 1506 | m_CorrespondingSourceObject: {fileID: 0} 1507 | m_PrefabInstance: {fileID: 0} 1508 | m_PrefabAsset: {fileID: 0} 1509 | m_GameObject: {fileID: 2099935310} 1510 | m_Enabled: 1 1511 | m_CastShadows: 0 1512 | m_ReceiveShadows: 0 1513 | m_DynamicOccludee: 1 1514 | m_MotionVectors: 1 1515 | m_LightProbeUsage: 1 1516 | m_ReflectionProbeUsage: 1 1517 | m_RenderingLayerMask: 1 1518 | m_RendererPriority: 0 1519 | m_Materials: 1520 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 1521 | m_StaticBatchInfo: 1522 | firstSubMesh: 0 1523 | subMeshCount: 0 1524 | m_StaticBatchRoot: {fileID: 0} 1525 | m_ProbeAnchor: {fileID: 0} 1526 | m_LightProbeVolumeOverride: {fileID: 0} 1527 | m_ScaleInLightmap: 1 1528 | m_PreserveUVs: 0 1529 | m_IgnoreNormalsForChartDetection: 0 1530 | m_ImportantGI: 0 1531 | m_StitchLightmapSeams: 1 1532 | m_SelectedEditorRenderState: 0 1533 | m_MinimumChartSize: 4 1534 | m_AutoUVMaxDistance: 0.5 1535 | m_AutoUVMaxAngle: 89 1536 | m_LightmapParameters: {fileID: 0} 1537 | m_SortingLayerID: 0 1538 | m_SortingLayer: 0 1539 | m_SortingOrder: 0 1540 | m_Sprite: {fileID: 21300000, guid: 5ed5157cf45e6ee409511594fb89377b, type: 3} 1541 | m_Color: {r: 1, g: 1, b: 1, a: 1} 1542 | m_FlipX: 0 1543 | m_FlipY: 0 1544 | m_DrawMode: 0 1545 | m_Size: {x: 2.56, y: 2.56} 1546 | m_AdaptiveModeThreshold: 0.5 1547 | m_SpriteTileMode: 0 1548 | m_WasSpriteAssigned: 1 1549 | m_MaskInteraction: 0 1550 | m_SpriteSortPoint: 0 1551 | --- !u!4 &2099935315 1552 | Transform: 1553 | m_ObjectHideFlags: 0 1554 | m_CorrespondingSourceObject: {fileID: 0} 1555 | m_PrefabInstance: {fileID: 0} 1556 | m_PrefabAsset: {fileID: 0} 1557 | m_GameObject: {fileID: 2099935310} 1558 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1559 | m_LocalPosition: {x: -2.42, y: 0.08, z: 0} 1560 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 1561 | m_Children: [] 1562 | m_Father: {fileID: 0} 1563 | m_RootOrder: 8 1564 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1565 | --- !u!1 &2147014143 1566 | GameObject: 1567 | m_ObjectHideFlags: 0 1568 | m_CorrespondingSourceObject: {fileID: 0} 1569 | m_PrefabInstance: {fileID: 0} 1570 | m_PrefabAsset: {fileID: 0} 1571 | serializedVersion: 6 1572 | m_Component: 1573 | - component: {fileID: 2147014146} 1574 | - component: {fileID: 2147014145} 1575 | - component: {fileID: 2147014144} 1576 | m_Layer: 0 1577 | m_Name: Main Camera 1578 | m_TagString: MainCamera 1579 | m_Icon: {fileID: 0} 1580 | m_NavMeshLayer: 0 1581 | m_StaticEditorFlags: 0 1582 | m_IsActive: 1 1583 | --- !u!81 &2147014144 1584 | AudioListener: 1585 | m_ObjectHideFlags: 0 1586 | m_CorrespondingSourceObject: {fileID: 0} 1587 | m_PrefabInstance: {fileID: 0} 1588 | m_PrefabAsset: {fileID: 0} 1589 | m_GameObject: {fileID: 2147014143} 1590 | m_Enabled: 1 1591 | --- !u!20 &2147014145 1592 | Camera: 1593 | m_ObjectHideFlags: 0 1594 | m_CorrespondingSourceObject: {fileID: 0} 1595 | m_PrefabInstance: {fileID: 0} 1596 | m_PrefabAsset: {fileID: 0} 1597 | m_GameObject: {fileID: 2147014143} 1598 | m_Enabled: 1 1599 | serializedVersion: 2 1600 | m_ClearFlags: 1 1601 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 1602 | m_projectionMatrixMode: 1 1603 | m_GateFitMode: 2 1604 | m_FOVAxisMode: 0 1605 | m_SensorSize: {x: 36, y: 24} 1606 | m_LensShift: {x: 0, y: 0} 1607 | m_FocalLength: 50 1608 | m_NormalizedViewPortRect: 1609 | serializedVersion: 2 1610 | x: 0 1611 | y: 0 1612 | width: 1 1613 | height: 1 1614 | near clip plane: 0.3 1615 | far clip plane: 1000 1616 | field of view: 60 1617 | orthographic: 1 1618 | orthographic size: 5 1619 | m_Depth: -1 1620 | m_CullingMask: 1621 | serializedVersion: 2 1622 | m_Bits: 4294967295 1623 | m_RenderingPath: -1 1624 | m_TargetTexture: {fileID: 0} 1625 | m_TargetDisplay: 0 1626 | m_TargetEye: 3 1627 | m_HDR: 1 1628 | m_AllowMSAA: 1 1629 | m_AllowDynamicResolution: 0 1630 | m_ForceIntoRT: 0 1631 | m_OcclusionCulling: 1 1632 | m_StereoConvergence: 10 1633 | m_StereoSeparation: 0.022 1634 | --- !u!4 &2147014146 1635 | Transform: 1636 | m_ObjectHideFlags: 0 1637 | m_CorrespondingSourceObject: {fileID: 0} 1638 | m_PrefabInstance: {fileID: 0} 1639 | m_PrefabAsset: {fileID: 0} 1640 | m_GameObject: {fileID: 2147014143} 1641 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1642 | m_LocalPosition: {x: 0, y: 0, z: -10} 1643 | m_LocalScale: {x: 1, y: 1, z: 1} 1644 | m_Children: [] 1645 | m_Father: {fileID: 0} 1646 | m_RootOrder: 0 1647 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1648 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Scenes/2D Planet Gravity.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8433d5efa2028a4eaaa10c338b09cf1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Scenes/3D Planet Gravity.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1adedde844d855545a047b2bad95c91b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/DirectionalGravity.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace DoctorWolfy121.GravitySystem 5 | { 6 | [AddComponentMenu("Gravity System/Gravity Sources/Directional Gravity")] 7 | public class DirectionalGravity : MonoBehaviour, IGravitySource 8 | { 9 | [SerializeField, Tooltip("The direction of gravity.")] 10 | private Vector3 gravityDirection = Vector3.down; 11 | 12 | [SerializeField] private float gravityStrength = 9.8f; 13 | 14 | [SerializeField] private bool enableGravity = true; 15 | 16 | [SerializeField, Space(5)] private bool enableDebug; 17 | 18 | public float GravityStrength => gravityStrength; 19 | 20 | public List ItemsInRange { get; } = new List(); 21 | 22 | public Collider[] GravityColliders { get; private set; } 23 | 24 | public bool EnableGravity => enableGravity; 25 | 26 | private const float MaxRaycastDistance = 100.0f; 27 | 28 | private void Awake() 29 | { 30 | GravityColliders = GetComponents(); 31 | 32 | if (GravityColliders == null || GravityColliders.Length == 0) 33 | { 34 | Debug.LogWarning("GravitySource has no colliders, will not be functional."); 35 | } 36 | } 37 | 38 | private void OnTriggerStay(Collider c) 39 | { 40 | var item = c.GetComponent(); 41 | if (item == null || ItemsInRange.Contains(item)) return; 42 | 43 | ItemsInRange.Add(item); 44 | 45 | ++item.ActiveFieldCount; 46 | item.CurrentGravitySource.Add(this); 47 | } 48 | 49 | private void OnTriggerExit(Collider c) 50 | { 51 | var item = c.GetComponent(); 52 | if (item == null || !ItemsInRange.Contains(item)) return; 53 | 54 | ItemsInRange.Remove(item); 55 | 56 | --item.ActiveFieldCount; 57 | if (item.CurrentGravitySource.Contains(this)) 58 | { 59 | item.CurrentDistance = Mathf.Infinity; 60 | item.CurrentGravitySource.Remove(this); 61 | } 62 | } 63 | 64 | private void FixedUpdate() 65 | { 66 | if (!EnableGravity) return; 67 | 68 | // Iterate over each object within range of our gravity 69 | for (int i = 0; ItemsInRange != null && i < ItemsInRange.Count; ++i) 70 | { 71 | if (ItemsInRange[i] == null || !ItemsInRange[i].Rigidbody.useGravity) 72 | continue; 73 | 74 | // Calculate initial gravity direction, just towards the gravity source transform 75 | var item = ItemsInRange[i]; 76 | var gravityDir = gravityDirection; 77 | 78 | // Find out which of our child colliders is closest 79 | var closestHit = Mathf.Infinity; 80 | foreach (var gravityCollider in GravityColliders) 81 | { 82 | // Skips this collider if it isn't a trigger 83 | if (!gravityCollider.isTrigger) continue; 84 | 85 | // Raycast in general direction of collider to find a normal of the surface 86 | var raycastTo = gravityCollider.transform.position; 87 | var toCollider = (raycastTo - item.transform.position).normalized; 88 | var gravityRay = new Ray(item.transform.position, toCollider); 89 | if (gravityCollider.Raycast(gravityRay, out var hitInfo, MaxRaycastDistance)) 90 | { 91 | if (enableDebug) 92 | { 93 | Debug.DrawRay(gravityRay.origin, gravityRay.direction * 2, Color.red); 94 | Debug.DrawRay(hitInfo.point, hitInfo.normal * 2, Color.red); 95 | } 96 | 97 | // Set our new ray to point in the opposite direction of this normal, to raycast 'down' towards the closest point on the plane formed by the normal 98 | gravityRay = new Ray(item.transform.position, -hitInfo.normal); 99 | 100 | // Update gravity direction guess if this was a closer hit 101 | var dist = Vector3.Distance(hitInfo.point, gravityRay.origin); 102 | if (dist < closestHit) 103 | { 104 | gravityDir = -hitInfo.normal; 105 | closestHit = dist; 106 | } 107 | } 108 | 109 | // Raycast a second time onto the collider with the refined 'down' direction 110 | if (gravityCollider.Raycast(gravityRay, out hitInfo, MaxRaycastDistance)) 111 | { 112 | if (enableDebug) 113 | { 114 | Debug.DrawRay(gravityRay.origin, gravityRay.direction * 2, Color.green); 115 | Debug.DrawRay(hitInfo.point, hitInfo.normal * 2, Color.green); 116 | } 117 | 118 | var dist = Vector3.Distance(hitInfo.point, gravityRay.origin); 119 | if (dist < closestHit) 120 | { 121 | gravityDir = -hitInfo.normal; 122 | closestHit = dist; 123 | } 124 | } 125 | } 126 | 127 | if (enableDebug) 128 | { 129 | Debug.DrawRay(item.transform.position, gravityDir * 2, Color.blue); 130 | } 131 | 132 | // Now apply gravity if we are the closest source (only 1 source at a time applies gravity) 133 | if (item.CurrentGravitySource.Contains(this) || closestHit < item.CurrentDistance) 134 | { 135 | // Update tracking vars 136 | item.CurrentDistance = closestHit; 137 | if (!item.CurrentGravitySource.Contains(this)) 138 | { 139 | item.CurrentGravitySource.Add(this); 140 | } 141 | 142 | item.Up = Vector3.Lerp(item.Up, -gravityDir.normalized, Time.deltaTime * 2.0f); 143 | 144 | if (item.RotateToGround) 145 | { 146 | item.transform.up = -gravityDir.normalized; 147 | } 148 | 149 | // Calculate force 150 | var force = gravityDir.normalized * GravityStrength; 151 | 152 | var distRatio = 153 | Mathf.Clamp01(closestHit / Vector3.Distance(transform.position, item.transform.position)); 154 | 155 | // Gravity gets scaled up with distance because games 156 | force *= 1.0f + distRatio; 157 | item.Rigidbody.AddForce(force * item.Rigidbody.mass); 158 | } 159 | } 160 | } 161 | } 162 | } -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/DirectionalGravity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06f92643cf404c929412d82d3fc60f6f 3 | timeCreated: 1562337688 -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/DirectionalGravity2D.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace DoctorWolfy121.GravitySystem 5 | { 6 | [AddComponentMenu("Gravity System/Gravity Sources/Directional Gravity 2D")] 7 | public class DirectionalGravity2D : MonoBehaviour, IGravitySource2D 8 | { 9 | [SerializeField, Tooltip("The direction of gravity.")] 10 | private Vector2 gravityDirection = Vector2.down; 11 | 12 | [SerializeField, 13 | Tooltip("How much gravity force to apply to objects within range")] 14 | private float gravityStrength = 9.8f; 15 | 16 | [SerializeField] private bool enableGravity = true; 17 | 18 | [SerializeField, Space(5), Tooltip("Enable Debug rays and lines to help visualise the gravity.")] 19 | private bool enableDebug; 20 | 21 | public float GravityStrength => gravityStrength; 22 | 23 | public Collider2D[] GravityColliders { get; private set; } 24 | 25 | public List ItemsInRange { get; } = new List(); 26 | 27 | public bool EnableGravity => enableGravity; 28 | 29 | private const float MaxRaycastDistance = 100.0f; 30 | 31 | private void Awake() 32 | { 33 | GravityColliders = GetComponents(); 34 | 35 | if (GravityColliders == null || GravityColliders.Length == 0) 36 | { 37 | Debug.LogWarning("GravitySource has no colliders, will not be functional."); 38 | } 39 | } 40 | 41 | private void OnTriggerStay2D(Collider2D c) 42 | { 43 | var item = c.GetComponent(); 44 | if (item == null || ItemsInRange.Contains(item)) return; 45 | 46 | ItemsInRange.Add(item); 47 | 48 | ++item.ActiveFieldCount; 49 | item.CurrentGravitySource.Add(this); 50 | } 51 | 52 | private void OnTriggerExit2D(Collider2D c) 53 | { 54 | var item = c.GetComponent(); 55 | if (item == null || !ItemsInRange.Contains(item)) return; 56 | 57 | ItemsInRange.Remove(item); 58 | 59 | --item.ActiveFieldCount; 60 | if (item.CurrentGravitySource.Contains(this)) 61 | { 62 | item.CurrentDistance = Mathf.Infinity; 63 | item.CurrentGravitySource.Remove(this); 64 | } 65 | } 66 | 67 | private void FixedUpdate() 68 | { 69 | if (!EnableGravity) return; 70 | 71 | // Iterate over each object within range of our gravity 72 | for (int i = 0; ItemsInRange != null && i < ItemsInRange.Count; ++i) 73 | { 74 | if (ItemsInRange[i] == null || ItemsInRange[i].Rigidbody2D.gravityScale <= 0) 75 | continue; 76 | 77 | // Calculate initial gravity direction, just towards the gravity source transform 78 | var item = ItemsInRange[i]; 79 | var gravityDir = gravityDirection; 80 | 81 | // Find out which of our child colliders is closest 82 | var closestHit = Mathf.Infinity; 83 | foreach (var gravityCollider in GravityColliders) 84 | { 85 | // Skips this collider if it isn't a trigger 86 | if (!gravityCollider.isTrigger) continue; 87 | 88 | // Raycast in general direction of collider to find a normal of the surface 89 | var raycastTo = gravityCollider.transform.position; 90 | var toCollider = (raycastTo - item.transform.position).normalized; 91 | var gravityRay = new Ray(item.transform.position, toCollider); 92 | 93 | RaycastHit2D[] raycastHit = new RaycastHit2D[0]; 94 | var raycastInt = gravityCollider.Raycast(toCollider, raycastHit, MaxRaycastDistance); 95 | if (raycastInt > 0) 96 | { 97 | if (enableDebug) 98 | { 99 | Debug.DrawRay(gravityRay.origin, gravityRay.direction * 2, Color.red); 100 | Debug.DrawRay(raycastHit[0].point, raycastHit[0].normal * 2, Color.red); 101 | gravityRay = new Ray(item.transform.position, -raycastHit[0].normal); 102 | } 103 | 104 | // Set our new ray to point in the opposite direction of this normal, to raycast 'down' towards the closest point on the plane formed by the normal 105 | 106 | // Update gravity direction guess if this was a closer hit 107 | var dist = Vector2.Distance(raycastHit[0].point, gravityRay.origin); 108 | if (dist < closestHit) 109 | { 110 | gravityDir = -raycastHit[0].normal; 111 | closestHit = dist; 112 | } 113 | } 114 | 115 | // Raycast a second time onto the collider with the refined 'down' direction 116 | if (raycastInt > 0) 117 | { 118 | raycastInt = gravityCollider.Raycast(raycastHit[0].normal, raycastHit, MaxRaycastDistance); 119 | 120 | if (raycastInt > 0) 121 | { 122 | if (enableDebug) 123 | { 124 | Debug.DrawRay(gravityRay.origin, gravityRay.direction * 2, Color.green); 125 | Debug.DrawRay(raycastHit[0].point, raycastHit[0].normal * 2, Color.green); 126 | } 127 | 128 | var dist = Vector2.Distance(raycastHit[0].point, gravityRay.origin); 129 | if (dist < closestHit) 130 | { 131 | gravityDir = -raycastHit[0].normal; 132 | closestHit = dist; 133 | } 134 | } 135 | } 136 | } 137 | 138 | if (enableDebug) 139 | { 140 | Debug.DrawRay(item.transform.position, gravityDir * 2, Color.blue); 141 | } 142 | 143 | // Now apply gravity if we are the closest source (only 1 source at a time applies gravity) 144 | if (item.CurrentGravitySource.Contains(this) || closestHit < item.CurrentDistance) 145 | { 146 | // Update tracking vars 147 | item.CurrentDistance = closestHit; 148 | if (!item.CurrentGravitySource.Contains(this)) 149 | { 150 | item.CurrentGravitySource.Add(this); 151 | } 152 | 153 | item.Up = Vector2.Lerp(item.Up, -gravityDir.normalized, Time.deltaTime * 2.0f); 154 | 155 | if (item.RotateToGround) 156 | { 157 | item.transform.up = -gravityDir.normalized; 158 | } 159 | 160 | // Calculate force 161 | var force = gravityDir.normalized * GravityStrength; 162 | var distRatio = 163 | Mathf.Clamp01(closestHit / Vector2.Distance(transform.position, item.transform.position)); 164 | 165 | // Gravity gets scaled up with distance because games 166 | force *= 1.0f + distRatio; 167 | item.Rigidbody2D.AddForce(force * item.Rigidbody2D.mass); 168 | } 169 | } 170 | } 171 | } 172 | } -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/DirectionalGravity2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9115a071be54d14b62d9cb119b9b904 3 | timeCreated: 1562339185 -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/GravityItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace DoctorWolfy121.GravitySystem 5 | { 6 | [AddComponentMenu("Gravity System/Gravity Item"), RequireComponent(typeof(Rigidbody))] 7 | public class GravityItem : MonoBehaviour 8 | { 9 | [Tooltip("Up direction of this item")] 10 | public Vector3 Up = Vector3.up; 11 | [Tooltip("How many Gravity Sources are affecting this object")] 12 | public int ActiveFieldCount; 13 | [Tooltip("The current distance to a Gravity Source")] 14 | public float CurrentDistance = Mathf.Infinity; 15 | [Tooltip("Rotates this object so down always faces towards the Gravity Source (Useful for a player controller)")] 16 | public bool RotateToGround = false; 17 | public List CurrentGravitySource = new List(); 18 | 19 | public Rigidbody Rigidbody { get; private set; } 20 | 21 | private void Awake() 22 | { 23 | Rigidbody = GetComponent(); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/GravityItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a3ec0488294cd343ba4837c24bd4435 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/GravityItem2D.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace DoctorWolfy121.GravitySystem 5 | { 6 | [AddComponentMenu("Gravity System/Gravity Item 2D"), RequireComponent(typeof(Rigidbody2D))] 7 | public class GravityItem2D : MonoBehaviour 8 | { 9 | [Tooltip("Up direction of this item")] 10 | public Vector2 Up = Vector2.up; 11 | [Tooltip("How many Gravity Sources are affecting this object")] 12 | public int ActiveFieldCount; 13 | [Tooltip("The current distance to a Gravity Source")] 14 | public float CurrentDistance = Mathf.Infinity; 15 | [Tooltip("Rotates this object so down always faces towards the Gravity Source (Useful for a player controller)")] 16 | public bool RotateToGround = false; 17 | public List CurrentGravitySource = new List(); 18 | 19 | public Rigidbody2D Rigidbody2D { get; private set; } 20 | 21 | private void Awake() 22 | { 23 | Rigidbody2D = GetComponent(); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/GravityItem2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02da70da7d2da1a44b5988e9521d8de4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/Interfaces.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88e3d3a43f2b4c2392767f8f9d33469c 3 | timeCreated: 1562326983 -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/Interfaces/IGravitySource.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace DoctorWolfy121.GravitySystem 5 | { 6 | public interface IGravitySource 7 | { 8 | float GravityStrength { get; } 9 | List ItemsInRange { get; } 10 | Collider[] GravityColliders { get; } 11 | bool EnableGravity { get; } 12 | } 13 | } -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/Interfaces/IGravitySource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6160e0b54d84f2d8cd9e77040f84cb9 3 | timeCreated: 1562327001 -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/Interfaces/IGravitySource2D.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace DoctorWolfy121.GravitySystem 5 | { 6 | public interface IGravitySource2D 7 | { 8 | float GravityStrength { get; } 9 | List ItemsInRange { get; } 10 | Collider2D[] GravityColliders { get; } 11 | bool EnableGravity { get; } 12 | } 13 | } -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/Interfaces/IGravitySource2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8162a0a205f4b3bbf6e1b7a8d12c6f8 3 | timeCreated: 1562327119 -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/PlanetGravity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections.Generic; 4 | using UnityEngine.Serialization; 5 | 6 | namespace DoctorWolfy121.GravitySystem 7 | { 8 | [AddComponentMenu("Gravity System/Gravity Sources/Planet Gravity")] 9 | public class PlanetGravity : MonoBehaviour, IGravitySource 10 | { 11 | [FormerlySerializedAs("gravity")] 12 | [SerializeField, Tooltip("How much gravity force to apply to objects within range")] 13 | private float gravityStrength = 9.8f; 14 | 15 | [SerializeField] private bool enableGravity = true; 16 | 17 | public float radius = 5.0f; 18 | 19 | [SerializeField, Space(5), Tooltip("Enable Debug rays and lines to help visualise the gravity.")] 20 | private bool enableDebug; 21 | 22 | private const float MaxRaycastDistance = 100.0f; 23 | 24 | public float GravityStrength => gravityStrength; 25 | 26 | public List ItemsInRange { get; } = new List(); 27 | 28 | public Collider[] GravityColliders { get; private set; } 29 | 30 | public bool EnableGravity => enableGravity; 31 | 32 | private void OnDrawGizmos() 33 | { 34 | if (!enableDebug) return; 35 | 36 | // Visualize gravity radius 37 | Gizmos.color = Color.magenta; 38 | for (int i = 0; GravityColliders != null && i < GravityColliders.Length; ++i) 39 | { 40 | var col = GravityColliders[i]; 41 | DrawLine(col, transform.up); 42 | DrawLine(col, transform.right); 43 | DrawLine(col, transform.forward); 44 | } 45 | } 46 | 47 | private void DrawLine(Collider collider, Vector3 dir) 48 | { 49 | var raycastFrom = collider.transform.position + dir * 1000.0f; 50 | var raycastDir = (collider.transform.position - raycastFrom).normalized; 51 | var ray = new Ray(raycastFrom, raycastDir); 52 | if (collider.Raycast(ray, out var hitInfo, 2000.0f)) 53 | { 54 | Gizmos.DrawLine(hitInfo.point, hitInfo.point + hitInfo.normal * (-radius * 2)); 55 | } 56 | } 57 | 58 | private void Awake() 59 | { 60 | GravityColliders = GetComponents(); 61 | 62 | if (GravityColliders == null || GravityColliders.Length == 0) 63 | { 64 | Debug.LogWarning("GravitySource has no colliders, will not be functional."); 65 | } 66 | } 67 | 68 | private void OnTriggerStay(Collider c) 69 | { 70 | var item = c.GetComponent(); 71 | if (item == null || ItemsInRange.Contains(item)) return; 72 | 73 | ItemsInRange.Add(item); 74 | 75 | ++item.ActiveFieldCount; 76 | item.CurrentGravitySource.Add(this); 77 | } 78 | 79 | private void OnTriggerExit(Collider c) 80 | { 81 | var item = c.GetComponent(); 82 | if (item == null || !ItemsInRange.Contains(item)) return; 83 | 84 | ItemsInRange.Remove(item); 85 | 86 | --item.ActiveFieldCount; 87 | if (item.CurrentGravitySource.Contains(this)) 88 | { 89 | item.CurrentDistance = Mathf.Infinity; 90 | item.CurrentGravitySource.Remove(this); 91 | } 92 | } 93 | 94 | private void FixedUpdate() 95 | { 96 | if (!EnableGravity) return; 97 | 98 | // Iterate over each object within range of our gravity 99 | for (int i = 0; ItemsInRange != null && i < ItemsInRange.Count; ++i) 100 | { 101 | if (ItemsInRange[i] == null || !ItemsInRange[i].Rigidbody.useGravity) 102 | continue; 103 | 104 | // Calculate initial gravity direction, just towards the gravity source transform 105 | var item = ItemsInRange[i]; 106 | var gravityDir = (transform.position - item.transform.position).normalized; 107 | 108 | // Find out which of our child colliders is closest 109 | var closestHit = Mathf.Infinity; 110 | foreach (var gravityCollider in GravityColliders) 111 | { 112 | // Skips this collider if it isn't a trigger 113 | if (!gravityCollider.isTrigger) continue; 114 | 115 | // Raycast in general direction of collider to find a normal of the surface 116 | var raycastTo = gravityCollider.transform.position; 117 | var toCollider = (raycastTo - item.transform.position).normalized; 118 | var gravityRay = new Ray(item.transform.position, toCollider); 119 | if (gravityCollider.Raycast(gravityRay, out var hitInfo, MaxRaycastDistance)) 120 | { 121 | if (enableDebug) 122 | { 123 | Debug.DrawRay(gravityRay.origin, gravityRay.direction * 2, Color.red); 124 | Debug.DrawRay(hitInfo.point, hitInfo.normal * 2, Color.red); 125 | } 126 | 127 | // Set our new ray to point in the opposite direction of this normal, to raycast 'down' towards the closest point on the plane formed by the normal 128 | gravityRay = new Ray(item.transform.position, -hitInfo.normal); 129 | 130 | // Update gravity direction guess if this was a closer hit 131 | var dist = Vector3.Distance(hitInfo.point, gravityRay.origin); 132 | if (dist < closestHit) 133 | { 134 | gravityDir = -hitInfo.normal; 135 | closestHit = dist; 136 | } 137 | } 138 | 139 | // Raycast a second time onto the collider with the refined 'down' direction 140 | if (gravityCollider.Raycast(gravityRay, out hitInfo, MaxRaycastDistance)) 141 | { 142 | if (enableDebug) 143 | { 144 | Debug.DrawRay(gravityRay.origin, gravityRay.direction * 2, Color.green); 145 | Debug.DrawRay(hitInfo.point, hitInfo.normal * 2, Color.green); 146 | } 147 | 148 | var dist = Vector3.Distance(hitInfo.point, gravityRay.origin); 149 | if (dist < closestHit) 150 | { 151 | gravityDir = -hitInfo.normal; 152 | closestHit = dist; 153 | } 154 | } 155 | } 156 | 157 | if (enableDebug) 158 | { 159 | Debug.DrawRay(item.transform.position, gravityDir * 2, Color.blue); 160 | } 161 | 162 | // Now apply gravity if we are the closest source (only 1 source at a time applies gravity) 163 | if (item.CurrentGravitySource.Contains(this) || closestHit < item.CurrentDistance) 164 | { 165 | // Update tracking vars 166 | item.CurrentDistance = closestHit; 167 | if (!item.CurrentGravitySource.Contains(this)) 168 | { 169 | item.CurrentGravitySource.Add(this); 170 | } 171 | 172 | item.Up = Vector3.Lerp(item.Up, -gravityDir.normalized, Time.deltaTime * 2.0f); 173 | 174 | if (item.RotateToGround) 175 | { 176 | item.transform.up = -gravityDir.normalized; 177 | } 178 | 179 | // Calculate force 180 | var force = gravityDir.normalized * GravityStrength; 181 | var distRatio = Mathf.Clamp01(closestHit / radius); 182 | 183 | // Gravity gets scaled up with distance because games 184 | force *= 1.0f + distRatio; 185 | item.Rigidbody.AddForce(force * item.Rigidbody.mass); 186 | } 187 | } 188 | } 189 | 190 | /*private void Update() 191 | { 192 | foreach (var item in ItemsInRange) 193 | { 194 | if (item.RotateToGround) 195 | { 196 | item.transform.rotation = Quaternion.Euler(-item.Up); 197 | } 198 | } 199 | }*/ 200 | } 201 | } -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/PlanetGravity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d8fa5b195a5475d85c7c4b99296e323 3 | timeCreated: 1562197181 -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/PlanetGravity2D.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using UnityEngine.Serialization; 4 | 5 | namespace DoctorWolfy121.GravitySystem 6 | { 7 | [AddComponentMenu("Gravity System/Gravity Sources/Planet Gravity 2D")] 8 | public class PlanetGravity2D : MonoBehaviour, IGravitySource2D 9 | { 10 | [FormerlySerializedAs("gravity"), SerializeField, 11 | Tooltip("How much gravity force to apply to objects within range")] 12 | private float gravityStrength = 9.8f; 13 | 14 | [Tooltip("The maximum distance from the surface of the gravity source that is still affected by gravity")] 15 | public float radius = 5.0f; 16 | 17 | [SerializeField] private bool enableGravity = true; 18 | 19 | [SerializeField, Space(5), Tooltip("Enable Debug rays and lines to help visualise the gravity.")] 20 | private bool enableDebug; 21 | 22 | public float GravityStrength => gravityStrength; 23 | 24 | public Collider2D[] GravityColliders { get; private set; } 25 | 26 | public bool EnableGravity => enableGravity; 27 | 28 | private const float MaxRaycastDistance = 100.0f; 29 | 30 | public List ItemsInRange { get; } = new List(); 31 | 32 | private void OnDrawGizmos() 33 | { 34 | if (!enableDebug) return; 35 | 36 | // Visualize gravity radius 37 | Gizmos.color = Color.magenta; 38 | for (int i = 0; GravityColliders != null && i < GravityColliders.Length; ++i) 39 | { 40 | var col = GravityColliders[i]; 41 | DrawLine(col, transform.up); 42 | DrawLine(col, transform.right); 43 | } 44 | } 45 | 46 | private void DrawLine(Collider2D collider, Vector3 dir) 47 | { 48 | var raycastFrom = collider.transform.position + dir * 1000.0f; 49 | var raycastDir = (collider.transform.position - raycastFrom).normalized; 50 | 51 | Gizmos.DrawLine(raycastFrom, raycastDir * (-radius * 2)); 52 | } 53 | 54 | private void Awake() 55 | { 56 | GravityColliders = GetComponents(); 57 | 58 | if (GravityColliders == null || GravityColliders.Length == 0) 59 | { 60 | Debug.LogWarning("GravitySource has no colliders, will not be functional."); 61 | } 62 | } 63 | 64 | private void OnTriggerStay2D(Collider2D c) 65 | { 66 | var item = c.GetComponent(); 67 | if (item == null || ItemsInRange.Contains(item)) return; 68 | 69 | ItemsInRange.Add(item); 70 | 71 | ++item.ActiveFieldCount; 72 | item.CurrentGravitySource.Add(this); 73 | } 74 | 75 | private void OnTriggerExit2D(Collider2D c) 76 | { 77 | var item = c.GetComponent(); 78 | if (item == null || !ItemsInRange.Contains(item)) return; 79 | 80 | ItemsInRange.Remove(item); 81 | 82 | --item.ActiveFieldCount; 83 | if (item.CurrentGravitySource.Contains(this)) 84 | { 85 | item.CurrentDistance = Mathf.Infinity; 86 | item.CurrentGravitySource.Remove(this); 87 | } 88 | } 89 | 90 | private void FixedUpdate() 91 | { 92 | if (!EnableGravity) return; 93 | 94 | // Iterate over each object within range of our gravity 95 | for (int i = 0; ItemsInRange != null && i < ItemsInRange.Count; ++i) 96 | { 97 | if (ItemsInRange[i] == null || ItemsInRange[i].Rigidbody2D.gravityScale <= 0) 98 | continue; 99 | 100 | // Calculate initial gravity direction, just towards the gravity source transform 101 | var item = ItemsInRange[i]; 102 | var gravityDir = (transform.position - item.transform.position).normalized; 103 | 104 | // Find out which of our child colliders is closest 105 | var closestHit = Mathf.Infinity; 106 | foreach (var gravityCollider in GravityColliders) 107 | { 108 | // Skips this collider if it isn't a trigger 109 | if (!gravityCollider.isTrigger) continue; 110 | 111 | // Raycast in general direction of collider to find a normal of the surface 112 | var raycastTo = gravityCollider.transform.position; 113 | var toCollider = (raycastTo - item.transform.position).normalized; 114 | var gravityRay = new Ray(item.transform.position, toCollider); 115 | 116 | RaycastHit2D[] raycastHit = new RaycastHit2D[0]; 117 | var raycastInt = gravityCollider.Raycast(toCollider, raycastHit, MaxRaycastDistance); 118 | if (raycastInt > 0) 119 | { 120 | if (enableDebug) 121 | { 122 | Debug.DrawRay(gravityRay.origin, gravityRay.direction * 2, Color.red); 123 | Debug.DrawRay(raycastHit[0].point, raycastHit[0].normal * 2, Color.red); 124 | gravityRay = new Ray(item.transform.position, -raycastHit[0].normal); 125 | } 126 | 127 | // Set our new ray to point in the opposite direction of this normal, to raycast 'down' towards the closest point on the plane formed by the normal 128 | 129 | // Update gravity direction guess if this was a closer hit 130 | var dist = Vector2.Distance(raycastHit[0].point, gravityRay.origin); 131 | if (dist < closestHit) 132 | { 133 | gravityDir = -raycastHit[0].normal; 134 | closestHit = dist; 135 | } 136 | } 137 | 138 | // Raycast a second time onto the collider with the refined 'down' direction 139 | if (raycastInt > 0) 140 | { 141 | raycastInt = gravityCollider.Raycast(raycastHit[0].normal, raycastHit, MaxRaycastDistance); 142 | 143 | if (raycastInt > 0) 144 | { 145 | if (enableDebug) 146 | { 147 | Debug.DrawRay(gravityRay.origin, gravityRay.direction * 2, Color.green); 148 | Debug.DrawRay(raycastHit[0].point, raycastHit[0].normal * 2, Color.green); 149 | } 150 | 151 | var dist = Vector2.Distance(raycastHit[0].point, gravityRay.origin); 152 | if (dist < closestHit) 153 | { 154 | gravityDir = -raycastHit[0].normal; 155 | closestHit = dist; 156 | } 157 | } 158 | } 159 | } 160 | 161 | if (enableDebug) 162 | { 163 | Debug.DrawRay(item.transform.position, gravityDir * 2, Color.blue); 164 | } 165 | 166 | // Now apply gravity if we are the closest source (only 1 source at a time applies gravity) 167 | if (item.CurrentGravitySource.Contains(this) || closestHit < item.CurrentDistance) 168 | { 169 | // Update tracking vars 170 | item.CurrentDistance = closestHit; 171 | if (!item.CurrentGravitySource.Contains(this)) 172 | { 173 | item.CurrentGravitySource.Add(this); 174 | } 175 | 176 | item.Up = Vector2.Lerp(item.Up, -gravityDir.normalized, Time.deltaTime * 2.0f); 177 | 178 | if (item.RotateToGround) 179 | { 180 | item.transform.up = -gravityDir.normalized; 181 | } 182 | 183 | // Calculate force 184 | var force = gravityDir.normalized * GravityStrength; 185 | var distRatio = Mathf.Clamp01(closestHit / radius); 186 | 187 | // Gravity gets scaled up with distance because games 188 | force *= 1.0f + distRatio; 189 | item.Rigidbody2D.AddForce(force * item.Rigidbody2D.mass); 190 | } 191 | } 192 | } 193 | } 194 | } -------------------------------------------------------------------------------- /ExampleProject/Assets/Scripts/PlanetGravity2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6cab4c5a50664a649f1639d1ec3906c2 3 | timeCreated: 1562249875 -------------------------------------------------------------------------------- /ExampleProject/Logs/Packages-Update.log: -------------------------------------------------------------------------------- 1 | 2 | === Thu Jul 4 00:30:55 2019 3 | 4 | Packages were changed. 5 | Update Mode: mergeDefaultDependencies 6 | 7 | The following packages were updated: 8 | com.unity.analytics from version 3.2.2 to 3.3.2 9 | com.unity.collab-proxy from version 1.2.9 to 1.2.16 10 | com.unity.package-manager-ui from version 2.1.1 to 2.1.2 11 | com.unity.purchasing from version 2.0.1 to 2.0.6 12 | com.unity.textmeshpro from version 1.3.0 to 2.0.1 13 | com.unity.timeline from version 0.0.0-builtin to 1.0.0 14 | -------------------------------------------------------------------------------- /ExampleProject/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "3.3.2", 5 | "com.unity.collab-proxy": "1.2.16", 6 | "com.unity.package-manager-ui": "2.1.2", 7 | "com.unity.purchasing": "2.0.6", 8 | "com.unity.textmeshpro": "2.0.1", 9 | "com.unity.timeline": "1.0.0", 10 | "com.unity.modules.ai": "1.0.0", 11 | "com.unity.modules.animation": "1.0.0", 12 | "com.unity.modules.assetbundle": "1.0.0", 13 | "com.unity.modules.audio": "1.0.0", 14 | "com.unity.modules.cloth": "1.0.0", 15 | "com.unity.modules.director": "1.0.0", 16 | "com.unity.modules.imageconversion": "1.0.0", 17 | "com.unity.modules.imgui": "1.0.0", 18 | "com.unity.modules.jsonserialize": "1.0.0", 19 | "com.unity.modules.particlesystem": "1.0.0", 20 | "com.unity.modules.physics": "1.0.0", 21 | "com.unity.modules.physics2d": "1.0.0", 22 | "com.unity.modules.screencapture": "1.0.0", 23 | "com.unity.modules.terrain": "1.0.0", 24 | "com.unity.modules.terrainphysics": "1.0.0", 25 | "com.unity.modules.tilemap": "1.0.0", 26 | "com.unity.modules.ui": "1.0.0", 27 | "com.unity.modules.uielements": "1.0.0", 28 | "com.unity.modules.umbra": "1.0.0", 29 | "com.unity.modules.unityanalytics": "1.0.0", 30 | "com.unity.modules.unitywebrequest": "1.0.0", 31 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 32 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 33 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 34 | "com.unity.modules.unitywebrequestwww": "1.0.0", 35 | "com.unity.modules.vehicles": "1.0.0", 36 | "com.unity.modules.video": "1.0.0", 37 | "com.unity.modules.vr": "1.0.0", 38 | "com.unity.modules.wind": "1.0.0", 39 | "com.unity.modules.xr": "1.0.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: 0, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 26 | m_ContactPairsMode: 0 27 | m_BroadphaseType: 0 28 | m_WorldBounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 250, y: 250, z: 250} 31 | m_WorldSubdivisions: 8 32 | m_FrictionType: 0 33 | m_EnableEnhancedDeterminism: 0 34 | m_EnableUnifiedHeightmaps: 1 35 | m_DefaultMaxAngularSpeed: 7 36 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 16 7 | productGUID: f8c95d8945622fb41b85f453ed90adbb 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: PlanetGravity 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 0 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 1 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 1 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | useFlipModelSwapchain: 1 83 | resizableWindow: 0 84 | useMacAppStoreValidation: 0 85 | macAppStoreCategory: public.app-category.games 86 | gpuSkinning: 1 87 | graphicsJobs: 0 88 | xboxPIXTextureCapture: 0 89 | xboxEnableAvatar: 0 90 | xboxEnableKinect: 0 91 | xboxEnableKinectAutoTracking: 0 92 | xboxEnableFitness: 0 93 | visibleInBackground: 1 94 | allowFullscreenSwitch: 1 95 | graphicsJobMode: 0 96 | fullscreenMode: 1 97 | xboxSpeechDB: 0 98 | xboxEnableHeadOrientation: 0 99 | xboxEnableGuest: 0 100 | xboxEnablePIXSampling: 0 101 | metalFramebufferOnly: 0 102 | xboxOneResolution: 0 103 | xboxOneSResolution: 0 104 | xboxOneXResolution: 3 105 | xboxOneMonoLoggingLevel: 0 106 | xboxOneLoggingLevel: 1 107 | xboxOneDisableEsram: 0 108 | xboxOnePresentImmediateThreshold: 0 109 | switchQueueCommandMemory: 0 110 | switchQueueControlMemory: 16384 111 | switchQueueComputeMemory: 262144 112 | switchNVNShaderPoolsGranularity: 33554432 113 | switchNVNDefaultPoolsGranularity: 16777216 114 | switchNVNOtherPoolsGranularity: 16777216 115 | vulkanEnableSetSRGBWrite: 0 116 | m_SupportedAspectRatios: 117 | 4:3: 1 118 | 5:4: 1 119 | 16:10: 1 120 | 16:9: 1 121 | Others: 1 122 | bundleVersion: 0.1 123 | preloadedAssets: [] 124 | metroInputSource: 0 125 | wsaTransparentSwapchain: 0 126 | m_HolographicPauseOnTrackingLoss: 1 127 | xboxOneDisableKinectGpuReservation: 1 128 | xboxOneEnable7thCore: 1 129 | vrSettings: 130 | cardboard: 131 | depthFormat: 0 132 | enableTransitionView: 0 133 | daydream: 134 | depthFormat: 0 135 | useSustainedPerformanceMode: 0 136 | enableVideoLayer: 0 137 | useProtectedVideoMemory: 0 138 | minimumSupportedHeadTracking: 0 139 | maximumSupportedHeadTracking: 1 140 | hololens: 141 | depthFormat: 1 142 | depthBufferSharingEnabled: 1 143 | lumin: 144 | depthFormat: 0 145 | frameTiming: 2 146 | enableGLCache: 0 147 | glCacheMaxBlobSize: 524288 148 | glCacheMaxFileSize: 8388608 149 | oculus: 150 | sharedDepthBuffer: 1 151 | dashSupport: 1 152 | enable360StereoCapture: 0 153 | isWsaHolographicRemotingEnabled: 0 154 | protectGraphicsMemory: 0 155 | enableFrameTimingStats: 0 156 | useHDRDisplay: 0 157 | m_ColorGamuts: 00000000 158 | targetPixelDensity: 30 159 | resolutionScalingMode: 0 160 | androidSupportedAspectRatio: 1 161 | androidMaxAspectRatio: 2.1 162 | applicationIdentifier: {} 163 | buildNumber: {} 164 | AndroidBundleVersionCode: 1 165 | AndroidMinSdkVersion: 16 166 | AndroidTargetSdkVersion: 0 167 | AndroidPreferredInstallLocation: 1 168 | aotOptions: 169 | stripEngineCode: 1 170 | iPhoneStrippingLevel: 0 171 | iPhoneScriptCallOptimization: 0 172 | ForceInternetPermission: 0 173 | ForceSDCardPermission: 0 174 | CreateWallpaper: 0 175 | APKExpansionFiles: 0 176 | keepLoadedShadersAlive: 0 177 | StripUnusedMeshComponents: 1 178 | VertexChannelCompressionMask: 4054 179 | iPhoneSdkVersion: 988 180 | iOSTargetOSVersionString: 9.0 181 | tvOSSdkVersion: 0 182 | tvOSRequireExtendedGameController: 0 183 | tvOSTargetOSVersionString: 9.0 184 | uIPrerenderedIcon: 0 185 | uIRequiresPersistentWiFi: 0 186 | uIRequiresFullScreen: 1 187 | uIStatusBarHidden: 1 188 | uIExitOnSuspend: 0 189 | uIStatusBarStyle: 0 190 | iPhoneSplashScreen: {fileID: 0} 191 | iPhoneHighResSplashScreen: {fileID: 0} 192 | iPhoneTallHighResSplashScreen: {fileID: 0} 193 | iPhone47inSplashScreen: {fileID: 0} 194 | iPhone55inPortraitSplashScreen: {fileID: 0} 195 | iPhone55inLandscapeSplashScreen: {fileID: 0} 196 | iPhone58inPortraitSplashScreen: {fileID: 0} 197 | iPhone58inLandscapeSplashScreen: {fileID: 0} 198 | iPadPortraitSplashScreen: {fileID: 0} 199 | iPadHighResPortraitSplashScreen: {fileID: 0} 200 | iPadLandscapeSplashScreen: {fileID: 0} 201 | iPadHighResLandscapeSplashScreen: {fileID: 0} 202 | iPhone65inPortraitSplashScreen: {fileID: 0} 203 | iPhone65inLandscapeSplashScreen: {fileID: 0} 204 | iPhone61inPortraitSplashScreen: {fileID: 0} 205 | iPhone61inLandscapeSplashScreen: {fileID: 0} 206 | appleTVSplashScreen: {fileID: 0} 207 | appleTVSplashScreen2x: {fileID: 0} 208 | tvOSSmallIconLayers: [] 209 | tvOSSmallIconLayers2x: [] 210 | tvOSLargeIconLayers: [] 211 | tvOSLargeIconLayers2x: [] 212 | tvOSTopShelfImageLayers: [] 213 | tvOSTopShelfImageLayers2x: [] 214 | tvOSTopShelfImageWideLayers: [] 215 | tvOSTopShelfImageWideLayers2x: [] 216 | iOSLaunchScreenType: 0 217 | iOSLaunchScreenPortrait: {fileID: 0} 218 | iOSLaunchScreenLandscape: {fileID: 0} 219 | iOSLaunchScreenBackgroundColor: 220 | serializedVersion: 2 221 | rgba: 0 222 | iOSLaunchScreenFillPct: 100 223 | iOSLaunchScreenSize: 100 224 | iOSLaunchScreenCustomXibPath: 225 | iOSLaunchScreeniPadType: 0 226 | iOSLaunchScreeniPadImage: {fileID: 0} 227 | iOSLaunchScreeniPadBackgroundColor: 228 | serializedVersion: 2 229 | rgba: 0 230 | iOSLaunchScreeniPadFillPct: 100 231 | iOSLaunchScreeniPadSize: 100 232 | iOSLaunchScreeniPadCustomXibPath: 233 | iOSUseLaunchScreenStoryboard: 0 234 | iOSLaunchScreenCustomStoryboardPath: 235 | iOSDeviceRequirements: [] 236 | iOSURLSchemes: [] 237 | iOSBackgroundModes: 0 238 | iOSMetalForceHardShadows: 0 239 | metalEditorSupport: 1 240 | metalAPIValidation: 1 241 | iOSRenderExtraFrameOnPause: 0 242 | appleDeveloperTeamID: 243 | iOSManualSigningProvisioningProfileID: 244 | tvOSManualSigningProvisioningProfileID: 245 | iOSManualSigningProvisioningProfileType: 0 246 | tvOSManualSigningProvisioningProfileType: 0 247 | appleEnableAutomaticSigning: 0 248 | iOSRequireARKit: 0 249 | iOSAutomaticallyDetectAndAddCapabilities: 1 250 | appleEnableProMotion: 0 251 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 252 | templatePackageId: com.unity.template.3d@2.3.3 253 | templateDefaultScene: Assets/Scenes/SampleScene.unity 254 | AndroidTargetArchitectures: 1 255 | AndroidSplashScreenScale: 0 256 | androidSplashScreen: {fileID: 0} 257 | AndroidKeystoreName: '{inproject}: ' 258 | AndroidKeyaliasName: 259 | AndroidBuildApkPerCpuArchitecture: 0 260 | AndroidTVCompatibility: 0 261 | AndroidIsGame: 1 262 | AndroidEnableTango: 0 263 | androidEnableBanner: 1 264 | androidUseLowAccuracyLocation: 0 265 | androidUseCustomKeystore: 0 266 | m_AndroidBanners: 267 | - width: 320 268 | height: 180 269 | banner: {fileID: 0} 270 | androidGamepadSupportLevel: 0 271 | resolutionDialogBanner: {fileID: 0} 272 | m_BuildTargetIcons: [] 273 | m_BuildTargetPlatformIcons: [] 274 | m_BuildTargetBatching: 275 | - m_BuildTarget: Standalone 276 | m_StaticBatching: 1 277 | m_DynamicBatching: 0 278 | - m_BuildTarget: tvOS 279 | m_StaticBatching: 1 280 | m_DynamicBatching: 0 281 | - m_BuildTarget: Android 282 | m_StaticBatching: 1 283 | m_DynamicBatching: 0 284 | - m_BuildTarget: iPhone 285 | m_StaticBatching: 1 286 | m_DynamicBatching: 0 287 | - m_BuildTarget: WebGL 288 | m_StaticBatching: 0 289 | m_DynamicBatching: 0 290 | m_BuildTargetGraphicsAPIs: 291 | - m_BuildTarget: AndroidPlayer 292 | m_APIs: 150000000b000000 293 | m_Automatic: 0 294 | - m_BuildTarget: iOSSupport 295 | m_APIs: 10000000 296 | m_Automatic: 1 297 | - m_BuildTarget: AppleTVSupport 298 | m_APIs: 10000000 299 | m_Automatic: 0 300 | - m_BuildTarget: WebGLSupport 301 | m_APIs: 0b000000 302 | m_Automatic: 1 303 | m_BuildTargetVRSettings: 304 | - m_BuildTarget: Standalone 305 | m_Enabled: 0 306 | m_Devices: 307 | - Oculus 308 | - OpenVR 309 | m_BuildTargetEnableVuforiaSettings: [] 310 | openGLRequireES31: 0 311 | openGLRequireES31AEP: 0 312 | openGLRequireES32: 0 313 | m_TemplateCustomTags: {} 314 | mobileMTRendering: 315 | Android: 1 316 | iPhone: 1 317 | tvOS: 1 318 | m_BuildTargetGroupLightmapEncodingQuality: [] 319 | m_BuildTargetGroupLightmapSettings: [] 320 | playModeTestRunnerEnabled: 0 321 | runPlayModeTestAsEditModeTest: 0 322 | actionOnDotNetUnhandledException: 1 323 | enableInternalProfiler: 0 324 | logObjCUncaughtExceptions: 1 325 | enableCrashReportAPI: 0 326 | cameraUsageDescription: 327 | locationUsageDescription: 328 | microphoneUsageDescription: 329 | switchNetLibKey: 330 | switchSocketMemoryPoolSize: 6144 331 | switchSocketAllocatorPoolSize: 128 332 | switchSocketConcurrencyLimit: 14 333 | switchScreenResolutionBehavior: 2 334 | switchUseCPUProfiler: 0 335 | switchApplicationID: 0x01004b9000490000 336 | switchNSODependencies: 337 | switchTitleNames_0: 338 | switchTitleNames_1: 339 | switchTitleNames_2: 340 | switchTitleNames_3: 341 | switchTitleNames_4: 342 | switchTitleNames_5: 343 | switchTitleNames_6: 344 | switchTitleNames_7: 345 | switchTitleNames_8: 346 | switchTitleNames_9: 347 | switchTitleNames_10: 348 | switchTitleNames_11: 349 | switchTitleNames_12: 350 | switchTitleNames_13: 351 | switchTitleNames_14: 352 | switchPublisherNames_0: 353 | switchPublisherNames_1: 354 | switchPublisherNames_2: 355 | switchPublisherNames_3: 356 | switchPublisherNames_4: 357 | switchPublisherNames_5: 358 | switchPublisherNames_6: 359 | switchPublisherNames_7: 360 | switchPublisherNames_8: 361 | switchPublisherNames_9: 362 | switchPublisherNames_10: 363 | switchPublisherNames_11: 364 | switchPublisherNames_12: 365 | switchPublisherNames_13: 366 | switchPublisherNames_14: 367 | switchIcons_0: {fileID: 0} 368 | switchIcons_1: {fileID: 0} 369 | switchIcons_2: {fileID: 0} 370 | switchIcons_3: {fileID: 0} 371 | switchIcons_4: {fileID: 0} 372 | switchIcons_5: {fileID: 0} 373 | switchIcons_6: {fileID: 0} 374 | switchIcons_7: {fileID: 0} 375 | switchIcons_8: {fileID: 0} 376 | switchIcons_9: {fileID: 0} 377 | switchIcons_10: {fileID: 0} 378 | switchIcons_11: {fileID: 0} 379 | switchIcons_12: {fileID: 0} 380 | switchIcons_13: {fileID: 0} 381 | switchIcons_14: {fileID: 0} 382 | switchSmallIcons_0: {fileID: 0} 383 | switchSmallIcons_1: {fileID: 0} 384 | switchSmallIcons_2: {fileID: 0} 385 | switchSmallIcons_3: {fileID: 0} 386 | switchSmallIcons_4: {fileID: 0} 387 | switchSmallIcons_5: {fileID: 0} 388 | switchSmallIcons_6: {fileID: 0} 389 | switchSmallIcons_7: {fileID: 0} 390 | switchSmallIcons_8: {fileID: 0} 391 | switchSmallIcons_9: {fileID: 0} 392 | switchSmallIcons_10: {fileID: 0} 393 | switchSmallIcons_11: {fileID: 0} 394 | switchSmallIcons_12: {fileID: 0} 395 | switchSmallIcons_13: {fileID: 0} 396 | switchSmallIcons_14: {fileID: 0} 397 | switchManualHTML: 398 | switchAccessibleURLs: 399 | switchLegalInformation: 400 | switchMainThreadStackSize: 1048576 401 | switchPresenceGroupId: 402 | switchLogoHandling: 0 403 | switchReleaseVersion: 0 404 | switchDisplayVersion: 1.0.0 405 | switchStartupUserAccount: 0 406 | switchTouchScreenUsage: 0 407 | switchSupportedLanguagesMask: 0 408 | switchLogoType: 0 409 | switchApplicationErrorCodeCategory: 410 | switchUserAccountSaveDataSize: 0 411 | switchUserAccountSaveDataJournalSize: 0 412 | switchApplicationAttribute: 0 413 | switchCardSpecSize: -1 414 | switchCardSpecClock: -1 415 | switchRatingsMask: 0 416 | switchRatingsInt_0: 0 417 | switchRatingsInt_1: 0 418 | switchRatingsInt_2: 0 419 | switchRatingsInt_3: 0 420 | switchRatingsInt_4: 0 421 | switchRatingsInt_5: 0 422 | switchRatingsInt_6: 0 423 | switchRatingsInt_7: 0 424 | switchRatingsInt_8: 0 425 | switchRatingsInt_9: 0 426 | switchRatingsInt_10: 0 427 | switchRatingsInt_11: 0 428 | switchLocalCommunicationIds_0: 429 | switchLocalCommunicationIds_1: 430 | switchLocalCommunicationIds_2: 431 | switchLocalCommunicationIds_3: 432 | switchLocalCommunicationIds_4: 433 | switchLocalCommunicationIds_5: 434 | switchLocalCommunicationIds_6: 435 | switchLocalCommunicationIds_7: 436 | switchParentalControl: 0 437 | switchAllowsScreenshot: 1 438 | switchAllowsVideoCapturing: 1 439 | switchAllowsRuntimeAddOnContentInstall: 0 440 | switchDataLossConfirmation: 0 441 | switchUserAccountLockEnabled: 0 442 | switchSystemResourceMemory: 16777216 443 | switchSupportedNpadStyles: 3 444 | switchNativeFsCacheSize: 32 445 | switchIsHoldTypeHorizontal: 0 446 | switchSupportedNpadCount: 8 447 | switchSocketConfigEnabled: 0 448 | switchTcpInitialSendBufferSize: 32 449 | switchTcpInitialReceiveBufferSize: 64 450 | switchTcpAutoSendBufferSizeMax: 256 451 | switchTcpAutoReceiveBufferSizeMax: 256 452 | switchUdpSendBufferSize: 9 453 | switchUdpReceiveBufferSize: 42 454 | switchSocketBufferEfficiency: 4 455 | switchSocketInitializeEnabled: 1 456 | switchNetworkInterfaceManagerInitializeEnabled: 1 457 | switchPlayerConnectionEnabled: 1 458 | ps4NPAgeRating: 12 459 | ps4NPTitleSecret: 460 | ps4NPTrophyPackPath: 461 | ps4ParentalLevel: 11 462 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 463 | ps4Category: 0 464 | ps4MasterVersion: 01.00 465 | ps4AppVersion: 01.00 466 | ps4AppType: 0 467 | ps4ParamSfxPath: 468 | ps4VideoOutPixelFormat: 0 469 | ps4VideoOutInitialWidth: 1920 470 | ps4VideoOutBaseModeInitialWidth: 1920 471 | ps4VideoOutReprojectionRate: 60 472 | ps4PronunciationXMLPath: 473 | ps4PronunciationSIGPath: 474 | ps4BackgroundImagePath: 475 | ps4StartupImagePath: 476 | ps4StartupImagesFolder: 477 | ps4IconImagesFolder: 478 | ps4SaveDataImagePath: 479 | ps4SdkOverride: 480 | ps4BGMPath: 481 | ps4ShareFilePath: 482 | ps4ShareOverlayImagePath: 483 | ps4PrivacyGuardImagePath: 484 | ps4NPtitleDatPath: 485 | ps4RemotePlayKeyAssignment: -1 486 | ps4RemotePlayKeyMappingDir: 487 | ps4PlayTogetherPlayerCount: 0 488 | ps4EnterButtonAssignment: 1 489 | ps4ApplicationParam1: 0 490 | ps4ApplicationParam2: 0 491 | ps4ApplicationParam3: 0 492 | ps4ApplicationParam4: 0 493 | ps4DownloadDataSize: 0 494 | ps4GarlicHeapSize: 2048 495 | ps4ProGarlicHeapSize: 2560 496 | playerPrefsMaxSize: 32768 497 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 498 | ps4pnSessions: 1 499 | ps4pnPresence: 1 500 | ps4pnFriends: 1 501 | ps4pnGameCustomData: 1 502 | playerPrefsSupport: 0 503 | enableApplicationExit: 0 504 | resetTempFolder: 1 505 | restrictedAudioUsageRights: 0 506 | ps4UseResolutionFallback: 0 507 | ps4ReprojectionSupport: 0 508 | ps4UseAudio3dBackend: 0 509 | ps4SocialScreenEnabled: 0 510 | ps4ScriptOptimizationLevel: 0 511 | ps4Audio3dVirtualSpeakerCount: 14 512 | ps4attribCpuUsage: 0 513 | ps4PatchPkgPath: 514 | ps4PatchLatestPkgPath: 515 | ps4PatchChangeinfoPath: 516 | ps4PatchDayOne: 0 517 | ps4attribUserManagement: 0 518 | ps4attribMoveSupport: 0 519 | ps4attrib3DSupport: 0 520 | ps4attribShareSupport: 0 521 | ps4attribExclusiveVR: 0 522 | ps4disableAutoHideSplash: 0 523 | ps4videoRecordingFeaturesUsed: 0 524 | ps4contentSearchFeaturesUsed: 0 525 | ps4attribEyeToEyeDistanceSettingVR: 0 526 | ps4IncludedModules: [] 527 | monoEnv: 528 | splashScreenBackgroundSourceLandscape: {fileID: 0} 529 | splashScreenBackgroundSourcePortrait: {fileID: 0} 530 | spritePackerPolicy: 531 | webGLMemorySize: 16 532 | webGLExceptionSupport: 1 533 | webGLNameFilesAsHashes: 0 534 | webGLDataCaching: 1 535 | webGLDebugSymbols: 0 536 | webGLEmscriptenArgs: 537 | webGLModulesDirectory: 538 | webGLTemplate: APPLICATION:Default 539 | webGLAnalyzeBuildSize: 0 540 | webGLUseEmbeddedResources: 0 541 | webGLCompressionFormat: 1 542 | webGLLinkerTarget: 1 543 | webGLThreadsSupport: 0 544 | webGLWasmStreaming: 0 545 | scriptingDefineSymbols: {} 546 | platformArchitecture: {} 547 | scriptingBackend: {} 548 | il2cppCompilerConfiguration: {} 549 | managedStrippingLevel: {} 550 | incrementalIl2cppBuild: {} 551 | allowUnsafeCode: 0 552 | additionalIl2CppArgs: 553 | scriptingRuntimeVersion: 1 554 | gcIncremental: 0 555 | gcWBarrierValidation: 0 556 | apiCompatibilityLevelPerPlatform: {} 557 | m_RenderingPath: 1 558 | m_MobileRenderingPath: 1 559 | metroPackageName: Template_3D 560 | metroPackageVersion: 561 | metroCertificatePath: 562 | metroCertificatePassword: 563 | metroCertificateSubject: 564 | metroCertificateIssuer: 565 | metroCertificateNotAfter: 0000000000000000 566 | metroApplicationDescription: Template_3D 567 | wsaImages: {} 568 | metroTileShortName: 569 | metroTileShowName: 0 570 | metroMediumTileShowName: 0 571 | metroLargeTileShowName: 0 572 | metroWideTileShowName: 0 573 | metroSupportStreamingInstall: 0 574 | metroLastRequiredScene: 0 575 | metroDefaultTileSize: 1 576 | metroTileForegroundText: 2 577 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 578 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 579 | a: 1} 580 | metroSplashScreenUseBackgroundColor: 0 581 | platformCapabilities: {} 582 | metroTargetDeviceFamilies: {} 583 | metroFTAName: 584 | metroFTAFileTypes: [] 585 | metroProtocolName: 586 | XboxOneProductId: 587 | XboxOneUpdateKey: 588 | XboxOneSandboxId: 589 | XboxOneContentId: 590 | XboxOneTitleId: 591 | XboxOneSCId: 592 | XboxOneGameOsOverridePath: 593 | XboxOnePackagingOverridePath: 594 | XboxOneAppManifestOverridePath: 595 | XboxOneVersion: 1.0.0.0 596 | XboxOnePackageEncryption: 0 597 | XboxOnePackageUpdateGranularity: 2 598 | XboxOneDescription: 599 | XboxOneLanguage: 600 | - enus 601 | XboxOneCapability: [] 602 | XboxOneGameRating: {} 603 | XboxOneIsContentPackage: 0 604 | XboxOneEnableGPUVariability: 1 605 | XboxOneSockets: {} 606 | XboxOneSplashScreen: {fileID: 0} 607 | XboxOneAllowedProductIds: [] 608 | XboxOnePersistentLocalStorageSize: 0 609 | XboxOneXTitleMemory: 8 610 | xboxOneScriptCompiler: 1 611 | XboxOneOverrideIdentityName: 612 | vrEditorSettings: 613 | daydream: 614 | daydreamIconForeground: {fileID: 0} 615 | daydreamIconBackground: {fileID: 0} 616 | cloudServicesEnabled: 617 | UNet: 1 618 | luminIcon: 619 | m_Name: 620 | m_ModelFolderPath: 621 | m_PortalFolderPath: 622 | luminCert: 623 | m_CertPath: 624 | m_SignPackage: 1 625 | luminIsChannelApp: 0 626 | luminVersion: 627 | m_VersionCode: 1 628 | m_VersionName: 629 | facebookSdkVersion: 7.9.4 630 | facebookAppId: 631 | facebookCookies: 1 632 | facebookLogging: 1 633 | facebookStatus: 1 634 | facebookXfbml: 0 635 | facebookFrictionlessRequests: 1 636 | apiCompatibilityLevel: 6 637 | cloudProjectId: 638 | framebufferDepthMemorylessMode: 0 639 | projectName: 640 | organizationId: 641 | cloudEnabled: 0 642 | enableNativePlatformBackendsForNewInputSystem: 0 643 | disableOldInputManagerSupport: 0 644 | legacyClampBlendShapeWeights: 0 645 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.1.9f1 2 | m_EditorVersionWithRevision: 2019.1.9f1 (d5f1b37da199) 3 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Standalone: 5 227 | WebGL: 3 228 | Windows Store Apps: 5 229 | XboxOne: 5 230 | iPhone: 2 231 | tvOS: 2 232 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /ExampleProject/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /INSTALLING.md: -------------------------------------------------------------------------------- 1 | # Installing 2 | 3 | ## Downloading 4 | 1. Download the latest Unity Package. Check the [releases on this repository](https://github.com/WSWhitehouse/Unity-Gravity-System/releases) to find the version you want, or [click here for the latest release](https://github.com/WSWhitehouse/Unity-Gravity-System/releases/latest). 5 | 2. Extract the Unity Package in your project. 6 | 7 | ## Setting up your project 8 | 9 | ### 3D 10 | 11 | *Optional - If you leave Global Gravity on, objects will still react as normal as well with the gravity sources, however you might want to make global gravity weaker or gravity sources stronger* - Set 3D global gravity to 0. 12 | 13 | - To change 3D physics, go to ProjectSettings -> Physics 14 | 15 | [![3D Gravity](https://i.gyazo.com/7f819af070ec7c4bccfac03a2524bd1e.png)](https://gyazo.com/7f819af070ec7c4bccfac03a2524bd1e) 16 | 17 | ### 2D 18 | 19 | *Optional - If you leave Global Gravity on, objects will still react as normal as well with the gravity sources, however you might want to make global gravity weaker or gravity sources stronger* - Set 2D global gravity to 0. 20 | 21 | - To change 2D physics, go to ProjectSettings -> Physics 2D 22 | 23 | [![2D Gravity](https://i.gyazo.com/7b173d32f32b0fa52a0a8a3ed9d1ee80.png)](https://gyazo.com/7b173d32f32b0fa52a0a8a3ed9d1ee80) 24 | 25 | ## Setting up an item 26 | 27 | ### 3D 28 | 29 | 1. Apply a `Collider` and `Rigidbody` to your item. 30 | 2. Make sure `Use Gravity` is **TRUE** on the rigidbody. If `Use Gravity` is false, it will not be affected by the gravity sources. 31 | 3. Add a `GravityItem` Script to the item. 32 | 33 | ### 2D 34 | 35 | 1. Apply a `Collider2D` and `Rigidbody2D` to your item. 36 | 2. Make sure `Gravity Scale` is **ABOVE 0** on the rigidbody. If `Gravity Scale` is below 0, it will not be affected by the gravity sources. 37 | 3. Add a `GravityItem2D` Script to the item. 38 | 39 | ## Setting up a Gravity Source 40 | 41 | ### 3D 42 | 43 | 1. Create an Empty GameObject in the centre of your planet or platform. 44 | 2. Add a `Collider` - *You can use any collider, but sphere colliders are best for planet gravity* 45 | 3. Make sure `Is Trigger` is **TRUE** on the collider. 46 | 4. You can add multiple colliders and they will all work as the gravity field. - *But they **MUST** be on this GameObject* 47 | 5. Add any gravity source script to the GameObject with the Colliders. 48 | 6. *Optional* - Set the `Gravity Strength` on the Gravity Source. The default gravity is Earth's Gravity 49 | 7. *Optional* - Set `Enable Debug` to true to see the radius of the Gravity Source and what objects are being affected by the Gravity Source. 50 | 8. *Optional* - On Directional Gravity Set `Gravity Direction` to control which way gravity will face. The default option is down. 51 | 52 | [![Planet Gravity](https://i.gyazo.com/d2c6c3647bc17a2e7d603ce7c9e43274.png)](https://gyazo.com/d2c6c3647bc17a2e7d603ce7c9e43274) 53 | 54 | ### 2D 55 | 56 | 1. Create an Empty GameObject in the centre of your planet or platform. 57 | 2. Add a `Collider2D` - *You can use any collider, but circle colliders are best for planet gravity* 58 | 3. Make sure `Is Trigger` is **TRUE** on the collider 2D. 59 | 4. You can add multiple colliders and they will all work as the gravity field. - *But they **MUST** be on this GameObject* 60 | 5. Add any Gravity Source 2D script to the GameObject with the Colliders. 61 | 6. *Optional* - Set the `Gravity Strength` on the Gravity Source. The default gravity is Earth's Gravity 62 | 7. *Optional* - Set `Enable Debug` to true to see the radius of the Gravity Source and what objects are being affected by the Gravity Source. 63 | 8. *Optional* - On Directional Gravity Set `Gravity Direction` to control which way gravity will face. The default option is down. 64 | 65 | [![Planet Gravity 2D](https://i.gyazo.com/b749667879a429a681d8f387a6fd4949.png)](https://gyazo.com/b749667879a429a681d8f387a6fd4949) 66 | 67 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 William Whitehouse 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/PlanetGravityPackage-v1.0.0.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WSWhitehouse/Unity-Gravity-System/5f2bf6119bf7529ef369b0706683808b5e604b81/Packages/PlanetGravityPackage-v1.0.0.unitypackage -------------------------------------------------------------------------------- /Packages/UnityCustomGravity-v1.1.0.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WSWhitehouse/Unity-Gravity-System/5f2bf6119bf7529ef369b0706683808b5e604b81/Packages/UnityCustomGravity-v1.1.0.unitypackage -------------------------------------------------------------------------------- /Packages/UnityGravitySystem-v2.0.0.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WSWhitehouse/Unity-Gravity-System/5f2bf6119bf7529ef369b0706683808b5e604b81/Packages/UnityGravitySystem-v2.0.0.unitypackage -------------------------------------------------------------------------------- /Packages/UnityGravitySystem-v2.1.0.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WSWhitehouse/Unity-Gravity-System/5f2bf6119bf7529ef369b0706683808b5e604b81/Packages/UnityGravitySystem-v2.1.0.unitypackage -------------------------------------------------------------------------------- /Packages/UnityGravitySystem-v2.2.0.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WSWhitehouse/Unity-Gravity-System/5f2bf6119bf7529ef369b0706683808b5e604b81/Packages/UnityGravitySystem-v2.2.0.unitypackage -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity Gravity System 2 | 3 | Unity Gravity System - Super Mario Galaxy style planet and directional gravity! 4 | 5 |

6 | Planet Gravity 3D 7 | Directional Gravity 3D 8 | Planet Gravity 2D 9 |

10 | 11 | ## Releases 12 | For releases check the [releases on this repository](https://github.com/WSWhitehouse/Unity-Gravity-System/releases), for the latest release [click here](https://github.com/WSWhitehouse/Unity-Gravity-System/releases/latest)! 13 | 14 | ## Getting Started 15 | 16 | These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. 17 | 18 | ### Prerequisites 19 | 20 | - Unity 2018+ *Should be compatible with older versions* 21 | 22 | ### Installing 23 | 24 | Read [INSTALLING.md](INSTALLING.md) for installing instructions. 25 | 26 | ## Known Issues 27 | 1. If there are more than one gravity source at a time, the item might remove a current gravity source and not be affected. - *Fixed in v1.1.0* 28 | 2. Change `OnTriggerEnter()` to `OnTriggerStay()` so it can update the gravity source. - *Fixed in v1.1.0* 29 | 3. Make the `CurrentGravitySource` a List so the item can be affected by multiple gravity sources at once, by calculating gravity strength and distance to gravity source. - *Fixed in v2.0.0* 30 | 31 | ## To Do 32 | - Create a 2D version - *Completed in v1.0.0* 33 | - Allow Gravity Items to be affected by multiple gravity sources - *Completed in v2.0.0* 34 | - Add Rotate To Ground, where an item will always face upwards. - *Completed in v2.1.0* 35 | - Add Enable Gravity boolean that will enable and disable a Gravity Source - *Completed in v2.2.0* 36 | - Create detailed documentation - *No estimated release* 37 | 38 | ## Built With 39 | 40 | - [Unity 3D](https://unity.com/) 41 | - [JetBrains Rider](https://www.jetbrains.com/rider/) - The IDE used to code the tools 42 | 43 | ## Versioning 44 | 45 | We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/WSWhitehouse/Unity-Gravity-System/tags). 46 | 47 | ## Authors & Contributors 48 | 49 | - **David Evans** - [*Initial work*](https://gist.github.com/phosphoer/a283cdbeca5d2160d5eed318d0362826) - [Phosphoer](https://github.com/phosphoer) 50 | - **William Whitehouse** - *Examples, install instructions, bug fixes, code improvements/additions & 2D version* - [WSWhitehouse](https://github.com/WSWhitehouse) 51 | 52 | ## Acknowledgments 53 | 54 | - [**Bayat Games**](https://assetstore.unity.com/publishers/26641) - [*Free 2D Game Assets used for 2D example*](https://assetstore.unity.com/packages/2d/environments/free-platform-game-assets-85838) 55 | 56 | ## License 57 | 58 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details 59 | --------------------------------------------------------------------------------