├── .gitignore ├── .vsconfig ├── Assets ├── SplineMesh.meta └── SplineMesh │ ├── DemoAssets.meta │ ├── DemoAssets │ ├── Materials.meta │ ├── Materials │ │ ├── Default.mat │ │ ├── Default.mat.meta │ │ ├── No Name.mat │ │ ├── No Name.mat.meta │ │ ├── OrangeUVTester.mat │ │ ├── OrangeUVTester.mat.meta │ │ ├── ShinyOrange.mat │ │ ├── ShinyOrange.mat.meta │ │ ├── WetBlack.mat │ │ └── WetBlack.mat.meta │ ├── Mesh.meta │ ├── Mesh │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── texture.mat │ │ │ └── texture.mat.meta │ │ ├── Railling.fbx │ │ ├── Railling.fbx.meta │ │ ├── cylinder.dae │ │ └── cylinder.dae.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── Capsule.prefab │ │ ├── Capsule.prefab.meta │ │ ├── Light.prefab │ │ ├── Light.prefab.meta │ │ ├── Pillar.prefab │ │ ├── Pillar.prefab.meta │ │ ├── RopeSegment.prefab │ │ └── RopeSegment.prefab.meta │ ├── Texture.meta │ └── Texture │ │ ├── UVTester.png │ │ ├── UVTester.png.meta │ │ ├── normalmap-quad.png │ │ └── normalmap-quad.png.meta │ ├── Doc.txt │ ├── Doc.txt.meta │ ├── Scripts.meta │ ├── Scripts │ ├── Bezier.meta │ ├── Bezier │ │ ├── CubicBezierCurve.cs │ │ ├── CubicBezierCurve.cs.meta │ │ ├── CurveSample.cs │ │ ├── CurveSample.cs.meta │ │ ├── Spline.cs │ │ ├── Spline.cs.meta │ │ ├── SplineNode.cs │ │ ├── SplineNode.cs.meta │ │ ├── SplineSmoother.cs │ │ └── SplineSmoother.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── SplineEditor.cs │ │ ├── SplineEditor.cs.meta │ │ ├── SplineExtrusionEditor.cs │ │ └── SplineExtrusionEditor.cs.meta │ ├── Example.meta │ ├── Example │ │ ├── ExampleContortAlong.cs │ │ ├── ExampleContortAlong.cs.meta │ │ ├── ExampleFollowSpline.cs │ │ ├── ExampleFollowSpline.cs.meta │ │ ├── ExampleGrowingRoot.cs │ │ ├── ExampleGrowingRoot.cs.meta │ │ ├── ExampleSower.cs │ │ ├── ExampleSower.cs.meta │ │ ├── ExampleTentacle.cs │ │ ├── ExampleTentacle.cs.meta │ │ ├── ExampleTrack.cs │ │ ├── ExampleTrack.cs.meta │ │ ├── RopeBuilder.cs │ │ └── RopeBuilder.cs.meta │ ├── MeshProcessing.meta │ ├── MeshProcessing │ │ ├── ExtrusionSegment.cs │ │ ├── ExtrusionSegment.cs.meta │ │ ├── MeshBender.cs │ │ ├── MeshBender.cs.meta │ │ ├── MeshVertex.cs │ │ ├── MeshVertex.cs.meta │ │ ├── SourceMesh.cs │ │ ├── SourceMesh.cs.meta │ │ ├── SplineExtrusion.cs │ │ ├── SplineExtrusion.cs.meta │ │ ├── SplineMeshTiling.cs │ │ └── SplineMeshTiling.cs.meta │ ├── Utils.meta │ └── Utils │ │ ├── CameraUtility.cs │ │ ├── CameraUtility.cs.meta │ │ ├── MeshUtility.cs │ │ ├── MeshUtility.cs.meta │ │ ├── UOUtility.cs │ │ └── UOUtility.cs.meta │ ├── Showcase.unity │ └── Showcase.unity.meta ├── LICENSE ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset ├── README.md └── UserSettings └── EditorUserSettings.asset /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | [Ll]ogs/ 7 | Assets/AssetStoreTools* 8 | 9 | # Visual Studio cache directory 10 | .vs/ 11 | 12 | # Gradle cache directory 13 | .gradle/ 14 | 15 | # Autogenerated VS/MD/Consulo solution and project files 16 | ExportedObj/ 17 | .consulo/ 18 | *.csproj 19 | *.unityproj 20 | *.sln 21 | *.suo 22 | *.tmp 23 | *.user 24 | *.userprefs 25 | *.pidb 26 | *.booproj 27 | *.svd 28 | *.pdb 29 | *.opendb 30 | *.VC.db 31 | 32 | # Unity3D generated meta files 33 | *.pidb.meta 34 | *.pdb.meta 35 | 36 | # Unity3D generated file on crash reports 37 | sysinfo.txt 38 | 39 | # Builds 40 | *.apk 41 | *.unitypackage 42 | 43 | # Crashlytics generated file 44 | Assets/StreamingAssets/crashlytics-build.properties -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Assets/SplineMesh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06ca8065bd8131545aa4e473e120e736 3 | folderAsset: yes 4 | timeCreated: 1509721232 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15cbdaa4080c19348aca7a7c80cc6d91 3 | folderAsset: yes 4 | timeCreated: 1510260367 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba3cef361f8301a4bad3494d6cee638f 3 | folderAsset: yes 4 | timeCreated: 1510348333 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/Default.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Default 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0.49264705, g: 0.49264705, b: 0.49264705, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} 77 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/Default.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2ded7645929e1746befa52ddd920fbb 3 | timeCreated: 1509722081 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/No Name.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: No Name 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 1, b: 1, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} 77 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/No Name.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 684e38a396e0e4a47b7d8888e140e426 3 | timeCreated: 1510348333 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/OrangeUVTester.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: OrangeUVTester 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: 2800000, guid: e6e69756fd0bdd44ea9cddc8fee63f5f, type: 3} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 0.553, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/OrangeUVTester.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 863715256888b184fb566639a2b188cc 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/ShinyOrange.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: ShinyOrange 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.585 64 | - _GlossyReflections: 1 65 | - _Metallic: 0.359 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 0.553, b: 0, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/ShinyOrange.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c83e7f8994f9e3b42b86fa3691fc742b 3 | timeCreated: 1509723365 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/WetBlack.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: WetBlack 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 0.825 63 | - _Glossiness: 0.821 64 | - _GlossyReflections: 1 65 | - _Metallic: 0.464 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 1 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0, g: 0, b: 0, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Materials/WetBlack.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8c8701b896a8184e8974775b53a7fd7 3 | timeCreated: 1509723525 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 2100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Mesh.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7edb1e0bf243bd448a3052de6c2ae6e 3 | folderAsset: yes 4 | timeCreated: 1510363809 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Mesh/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af5abe62ba87f494c9dc4af3ba7b53af 3 | folderAsset: yes 4 | timeCreated: 1560898012 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Mesh/Materials/texture.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: texture 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_CustomRenderQueue: -1 15 | stringTagMap: {} 16 | disabledShaderPasses: [] 17 | m_SavedProperties: 18 | serializedVersion: 3 19 | m_TexEnvs: 20 | - _BumpMap: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - _DetailAlbedoMap: 25 | m_Texture: {fileID: 0} 26 | m_Scale: {x: 1, y: 1} 27 | m_Offset: {x: 0, y: 0} 28 | - _DetailMask: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | - _DetailNormalMap: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - _EmissionMap: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | - _MainTex: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _MetallicGlossMap: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _OcclusionMap: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _ParallaxMap: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | m_Floats: 57 | - _BumpScale: 1 58 | - _Cutoff: 0.5 59 | - _DetailNormalMapScale: 1 60 | - _DstBlend: 0 61 | - _GlossMapScale: 1 62 | - _Glossiness: 0.5 63 | - _GlossyReflections: 1 64 | - _Metallic: 0 65 | - _Mode: 0 66 | - _OcclusionStrength: 1 67 | - _Parallax: 0.02 68 | - _SmoothnessTextureChannel: 0 69 | - _SpecularHighlights: 1 70 | - _SrcBlend: 1 71 | - _UVSec: 0 72 | - _ZWrite: 1 73 | m_Colors: 74 | - _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} 75 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 76 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Mesh/Materials/texture.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58433726f5cc13f4dbfb52944dbbcc11 3 | timeCreated: 1560898012 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Mesh/Railling.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/methusalah/SplineMesh/57dcbc681587737b7169f5212220dc8b1e08204e/Assets/SplineMesh/DemoAssets/Mesh/Railling.fbx -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Mesh/Railling.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75a08385e127b9944b8a9e21320e8b88 3 | ModelImporter: 4 | serializedVersion: 23 5 | fileIDToRecycleName: 6 | 100000: Cube 7 | 100002: Cube.001 8 | 100004: Cube.002 9 | 100006: Cube.003 10 | 100008: Cylinder 11 | 100010: //RootNode 12 | 400000: Cube 13 | 400002: Cube.001 14 | 400004: Cube.002 15 | 400006: Cube.003 16 | 400008: Cylinder 17 | 400010: //RootNode 18 | 2300000: Cube 19 | 2300002: Cube.001 20 | 2300004: Cube.002 21 | 2300006: Cube.003 22 | 2300008: Cylinder 23 | 2300010: //RootNode 24 | 3300000: Cube 25 | 3300002: Cube.001 26 | 3300004: Cube.002 27 | 3300006: Cube.003 28 | 3300008: Cylinder 29 | 3300010: //RootNode 30 | 4300000: Cube 31 | 4300002: Cylinder 32 | 4300004: Cube.001 33 | 4300006: Cube.002 34 | 4300008: Cube.003 35 | externalObjects: 36 | - first: 37 | type: UnityEngine:Material 38 | assembly: UnityEngine.CoreModule 39 | name: No Name 40 | second: {fileID: 2100000, guid: 684e38a396e0e4a47b7d8888e140e426, type: 2} 41 | materials: 42 | importMaterials: 1 43 | materialName: 0 44 | materialSearch: 1 45 | materialLocation: 0 46 | animations: 47 | legacyGenerateAnimations: 4 48 | bakeSimulation: 0 49 | resampleCurves: 1 50 | optimizeGameObjects: 0 51 | motionNodeName: 52 | rigImportErrors: 53 | rigImportWarnings: 54 | animationImportErrors: 55 | animationImportWarnings: 56 | animationRetargetingWarnings: 57 | animationDoRetargetingWarnings: 0 58 | importAnimatedCustomProperties: 0 59 | importConstraints: 0 60 | animationCompression: 1 61 | animationRotationError: 0.5 62 | animationPositionError: 0.5 63 | animationScaleError: 0.5 64 | animationWrapMode: 0 65 | extraExposedTransformPaths: [] 66 | extraUserProperties: [] 67 | clipAnimations: [] 68 | isReadable: 1 69 | meshes: 70 | lODScreenPercentages: [] 71 | globalScale: 7 72 | meshCompression: 0 73 | addColliders: 0 74 | useSRGBMaterialColor: 1 75 | importVisibility: 1 76 | importBlendShapes: 1 77 | importCameras: 1 78 | importLights: 1 79 | swapUVChannels: 0 80 | generateSecondaryUV: 0 81 | useFileUnits: 1 82 | optimizeMeshForGPU: 1 83 | keepQuads: 0 84 | weldVertices: 1 85 | preserveHierarchy: 0 86 | indexFormat: 0 87 | secondaryUVAngleDistortion: 8 88 | secondaryUVAreaDistortion: 15.000001 89 | secondaryUVHardAngle: 88 90 | secondaryUVPackMargin: 4 91 | useFileScale: 1 92 | previousCalculatedGlobalScale: 1 93 | hasPreviousCalculatedGlobalScale: 0 94 | tangentSpace: 95 | normalSmoothAngle: 60 96 | normalImportMode: 0 97 | tangentImportMode: 3 98 | normalCalculationMode: 4 99 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 100 | blendShapeNormalImportMode: 1 101 | normalSmoothingSource: 0 102 | importAnimation: 1 103 | copyAvatar: 0 104 | humanDescription: 105 | serializedVersion: 2 106 | human: [] 107 | skeleton: [] 108 | armTwist: 0.5 109 | foreArmTwist: 0.5 110 | upperLegTwist: 0.5 111 | legTwist: 0.5 112 | armStretch: 0.05 113 | legStretch: 0.05 114 | feetSpacing: 0 115 | rootMotionBoneName: 116 | hasTranslationDoF: 0 117 | hasExtraRoot: 0 118 | skeletonHasParents: 1 119 | lastHumanDescriptionAvatarSource: {instanceID: 0} 120 | animationType: 0 121 | humanoidOversampling: 1 122 | additionalBone: 0 123 | userData: 124 | assetBundleName: 125 | assetBundleVariant: 126 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Mesh/cylinder.dae.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 500594a39d643774c8e028335ee33da7 3 | ModelImporter: 4 | serializedVersion: 23 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2100000: Material 9 | 2300000: //RootNode 10 | 3300000: //RootNode 11 | 4300000: Cylinder 12 | externalObjects: {} 13 | materials: 14 | importMaterials: 1 15 | materialName: 0 16 | materialSearch: 1 17 | materialLocation: 1 18 | animations: 19 | legacyGenerateAnimations: 4 20 | bakeSimulation: 0 21 | resampleCurves: 1 22 | optimizeGameObjects: 0 23 | motionNodeName: 24 | rigImportErrors: 25 | rigImportWarnings: 26 | animationImportErrors: 27 | animationImportWarnings: 28 | animationRetargetingWarnings: 29 | animationDoRetargetingWarnings: 0 30 | importAnimatedCustomProperties: 0 31 | importConstraints: 0 32 | animationCompression: 1 33 | animationRotationError: 0.5 34 | animationPositionError: 0.5 35 | animationScaleError: 0.5 36 | animationWrapMode: 0 37 | extraExposedTransformPaths: [] 38 | extraUserProperties: [] 39 | clipAnimations: [] 40 | isReadable: 1 41 | meshes: 42 | lODScreenPercentages: [] 43 | globalScale: 1 44 | meshCompression: 0 45 | addColliders: 0 46 | useSRGBMaterialColor: 1 47 | importVisibility: 1 48 | importBlendShapes: 1 49 | importCameras: 1 50 | importLights: 1 51 | swapUVChannels: 0 52 | generateSecondaryUV: 0 53 | useFileUnits: 1 54 | optimizeMeshForGPU: 1 55 | keepQuads: 0 56 | weldVertices: 1 57 | preserveHierarchy: 0 58 | indexFormat: 0 59 | secondaryUVAngleDistortion: 8 60 | secondaryUVAreaDistortion: 15.000001 61 | secondaryUVHardAngle: 88 62 | secondaryUVPackMargin: 4 63 | useFileScale: 1 64 | previousCalculatedGlobalScale: 1 65 | hasPreviousCalculatedGlobalScale: 0 66 | tangentSpace: 67 | normalSmoothAngle: 60 68 | normalImportMode: 0 69 | tangentImportMode: 3 70 | normalCalculationMode: 4 71 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 72 | blendShapeNormalImportMode: 1 73 | normalSmoothingSource: 0 74 | importAnimation: 1 75 | copyAvatar: 0 76 | humanDescription: 77 | serializedVersion: 2 78 | human: [] 79 | skeleton: [] 80 | armTwist: 0.5 81 | foreArmTwist: 0.5 82 | upperLegTwist: 0.5 83 | legTwist: 0.5 84 | armStretch: 0.05 85 | legStretch: 0.05 86 | feetSpacing: 0 87 | rootMotionBoneName: 88 | hasTranslationDoF: 0 89 | hasExtraRoot: 0 90 | skeletonHasParents: 1 91 | lastHumanDescriptionAvatarSource: {instanceID: 0} 92 | animationType: 0 93 | humanoidOversampling: 1 94 | additionalBone: 0 95 | userData: 96 | assetBundleName: 97 | assetBundleVariant: 98 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d65fb88dea2b1bd4592b7f19a805c297 3 | folderAsset: yes 4 | timeCreated: 1510363791 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Prefabs/Capsule.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1931018082507708} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1931018082507708 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4458908226439456} 22 | - component: {fileID: 33516427735585386} 23 | - component: {fileID: 136291507112975320} 24 | - component: {fileID: 23060724205841012} 25 | m_Layer: 0 26 | m_Name: Capsule 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4458908226439456 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1931018082507708} 38 | m_LocalRotation: {x: 0.01968984, y: 0.97052467, z: -0.08507238, w: 0.22462606} 39 | m_LocalPosition: {x: -1.6090968, y: 2.832341, z: -1.7380074} 40 | m_LocalScale: {x: 1, y: 1, z: 1} 41 | m_Children: [] 42 | m_Father: {fileID: 0} 43 | m_RootOrder: 0 44 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 45 | --- !u!23 &23060724205841012 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1931018082507708} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 1 54 | m_DynamicOccludee: 1 55 | m_MotionVectors: 1 56 | m_LightProbeUsage: 1 57 | m_ReflectionProbeUsage: 1 58 | m_Materials: 59 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 60 | m_StaticBatchInfo: 61 | firstSubMesh: 0 62 | subMeshCount: 0 63 | m_StaticBatchRoot: {fileID: 0} 64 | m_ProbeAnchor: {fileID: 0} 65 | m_LightProbeVolumeOverride: {fileID: 0} 66 | m_ScaleInLightmap: 1 67 | m_PreserveUVs: 1 68 | m_IgnoreNormalsForChartDetection: 0 69 | m_ImportantGI: 0 70 | m_StitchLightmapSeams: 0 71 | m_SelectedEditorRenderState: 3 72 | m_MinimumChartSize: 4 73 | m_AutoUVMaxDistance: 0.5 74 | m_AutoUVMaxAngle: 89 75 | m_LightmapParameters: {fileID: 0} 76 | m_SortingLayerID: 0 77 | m_SortingLayer: 0 78 | m_SortingOrder: 0 79 | --- !u!33 &33516427735585386 80 | MeshFilter: 81 | m_ObjectHideFlags: 1 82 | m_PrefabParentObject: {fileID: 0} 83 | m_PrefabInternal: {fileID: 100100000} 84 | m_GameObject: {fileID: 1931018082507708} 85 | m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} 86 | --- !u!136 &136291507112975320 87 | CapsuleCollider: 88 | m_ObjectHideFlags: 1 89 | m_PrefabParentObject: {fileID: 0} 90 | m_PrefabInternal: {fileID: 100100000} 91 | m_GameObject: {fileID: 1931018082507708} 92 | m_Material: {fileID: 0} 93 | m_IsTrigger: 0 94 | m_Enabled: 1 95 | m_Radius: 0.5 96 | m_Height: 2 97 | m_Direction: 1 98 | m_Center: {x: 0, y: 0, z: 0} 99 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Prefabs/Capsule.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65290c8a0968be743bf5b4c95114c272 3 | timeCreated: 1510362044 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Prefabs/Light.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1890715865256678} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1141178226277192 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4343756074143138} 22 | - component: {fileID: 33571856358038660} 23 | - component: {fileID: 65119900626703250} 24 | - component: {fileID: 23804721389039506} 25 | m_Layer: 0 26 | m_Name: Mast 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!1 &1427047824603392 33 | GameObject: 34 | m_ObjectHideFlags: 0 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | serializedVersion: 5 38 | m_Component: 39 | - component: {fileID: 4557562910809332} 40 | - component: {fileID: 33831790762095504} 41 | - component: {fileID: 136466781343580510} 42 | - component: {fileID: 23777180231881972} 43 | m_Layer: 0 44 | m_Name: Cylinder 45 | m_TagString: Untagged 46 | m_Icon: {fileID: 0} 47 | m_NavMeshLayer: 0 48 | m_StaticEditorFlags: 0 49 | m_IsActive: 1 50 | --- !u!1 &1553677931642502 51 | GameObject: 52 | m_ObjectHideFlags: 0 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 100100000} 55 | serializedVersion: 5 56 | m_Component: 57 | - component: {fileID: 4325113855895828} 58 | - component: {fileID: 33494505299645798} 59 | - component: {fileID: 65688598685876450} 60 | - component: {fileID: 23682088952583648} 61 | m_Layer: 0 62 | m_Name: Light 63 | m_TagString: Untagged 64 | m_Icon: {fileID: 0} 65 | m_NavMeshLayer: 0 66 | m_StaticEditorFlags: 0 67 | m_IsActive: 1 68 | --- !u!1 &1890715865256678 69 | GameObject: 70 | m_ObjectHideFlags: 0 71 | m_PrefabParentObject: {fileID: 0} 72 | m_PrefabInternal: {fileID: 100100000} 73 | serializedVersion: 5 74 | m_Component: 75 | - component: {fileID: 4245244582721904} 76 | m_Layer: 0 77 | m_Name: Light 78 | m_TagString: Untagged 79 | m_Icon: {fileID: 0} 80 | m_NavMeshLayer: 0 81 | m_StaticEditorFlags: 0 82 | m_IsActive: 1 83 | --- !u!4 &4245244582721904 84 | Transform: 85 | m_ObjectHideFlags: 1 86 | m_PrefabParentObject: {fileID: 0} 87 | m_PrefabInternal: {fileID: 100100000} 88 | m_GameObject: {fileID: 1890715865256678} 89 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 90 | m_LocalPosition: {x: 0, y: 0, z: 0} 91 | m_LocalScale: {x: 1, y: 1, z: 1} 92 | m_Children: 93 | - {fileID: 4343756074143138} 94 | - {fileID: 4325113855895828} 95 | - {fileID: 4557562910809332} 96 | m_Father: {fileID: 0} 97 | m_RootOrder: 0 98 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 99 | --- !u!4 &4325113855895828 100 | Transform: 101 | m_ObjectHideFlags: 1 102 | m_PrefabParentObject: {fileID: 0} 103 | m_PrefabInternal: {fileID: 100100000} 104 | m_GameObject: {fileID: 1553677931642502} 105 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 106 | m_LocalPosition: {x: 0, y: 5.042, z: 0.2} 107 | m_LocalScale: {x: 0.5, y: 0.1, z: 0.8} 108 | m_Children: [] 109 | m_Father: {fileID: 4245244582721904} 110 | m_RootOrder: 1 111 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 112 | --- !u!4 &4343756074143138 113 | Transform: 114 | m_ObjectHideFlags: 1 115 | m_PrefabParentObject: {fileID: 0} 116 | m_PrefabInternal: {fileID: 100100000} 117 | m_GameObject: {fileID: 1141178226277192} 118 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 119 | m_LocalPosition: {x: 0, y: 2.592, z: 0} 120 | m_LocalScale: {x: 0.1, y: 5, z: 0.1} 121 | m_Children: [] 122 | m_Father: {fileID: 4245244582721904} 123 | m_RootOrder: 0 124 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 125 | --- !u!4 &4557562910809332 126 | Transform: 127 | m_ObjectHideFlags: 1 128 | m_PrefabParentObject: {fileID: 0} 129 | m_PrefabInternal: {fileID: 100100000} 130 | m_GameObject: {fileID: 1427047824603392} 131 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 132 | m_LocalPosition: {x: 0, y: 0.052000046, z: 0} 133 | m_LocalScale: {x: 0.3, y: 0.1, z: 0.3} 134 | m_Children: [] 135 | m_Father: {fileID: 4245244582721904} 136 | m_RootOrder: 2 137 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 138 | --- !u!23 &23682088952583648 139 | MeshRenderer: 140 | m_ObjectHideFlags: 1 141 | m_PrefabParentObject: {fileID: 0} 142 | m_PrefabInternal: {fileID: 100100000} 143 | m_GameObject: {fileID: 1553677931642502} 144 | m_Enabled: 1 145 | m_CastShadows: 1 146 | m_ReceiveShadows: 1 147 | m_DynamicOccludee: 1 148 | m_MotionVectors: 1 149 | m_LightProbeUsage: 1 150 | m_ReflectionProbeUsage: 1 151 | m_Materials: 152 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 153 | m_StaticBatchInfo: 154 | firstSubMesh: 0 155 | subMeshCount: 0 156 | m_StaticBatchRoot: {fileID: 0} 157 | m_ProbeAnchor: {fileID: 0} 158 | m_LightProbeVolumeOverride: {fileID: 0} 159 | m_ScaleInLightmap: 1 160 | m_PreserveUVs: 1 161 | m_IgnoreNormalsForChartDetection: 0 162 | m_ImportantGI: 0 163 | m_StitchLightmapSeams: 0 164 | m_SelectedEditorRenderState: 3 165 | m_MinimumChartSize: 4 166 | m_AutoUVMaxDistance: 0.5 167 | m_AutoUVMaxAngle: 89 168 | m_LightmapParameters: {fileID: 0} 169 | m_SortingLayerID: 0 170 | m_SortingLayer: 0 171 | m_SortingOrder: 0 172 | --- !u!23 &23777180231881972 173 | MeshRenderer: 174 | m_ObjectHideFlags: 1 175 | m_PrefabParentObject: {fileID: 0} 176 | m_PrefabInternal: {fileID: 100100000} 177 | m_GameObject: {fileID: 1427047824603392} 178 | m_Enabled: 1 179 | m_CastShadows: 1 180 | m_ReceiveShadows: 1 181 | m_DynamicOccludee: 1 182 | m_MotionVectors: 1 183 | m_LightProbeUsage: 1 184 | m_ReflectionProbeUsage: 1 185 | m_Materials: 186 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 187 | m_StaticBatchInfo: 188 | firstSubMesh: 0 189 | subMeshCount: 0 190 | m_StaticBatchRoot: {fileID: 0} 191 | m_ProbeAnchor: {fileID: 0} 192 | m_LightProbeVolumeOverride: {fileID: 0} 193 | m_ScaleInLightmap: 1 194 | m_PreserveUVs: 1 195 | m_IgnoreNormalsForChartDetection: 0 196 | m_ImportantGI: 0 197 | m_StitchLightmapSeams: 0 198 | m_SelectedEditorRenderState: 3 199 | m_MinimumChartSize: 4 200 | m_AutoUVMaxDistance: 0.5 201 | m_AutoUVMaxAngle: 89 202 | m_LightmapParameters: {fileID: 0} 203 | m_SortingLayerID: 0 204 | m_SortingLayer: 0 205 | m_SortingOrder: 0 206 | --- !u!23 &23804721389039506 207 | MeshRenderer: 208 | m_ObjectHideFlags: 1 209 | m_PrefabParentObject: {fileID: 0} 210 | m_PrefabInternal: {fileID: 100100000} 211 | m_GameObject: {fileID: 1141178226277192} 212 | m_Enabled: 1 213 | m_CastShadows: 1 214 | m_ReceiveShadows: 1 215 | m_DynamicOccludee: 1 216 | m_MotionVectors: 1 217 | m_LightProbeUsage: 1 218 | m_ReflectionProbeUsage: 1 219 | m_Materials: 220 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 221 | m_StaticBatchInfo: 222 | firstSubMesh: 0 223 | subMeshCount: 0 224 | m_StaticBatchRoot: {fileID: 0} 225 | m_ProbeAnchor: {fileID: 0} 226 | m_LightProbeVolumeOverride: {fileID: 0} 227 | m_ScaleInLightmap: 1 228 | m_PreserveUVs: 1 229 | m_IgnoreNormalsForChartDetection: 0 230 | m_ImportantGI: 0 231 | m_StitchLightmapSeams: 0 232 | m_SelectedEditorRenderState: 3 233 | m_MinimumChartSize: 4 234 | m_AutoUVMaxDistance: 0.5 235 | m_AutoUVMaxAngle: 89 236 | m_LightmapParameters: {fileID: 0} 237 | m_SortingLayerID: 0 238 | m_SortingLayer: 0 239 | m_SortingOrder: 0 240 | --- !u!33 &33494505299645798 241 | MeshFilter: 242 | m_ObjectHideFlags: 1 243 | m_PrefabParentObject: {fileID: 0} 244 | m_PrefabInternal: {fileID: 100100000} 245 | m_GameObject: {fileID: 1553677931642502} 246 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 247 | --- !u!33 &33571856358038660 248 | MeshFilter: 249 | m_ObjectHideFlags: 1 250 | m_PrefabParentObject: {fileID: 0} 251 | m_PrefabInternal: {fileID: 100100000} 252 | m_GameObject: {fileID: 1141178226277192} 253 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 254 | --- !u!33 &33831790762095504 255 | MeshFilter: 256 | m_ObjectHideFlags: 1 257 | m_PrefabParentObject: {fileID: 0} 258 | m_PrefabInternal: {fileID: 100100000} 259 | m_GameObject: {fileID: 1427047824603392} 260 | m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} 261 | --- !u!65 &65119900626703250 262 | BoxCollider: 263 | m_ObjectHideFlags: 1 264 | m_PrefabParentObject: {fileID: 0} 265 | m_PrefabInternal: {fileID: 100100000} 266 | m_GameObject: {fileID: 1141178226277192} 267 | m_Material: {fileID: 0} 268 | m_IsTrigger: 0 269 | m_Enabled: 1 270 | serializedVersion: 2 271 | m_Size: {x: 1, y: 1, z: 1} 272 | m_Center: {x: 0, y: 0, z: 0} 273 | --- !u!65 &65688598685876450 274 | BoxCollider: 275 | m_ObjectHideFlags: 1 276 | m_PrefabParentObject: {fileID: 0} 277 | m_PrefabInternal: {fileID: 100100000} 278 | m_GameObject: {fileID: 1553677931642502} 279 | m_Material: {fileID: 0} 280 | m_IsTrigger: 0 281 | m_Enabled: 1 282 | serializedVersion: 2 283 | m_Size: {x: 1, y: 1, z: 1} 284 | m_Center: {x: 0, y: 0, z: 0} 285 | --- !u!136 &136466781343580510 286 | CapsuleCollider: 287 | m_ObjectHideFlags: 1 288 | m_PrefabParentObject: {fileID: 0} 289 | m_PrefabInternal: {fileID: 100100000} 290 | m_GameObject: {fileID: 1427047824603392} 291 | m_Material: {fileID: 0} 292 | m_IsTrigger: 0 293 | m_Enabled: 1 294 | m_Radius: 0.5 295 | m_Height: 2 296 | m_Direction: 1 297 | m_Center: {x: 0, y: 0, z: 0} 298 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Prefabs/Light.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9494ee67b305f9e4da72aea2e0ca82dc 3 | timeCreated: 1510362451 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Prefabs/Pillar.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1236638159122592} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1236638159122592 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4818684697181370} 22 | m_Layer: 0 23 | m_Name: Pillar 24 | m_TagString: Untagged 25 | m_Icon: {fileID: 0} 26 | m_NavMeshLayer: 0 27 | m_StaticEditorFlags: 0 28 | m_IsActive: 1 29 | --- !u!1 &1286725899754654 30 | GameObject: 31 | m_ObjectHideFlags: 0 32 | m_PrefabParentObject: {fileID: 0} 33 | m_PrefabInternal: {fileID: 100100000} 34 | serializedVersion: 5 35 | m_Component: 36 | - component: {fileID: 4807892938776340} 37 | - component: {fileID: 33672166587295930} 38 | - component: {fileID: 65029525993210366} 39 | - component: {fileID: 23777951887819734} 40 | m_Layer: 0 41 | m_Name: Pillar 42 | m_TagString: Untagged 43 | m_Icon: {fileID: 0} 44 | m_NavMeshLayer: 0 45 | m_StaticEditorFlags: 0 46 | m_IsActive: 1 47 | --- !u!1 &1405234155070426 48 | GameObject: 49 | m_ObjectHideFlags: 0 50 | m_PrefabParentObject: {fileID: 0} 51 | m_PrefabInternal: {fileID: 100100000} 52 | serializedVersion: 5 53 | m_Component: 54 | - component: {fileID: 4741625941092368} 55 | - component: {fileID: 33610016657153958} 56 | - component: {fileID: 65798763130490374} 57 | - component: {fileID: 23245165567445536} 58 | m_Layer: 0 59 | m_Name: Cube 60 | m_TagString: Untagged 61 | m_Icon: {fileID: 0} 62 | m_NavMeshLayer: 0 63 | m_StaticEditorFlags: 0 64 | m_IsActive: 1 65 | --- !u!4 &4741625941092368 66 | Transform: 67 | m_ObjectHideFlags: 1 68 | m_PrefabParentObject: {fileID: 0} 69 | m_PrefabInternal: {fileID: 100100000} 70 | m_GameObject: {fileID: 1405234155070426} 71 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 72 | m_LocalPosition: {x: 0, y: -1.0500002, z: 0} 73 | m_LocalScale: {x: 1.5, y: 1, z: 1.5} 74 | m_Children: [] 75 | m_Father: {fileID: 4818684697181370} 76 | m_RootOrder: 1 77 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 78 | --- !u!4 &4807892938776340 79 | Transform: 80 | m_ObjectHideFlags: 1 81 | m_PrefabParentObject: {fileID: 0} 82 | m_PrefabInternal: {fileID: 100100000} 83 | m_GameObject: {fileID: 1286725899754654} 84 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 85 | m_LocalPosition: {x: 0, y: -2.65, z: 0} 86 | m_LocalScale: {x: 1, y: 3, z: 1} 87 | m_Children: [] 88 | m_Father: {fileID: 4818684697181370} 89 | m_RootOrder: 0 90 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 91 | --- !u!4 &4818684697181370 92 | Transform: 93 | m_ObjectHideFlags: 1 94 | m_PrefabParentObject: {fileID: 0} 95 | m_PrefabInternal: {fileID: 100100000} 96 | m_GameObject: {fileID: 1236638159122592} 97 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 98 | m_LocalPosition: {x: -40.195618, y: 6.2504883, z: -1.4442568} 99 | m_LocalScale: {x: 1, y: 1, z: 1} 100 | m_Children: 101 | - {fileID: 4807892938776340} 102 | - {fileID: 4741625941092368} 103 | m_Father: {fileID: 0} 104 | m_RootOrder: 0 105 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 106 | --- !u!23 &23245165567445536 107 | MeshRenderer: 108 | m_ObjectHideFlags: 1 109 | m_PrefabParentObject: {fileID: 0} 110 | m_PrefabInternal: {fileID: 100100000} 111 | m_GameObject: {fileID: 1405234155070426} 112 | m_Enabled: 1 113 | m_CastShadows: 1 114 | m_ReceiveShadows: 1 115 | m_DynamicOccludee: 1 116 | m_MotionVectors: 1 117 | m_LightProbeUsage: 1 118 | m_ReflectionProbeUsage: 1 119 | m_Materials: 120 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 121 | m_StaticBatchInfo: 122 | firstSubMesh: 0 123 | subMeshCount: 0 124 | m_StaticBatchRoot: {fileID: 0} 125 | m_ProbeAnchor: {fileID: 0} 126 | m_LightProbeVolumeOverride: {fileID: 0} 127 | m_ScaleInLightmap: 1 128 | m_PreserveUVs: 1 129 | m_IgnoreNormalsForChartDetection: 0 130 | m_ImportantGI: 0 131 | m_StitchLightmapSeams: 0 132 | m_SelectedEditorRenderState: 3 133 | m_MinimumChartSize: 4 134 | m_AutoUVMaxDistance: 0.5 135 | m_AutoUVMaxAngle: 89 136 | m_LightmapParameters: {fileID: 0} 137 | m_SortingLayerID: 0 138 | m_SortingLayer: 0 139 | m_SortingOrder: 0 140 | --- !u!23 &23777951887819734 141 | MeshRenderer: 142 | m_ObjectHideFlags: 1 143 | m_PrefabParentObject: {fileID: 0} 144 | m_PrefabInternal: {fileID: 100100000} 145 | m_GameObject: {fileID: 1286725899754654} 146 | m_Enabled: 1 147 | m_CastShadows: 1 148 | m_ReceiveShadows: 1 149 | m_DynamicOccludee: 1 150 | m_MotionVectors: 1 151 | m_LightProbeUsage: 1 152 | m_ReflectionProbeUsage: 1 153 | m_Materials: 154 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 155 | m_StaticBatchInfo: 156 | firstSubMesh: 0 157 | subMeshCount: 0 158 | m_StaticBatchRoot: {fileID: 0} 159 | m_ProbeAnchor: {fileID: 0} 160 | m_LightProbeVolumeOverride: {fileID: 0} 161 | m_ScaleInLightmap: 1 162 | m_PreserveUVs: 1 163 | m_IgnoreNormalsForChartDetection: 0 164 | m_ImportantGI: 0 165 | m_StitchLightmapSeams: 0 166 | m_SelectedEditorRenderState: 3 167 | m_MinimumChartSize: 4 168 | m_AutoUVMaxDistance: 0.5 169 | m_AutoUVMaxAngle: 89 170 | m_LightmapParameters: {fileID: 0} 171 | m_SortingLayerID: 0 172 | m_SortingLayer: 0 173 | m_SortingOrder: 0 174 | --- !u!33 &33610016657153958 175 | MeshFilter: 176 | m_ObjectHideFlags: 1 177 | m_PrefabParentObject: {fileID: 0} 178 | m_PrefabInternal: {fileID: 100100000} 179 | m_GameObject: {fileID: 1405234155070426} 180 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 181 | --- !u!33 &33672166587295930 182 | MeshFilter: 183 | m_ObjectHideFlags: 1 184 | m_PrefabParentObject: {fileID: 0} 185 | m_PrefabInternal: {fileID: 100100000} 186 | m_GameObject: {fileID: 1286725899754654} 187 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 188 | --- !u!65 &65029525993210366 189 | BoxCollider: 190 | m_ObjectHideFlags: 1 191 | m_PrefabParentObject: {fileID: 0} 192 | m_PrefabInternal: {fileID: 100100000} 193 | m_GameObject: {fileID: 1286725899754654} 194 | m_Material: {fileID: 0} 195 | m_IsTrigger: 0 196 | m_Enabled: 1 197 | serializedVersion: 2 198 | m_Size: {x: 1, y: 1, z: 1} 199 | m_Center: {x: 0, y: 0, z: 0} 200 | --- !u!65 &65798763130490374 201 | BoxCollider: 202 | m_ObjectHideFlags: 1 203 | m_PrefabParentObject: {fileID: 0} 204 | m_PrefabInternal: {fileID: 100100000} 205 | m_GameObject: {fileID: 1405234155070426} 206 | m_Material: {fileID: 0} 207 | m_IsTrigger: 0 208 | m_Enabled: 1 209 | serializedVersion: 2 210 | m_Size: {x: 1, y: 1, z: 1} 211 | m_Center: {x: 0, y: 0, z: 0} 212 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Prefabs/Pillar.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 767f61632ccbf8c46acb9fc29f0f79e3 3 | timeCreated: 1510363784 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Prefabs/RopeSegment.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &2384629214509581837 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 3579545044260536533} 12 | - component: {fileID: 5663163953821679286} 13 | - component: {fileID: 8331809284910997716} 14 | m_Layer: 0 15 | m_Name: RopeSegment 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &3579545044260536533 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 2384629214509581837} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: 32 | - {fileID: 5853270040821090724} 33 | m_Father: {fileID: 0} 34 | m_RootOrder: 0 35 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 36 | --- !u!54 &5663163953821679286 37 | Rigidbody: 38 | m_ObjectHideFlags: 0 39 | m_CorrespondingSourceObject: {fileID: 0} 40 | m_PrefabInstance: {fileID: 0} 41 | m_PrefabAsset: {fileID: 0} 42 | m_GameObject: {fileID: 2384629214509581837} 43 | serializedVersion: 2 44 | m_Mass: 0.1 45 | m_Drag: 0.1 46 | m_AngularDrag: 0.05 47 | m_UseGravity: 1 48 | m_IsKinematic: 0 49 | m_Interpolate: 0 50 | m_Constraints: 0 51 | m_CollisionDetection: 0 52 | --- !u!153 &8331809284910997716 53 | ConfigurableJoint: 54 | m_ObjectHideFlags: 0 55 | m_CorrespondingSourceObject: {fileID: 0} 56 | m_PrefabInstance: {fileID: 0} 57 | m_PrefabAsset: {fileID: 0} 58 | m_GameObject: {fileID: 2384629214509581837} 59 | m_ConnectedBody: {fileID: 0} 60 | m_Anchor: {x: 0, y: 0, z: 0.15} 61 | m_Axis: {x: 1, y: 0, z: 0} 62 | m_AutoConfigureConnectedAnchor: 0 63 | m_ConnectedAnchor: {x: 0, y: 0, z: -0.15} 64 | serializedVersion: 2 65 | m_SecondaryAxis: {x: 0, y: 1, z: 0} 66 | m_XMotion: 0 67 | m_YMotion: 0 68 | m_ZMotion: 0 69 | m_AngularXMotion: 2 70 | m_AngularYMotion: 0 71 | m_AngularZMotion: 2 72 | m_LinearLimitSpring: 73 | spring: 0 74 | damper: 0 75 | m_LinearLimit: 76 | limit: 0 77 | bounciness: 0 78 | contactDistance: 0 79 | m_AngularXLimitSpring: 80 | spring: 0 81 | damper: 0 82 | m_LowAngularXLimit: 83 | limit: 0 84 | bounciness: 0 85 | contactDistance: 0 86 | m_HighAngularXLimit: 87 | limit: 0 88 | bounciness: 0 89 | contactDistance: 0 90 | m_AngularYZLimitSpring: 91 | spring: 0 92 | damper: 0 93 | m_AngularYLimit: 94 | limit: 0 95 | bounciness: 0 96 | contactDistance: 0 97 | m_AngularZLimit: 98 | limit: 0 99 | bounciness: 0 100 | contactDistance: 0 101 | m_TargetPosition: {x: 0, y: 0, z: 0} 102 | m_TargetVelocity: {x: 0, y: 0, z: 0} 103 | m_XDrive: 104 | serializedVersion: 3 105 | positionSpring: 0 106 | positionDamper: 0 107 | maximumForce: 3.4028233e+38 108 | m_YDrive: 109 | serializedVersion: 3 110 | positionSpring: 0 111 | positionDamper: 0 112 | maximumForce: 3.4028233e+38 113 | m_ZDrive: 114 | serializedVersion: 3 115 | positionSpring: 0 116 | positionDamper: 0 117 | maximumForce: 3.4028233e+38 118 | m_TargetRotation: {x: 0, y: 0, z: 0, w: 1} 119 | m_TargetAngularVelocity: {x: 0, y: 0, z: 0} 120 | m_RotationDriveMode: 1 121 | m_AngularXDrive: 122 | serializedVersion: 3 123 | positionSpring: 0 124 | positionDamper: 0 125 | maximumForce: 3.4028233e+38 126 | m_AngularYZDrive: 127 | serializedVersion: 3 128 | positionSpring: 0 129 | positionDamper: 0 130 | maximumForce: 3.4028233e+38 131 | m_SlerpDrive: 132 | serializedVersion: 3 133 | positionSpring: 1 134 | positionDamper: 0.1 135 | maximumForce: 10 136 | m_ProjectionMode: 0 137 | m_ProjectionDistance: 0.1 138 | m_ProjectionAngle: 180 139 | m_ConfiguredInWorldSpace: 0 140 | m_SwapBodies: 0 141 | m_BreakForce: Infinity 142 | m_BreakTorque: Infinity 143 | m_EnableCollision: 0 144 | m_EnablePreprocessing: 1 145 | m_MassScale: 1 146 | m_ConnectedMassScale: 1 147 | --- !u!1 &7620883715327963420 148 | GameObject: 149 | m_ObjectHideFlags: 0 150 | m_CorrespondingSourceObject: {fileID: 0} 151 | m_PrefabInstance: {fileID: 0} 152 | m_PrefabAsset: {fileID: 0} 153 | serializedVersion: 6 154 | m_Component: 155 | - component: {fileID: 5853270040821090724} 156 | m_Layer: 0 157 | m_Name: Model 158 | m_TagString: Untagged 159 | m_Icon: {fileID: 0} 160 | m_NavMeshLayer: 0 161 | m_StaticEditorFlags: 0 162 | m_IsActive: 1 163 | --- !u!4 &5853270040821090724 164 | Transform: 165 | m_ObjectHideFlags: 0 166 | m_CorrespondingSourceObject: {fileID: 0} 167 | m_PrefabInstance: {fileID: 0} 168 | m_PrefabAsset: {fileID: 0} 169 | m_GameObject: {fileID: 7620883715327963420} 170 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 171 | m_LocalPosition: {x: 0, y: 0, z: 0} 172 | m_LocalScale: {x: 1, y: 1, z: 1} 173 | m_Children: 174 | - {fileID: 4583911363457872807} 175 | m_Father: {fileID: 3579545044260536533} 176 | m_RootOrder: 0 177 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 178 | --- !u!1 &7684463108660775010 179 | GameObject: 180 | m_ObjectHideFlags: 0 181 | m_CorrespondingSourceObject: {fileID: 0} 182 | m_PrefabInstance: {fileID: 0} 183 | m_PrefabAsset: {fileID: 0} 184 | serializedVersion: 6 185 | m_Component: 186 | - component: {fileID: 4583911363457872807} 187 | - component: {fileID: 8912667846179679715} 188 | m_Layer: 0 189 | m_Name: Collider 190 | m_TagString: Untagged 191 | m_Icon: {fileID: 0} 192 | m_NavMeshLayer: 0 193 | m_StaticEditorFlags: 0 194 | m_IsActive: 1 195 | --- !u!4 &4583911363457872807 196 | Transform: 197 | m_ObjectHideFlags: 0 198 | m_CorrespondingSourceObject: {fileID: 0} 199 | m_PrefabInstance: {fileID: 0} 200 | m_PrefabAsset: {fileID: 0} 201 | m_GameObject: {fileID: 7684463108660775010} 202 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 203 | m_LocalPosition: {x: 0, y: 0, z: 0} 204 | m_LocalScale: {x: 1, y: 1, z: 1} 205 | m_Children: [] 206 | m_Father: {fileID: 5853270040821090724} 207 | m_RootOrder: 0 208 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 209 | --- !u!136 &8912667846179679715 210 | CapsuleCollider: 211 | m_ObjectHideFlags: 0 212 | m_CorrespondingSourceObject: {fileID: 0} 213 | m_PrefabInstance: {fileID: 0} 214 | m_PrefabAsset: {fileID: 0} 215 | m_GameObject: {fileID: 7684463108660775010} 216 | m_Material: {fileID: 13400000, guid: 60e2dd56d0896b54eaa3c1cecec0199e, type: 2} 217 | m_IsTrigger: 0 218 | m_Enabled: 1 219 | m_Radius: 0.15 220 | m_Height: 0.6 221 | m_Direction: 2 222 | m_Center: {x: 0, y: 0, z: 0} 223 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Prefabs/RopeSegment.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36b9b82bb143831419bf2e7113dad3ac 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Texture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73e181380ad50194c95f19b01d773d42 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Texture/UVTester.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/methusalah/SplineMesh/57dcbc681587737b7169f5212220dc8b1e08204e/Assets/SplineMesh/DemoAssets/Texture/UVTester.png -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Texture/UVTester.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6e69756fd0bdd44ea9cddc8fee63f5f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Texture/normalmap-quad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/methusalah/SplineMesh/57dcbc681587737b7169f5212220dc8b1e08204e/Assets/SplineMesh/DemoAssets/Texture/normalmap-quad.png -------------------------------------------------------------------------------- /Assets/SplineMesh/DemoAssets/Texture/normalmap-quad.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 316adaa83828bc1479b3e4e79de17eee 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 0 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 1 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Doc.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | * SplineMesh documentation * 4 | 5 | // What is it? 6 | A spline is a set of nodes connected by bezier curves. Each node is defined by a position and a direction. 7 | The MeshBender component create a mesh from a source mesh by moving its vertices accordingly to a bezier curve. 8 | 9 | // How to create a spline object? 10 | Menu -> GameObject -> 3D Object -> Spline 11 | - or - 12 | on any object, add the component Spline 13 | 14 | // How to draw a spline? 15 | select an object with Spline component (and make sure the component is opened) 16 | a basic 2-nodes spline is created by default 17 | select a node and move it 18 | when a node is selected, the directions appear. Select one of them and move it 19 | hold alt key and drag a node to duplicate it 20 | use delete button in the inspector to delete selected node (you can't have less than two nodes) 21 | 22 | // How to bend a mesh? 23 | you will probably need a script to create the GameObjects holding curved meshes 24 | every usecase is unique and you will have to create your own script to suit you specific needs 25 | Don't worry, it's easy : explore exemple scripts in the showcase scene to see what you can do and how 26 | 27 | // What else can I do? 28 | anything that is curved, from road to tentacle to footprint track to bat trajectory to... 29 | 30 | 31 | Troubleshooting : 32 | - My bended mesh is not smooth 33 | Your mesh probably lack vertices along the axis to bend : SplineMesh doesn't add vertices to the mesh, it only move existing ones. 34 | Try adding vertices on the mesh along the axis to bend 35 | Try to have more smaller curves on your spline 36 | 37 | - My mesh seems broken 38 | The MeshBender only bend along X axis. Your mesh is probably not oriented this way. You can specify a rotation (see ExemplePipe) 39 | 40 | - Mesh or extrusion generation is slow in the editor 41 | More vertices means less performances. Try to reduce the vertex count. 42 | Very long splines can lead to performance issues too. Try many splines with less nodes. -------------------------------------------------------------------------------- /Assets/SplineMesh/Doc.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f209adc2d95dcf4fb2ccf5d8355a3b9 3 | timeCreated: 1510689994 4 | licenseType: Free 5 | TextScriptImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04ec9797dac1bef44b99fe06014f1988 3 | folderAsset: yes 4 | timeCreated: 1509721232 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c5b179e4fe3ffa43ab663be45758da6 3 | folderAsset: yes 4 | timeCreated: 1499505673 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier/CubicBezierCurve.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.Events; 6 | 7 | namespace SplineMesh { 8 | /// 9 | /// Mathematical object for cubic Bézier curve definition. 10 | /// It is made of two spline nodes which hold the four needed control points : two positions and two directions 11 | /// It provides methods to get positions and tangent along the curve, specifying a distance or a ratio, plus the curve length. 12 | /// 13 | /// Note that a time of 0.5 and half the total distance won't necessarily define the same curve point as the curve curvature is not linear. 14 | /// 15 | [Serializable] 16 | public class CubicBezierCurve { 17 | 18 | private const int STEP_COUNT = 30; 19 | private const float T_STEP = 1.0f / STEP_COUNT; 20 | 21 | private readonly List samples = new List(STEP_COUNT); 22 | 23 | public SplineNode n1, n2; 24 | 25 | /// 26 | /// Length of the curve in world unit. 27 | /// 28 | public float Length { get; private set; } 29 | 30 | /// 31 | /// This event is raised when of of the control points has moved. 32 | /// 33 | public UnityEvent Changed = new UnityEvent(); 34 | 35 | /// 36 | /// Build a new cubic Bézier curve between two given spline node. 37 | /// 38 | /// 39 | /// 40 | public CubicBezierCurve(SplineNode n1, SplineNode n2) { 41 | this.n1 = n1; 42 | this.n2 = n2; 43 | n1.Changed += ComputeSamples; 44 | n2.Changed += ComputeSamples; 45 | ComputeSamples(null, null); 46 | } 47 | 48 | /// 49 | /// Change the start node of the curve. 50 | /// 51 | /// 52 | public void ConnectStart(SplineNode n1) { 53 | this.n1.Changed -= ComputeSamples; 54 | this.n1 = n1; 55 | n1.Changed += ComputeSamples; 56 | ComputeSamples(null, null); 57 | } 58 | 59 | /// 60 | /// Change the end node of the curve. 61 | /// 62 | /// 63 | public void ConnectEnd(SplineNode n2) { 64 | this.n2.Changed -= ComputeSamples; 65 | this.n2 = n2; 66 | n2.Changed += ComputeSamples; 67 | ComputeSamples(null, null); 68 | } 69 | 70 | /// 71 | /// Convinent method to get the third control point of the curve, as the direction of the end spline node indicates the starting tangent of the next curve. 72 | /// 73 | /// 74 | public Vector3 GetInverseDirection() { 75 | return (2 * n2.Position) - n2.Direction; 76 | } 77 | 78 | /// 79 | /// Returns point on curve at given time. Time must be between 0 and 1. 80 | /// 81 | /// 82 | /// 83 | private Vector3 GetLocation(float t) { 84 | float omt = 1f - t; 85 | float omt2 = omt * omt; 86 | float t2 = t * t; 87 | return 88 | n1.Position * (omt2 * omt) + 89 | n1.Direction * (3f * omt2 * t) + 90 | GetInverseDirection() * (3f * omt * t2) + 91 | n2.Position * (t2 * t); 92 | } 93 | 94 | /// 95 | /// Returns tangent of curve at given time. Time must be between 0 and 1. 96 | /// 97 | /// 98 | /// 99 | private Vector3 GetTangent(float t) { 100 | float omt = 1f - t; 101 | float omt2 = omt * omt; 102 | float t2 = t * t; 103 | Vector3 tangent = 104 | n1.Position * (-omt2) + 105 | n1.Direction * (3 * omt2 - 2 * omt) + 106 | GetInverseDirection() * (-3 * t2 + 2 * t) + 107 | n2.Position * (t2); 108 | return tangent.normalized; 109 | } 110 | 111 | private Vector3 GetUp(float t) { 112 | return Vector3.Lerp(n1.Up, n2.Up, t); 113 | } 114 | 115 | private Vector2 GetScale(float t) { 116 | return Vector2.Lerp(n1.Scale, n2.Scale, t); 117 | } 118 | 119 | private float GetRoll(float t) { 120 | return Mathf.Lerp(n1.Roll, n2.Roll, t); 121 | } 122 | 123 | private void ComputeSamples(object sender, EventArgs e) { 124 | samples.Clear(); 125 | Length = 0; 126 | Vector3 previousPosition = GetLocation(0); 127 | for (float t = 0; t < 1; t += T_STEP) { 128 | Vector3 position = GetLocation(t); 129 | Length += Vector3.Distance(previousPosition, position); 130 | previousPosition = position; 131 | samples.Add(CreateSample(Length, t)); 132 | } 133 | Length += Vector3.Distance(previousPosition, GetLocation(1)); 134 | samples.Add(CreateSample(Length, 1)); 135 | 136 | if (Changed != null) Changed.Invoke(); 137 | } 138 | 139 | private CurveSample CreateSample(float distance, float time) { 140 | return new CurveSample( 141 | GetLocation(time), 142 | GetTangent(time), 143 | GetUp(time), 144 | GetScale(time), 145 | GetRoll(time), 146 | distance, 147 | time, 148 | this); 149 | } 150 | 151 | /// 152 | /// Returns an interpolated sample of the curve, containing all curve data at this time. 153 | /// 154 | /// 155 | /// 156 | public CurveSample GetSample(float time) { 157 | AssertTimeInBounds(time); 158 | CurveSample previous = samples[0]; 159 | CurveSample next = default(CurveSample); 160 | bool found = false; 161 | foreach (CurveSample cp in samples) { 162 | if (cp.timeInCurve >= time) { 163 | next = cp; 164 | found = true; 165 | break; 166 | } 167 | previous = cp; 168 | } 169 | if (!found) throw new Exception("Can't find curve samples."); 170 | float t = next == previous ? 0 : (time - previous.timeInCurve) / (next.timeInCurve - previous.timeInCurve); 171 | 172 | return CurveSample.Lerp(previous, next, t); 173 | } 174 | 175 | /// 176 | /// Returns an interpolated sample of the curve, containing all curve data at this distance. 177 | /// 178 | /// 179 | /// 180 | public CurveSample GetSampleAtDistance(float d) { 181 | if (d < 0 || d > Length) 182 | throw new ArgumentException("Distance must be positive and less than curve length. Length = " + Length + ", given distance was " + d); 183 | 184 | CurveSample previous = samples[0]; 185 | CurveSample next = default(CurveSample); 186 | bool found = false; 187 | foreach (CurveSample cp in samples) { 188 | if (cp.distanceInCurve >= d) { 189 | next = cp; 190 | found = true; 191 | break; 192 | } 193 | previous = cp; 194 | } 195 | if (!found) throw new Exception("Can't find curve samples."); 196 | float t = next == previous ? 0 : (d - previous.distanceInCurve) / (next.distanceInCurve - previous.distanceInCurve); 197 | 198 | return CurveSample.Lerp(previous, next, t); 199 | } 200 | 201 | private static void AssertTimeInBounds(float time) { 202 | if (time < 0 || time > 1) throw new ArgumentException("Time must be between 0 and 1 (was " + time + ")."); 203 | } 204 | 205 | public CurveSample GetProjectionSample(Vector3 pointToProject) { 206 | float minSqrDistance = float.PositiveInfinity; 207 | int closestIndex = -1; 208 | int i = 0; 209 | foreach (var sample in samples) { 210 | float sqrDistance = (sample.location - pointToProject).sqrMagnitude; 211 | if (sqrDistance < minSqrDistance) { 212 | minSqrDistance = sqrDistance; 213 | closestIndex = i; 214 | } 215 | i++; 216 | } 217 | CurveSample previous, next; 218 | if(closestIndex == 0) { 219 | previous = samples[closestIndex]; 220 | next = samples[closestIndex + 1]; 221 | } else if(closestIndex == samples.Count - 1) { 222 | previous = samples[closestIndex - 1]; 223 | next = samples[closestIndex]; 224 | } else { 225 | var toPreviousSample = (pointToProject - samples[closestIndex - 1].location).sqrMagnitude; 226 | var toNextSample = (pointToProject - samples[closestIndex + 1].location).sqrMagnitude; 227 | if (toPreviousSample < toNextSample) { 228 | previous = samples[closestIndex - 1]; 229 | next = samples[closestIndex]; 230 | } else { 231 | previous = samples[closestIndex]; 232 | next = samples[closestIndex + 1]; 233 | } 234 | } 235 | 236 | var onCurve = Vector3.Project(pointToProject - previous.location, next.location - previous.location) + previous.location; 237 | var rate = (onCurve - previous.location).sqrMagnitude / (next.location - previous.location).sqrMagnitude; 238 | rate = Mathf.Clamp(rate, 0, 1); 239 | var result = CurveSample.Lerp(previous, next, rate); 240 | return result; 241 | } 242 | } 243 | } 244 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier/CubicBezierCurve.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72d7c273c1cdb4447ac76f4f8eaa0ba1 3 | timeCreated: 1496346594 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier/CurveSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace SplineMesh { 8 | /// 9 | /// Imutable class containing all data about a point on a cubic bezier curve. 10 | /// 11 | public struct CurveSample 12 | { 13 | public readonly Vector3 location; 14 | public readonly Vector3 tangent; 15 | public readonly Vector3 up; 16 | public readonly Vector2 scale; 17 | public readonly float roll; 18 | public readonly float distanceInCurve; 19 | public readonly float timeInCurve; 20 | public readonly CubicBezierCurve curve; 21 | 22 | private Quaternion rotation; 23 | 24 | /// 25 | /// Rotation is a look-at quaternion calculated from the tangent, roll and up vector. Mixing non zero roll and custom up vector is not advised. 26 | /// 27 | public Quaternion Rotation { 28 | get { 29 | if (rotation == Quaternion.identity) { 30 | var upVector = Vector3.Cross(tangent, Vector3.Cross(Quaternion.AngleAxis(roll, Vector3.forward) * up, tangent).normalized); 31 | rotation = Quaternion.LookRotation(tangent, upVector); 32 | } 33 | return rotation; 34 | } 35 | } 36 | 37 | public CurveSample(Vector3 location, Vector3 tangent, Vector3 up, Vector2 scale, float roll, float distanceInCurve, float timeInCurve, CubicBezierCurve curve) { 38 | this.location = location; 39 | this.tangent = tangent; 40 | this.up = up; 41 | this.roll = roll; 42 | this.scale = scale; 43 | this.distanceInCurve = distanceInCurve; 44 | this.timeInCurve = timeInCurve; 45 | this.curve = curve; 46 | rotation = Quaternion.identity; 47 | } 48 | 49 | public override bool Equals(object obj) { 50 | if (obj == null || GetType() != obj.GetType()) { 51 | return false; 52 | } 53 | CurveSample other = (CurveSample)obj; 54 | return location == other.location && 55 | tangent == other.tangent && 56 | up == other.up && 57 | scale == other.scale && 58 | roll == other.roll && 59 | distanceInCurve == other.distanceInCurve && 60 | timeInCurve == other.timeInCurve; 61 | 62 | } 63 | 64 | public override int GetHashCode() { 65 | return base.GetHashCode(); 66 | } 67 | 68 | public static bool operator ==(CurveSample cs1, CurveSample cs2) { 69 | return cs1.Equals(cs2); 70 | } 71 | 72 | public static bool operator !=(CurveSample cs1, CurveSample cs2) { 73 | return !cs1.Equals(cs2); 74 | } 75 | 76 | /// 77 | /// Linearly interpolates between two curve samples. 78 | /// 79 | /// 80 | /// 81 | /// 82 | /// 83 | public static CurveSample Lerp(CurveSample a, CurveSample b, float t) { 84 | return new CurveSample( 85 | Vector3.Lerp(a.location, b.location, t), 86 | Vector3.Lerp(a.tangent, b.tangent, t).normalized, 87 | Vector3.Lerp(a.up, b.up, t), 88 | Vector2.Lerp(a.scale, b.scale, t), 89 | Mathf.Lerp(a.roll, b.roll, t), 90 | Mathf.Lerp(a.distanceInCurve, b.distanceInCurve, t), 91 | Mathf.Lerp(a.timeInCurve, b.timeInCurve, t), 92 | a.curve); 93 | } 94 | 95 | public MeshVertex GetBent(MeshVertex vert) { 96 | var res = new MeshVertex(vert.position, vert.normal, vert.uv); 97 | 98 | // application of scale 99 | res.position = Vector3.Scale(res.position, new Vector3(0, scale.y, scale.x)); 100 | 101 | // application of roll 102 | res.position = Quaternion.AngleAxis(roll, Vector3.right) * res.position; 103 | res.normal = Quaternion.AngleAxis(roll, Vector3.right) * res.normal; 104 | 105 | // reset X value 106 | res.position.x = 0; 107 | 108 | // application of the rotation + location 109 | Quaternion q = Rotation * Quaternion.Euler(0, -90, 0); 110 | res.position = q * res.position + location; 111 | res.normal = q * res.normal; 112 | return res; 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier/CurveSample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50dca9a395f88c54e8349ccff19f097b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier/Spline.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a85c5879d519aa4ab2ebbf42591149a 3 | timeCreated: 1496346246 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier/SplineNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.Events; 6 | 7 | namespace SplineMesh { 8 | /// 9 | /// Spline node storing a position and a direction (tangent). 10 | /// Note : you shouldn't modify position and direction manualy but use dedicated methods instead, to insure event raising. 11 | /// 12 | [Serializable] 13 | public class SplineNode { 14 | 15 | /// 16 | /// Node position 17 | /// 18 | public Vector3 Position { 19 | get { return position; } 20 | set { 21 | if (position.Equals(value)) return; 22 | position.x = value.x; 23 | position.y = value.y; 24 | position.z = value.z; 25 | if(Changed != null) Changed(this, EventArgs.Empty); 26 | } 27 | } 28 | [SerializeField] 29 | private Vector3 position; 30 | 31 | /// 32 | /// Node direction 33 | /// 34 | public Vector3 Direction { 35 | get { return direction; } 36 | set { 37 | if (direction.Equals(value)) return; 38 | direction.x = value.x; 39 | direction.y = value.y; 40 | direction.z = value.z; 41 | if (Changed != null) Changed(this, EventArgs.Empty); 42 | } 43 | } 44 | [SerializeField] 45 | private Vector3 direction; 46 | 47 | /// 48 | /// Up vector to apply at this node. 49 | /// Usefull to specify the orientation when the tangent blend with the world UP (gimball lock) 50 | /// This value is not used on the spline itself but is commonly used on bended content. 51 | /// 52 | public Vector3 Up { 53 | get { return up; } 54 | set { 55 | if (up.Equals(value)) return; 56 | up.x = value.x; 57 | up.y = value.y; 58 | up.z = value.z; 59 | if (Changed != null) Changed(this, EventArgs.Empty); 60 | } 61 | } 62 | [SerializeField] 63 | private Vector3 up = Vector3.up; 64 | 65 | /// 66 | /// Scale to apply at this node. 67 | /// This value is not used on the spline itself but is commonly used on bended content. 68 | /// 69 | public Vector2 Scale { 70 | get { return scale; } 71 | set { 72 | if (scale.Equals(value)) return; 73 | scale.x = value.x; 74 | scale.y = value.y; 75 | if (Changed != null) Changed(this, EventArgs.Empty); 76 | } 77 | } 78 | [SerializeField] 79 | private Vector2 scale = Vector2.one; 80 | 81 | /// 82 | /// Roll to apply at this node. 83 | /// This value is not used on the spline itself but is commonly used on bended content. 84 | /// 85 | public float Roll { 86 | get { return roll; } 87 | set { 88 | if (roll == value) return; 89 | roll = value; 90 | if (Changed != null) Changed(this, EventArgs.Empty); 91 | } 92 | } 93 | [SerializeField] 94 | private float roll; 95 | 96 | public SplineNode(Vector3 position, Vector3 direction) { 97 | Position = position; 98 | Direction = direction; 99 | } 100 | 101 | /// 102 | /// Event raised when position, direction, scale or roll changes. 103 | /// 104 | [HideInInspector] 105 | public event EventHandler Changed; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier/SplineNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fcdfb895c0d3cd409b1f79c2c9ff09b 3 | timeCreated: 1496346255 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier/SplineSmoother.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | using UnityEngine; 6 | using UnityEngine.Events; 7 | 8 | namespace SplineMesh { 9 | [DisallowMultipleComponent] 10 | [ExecuteInEditMode] 11 | [RequireComponent(typeof(Spline))] 12 | public class SplineSmoother : MonoBehaviour { 13 | private Spline spline; 14 | private Spline Spline { 15 | get { 16 | if (spline == null) spline = GetComponent(); 17 | return spline; 18 | } 19 | } 20 | 21 | [Range(0, 1f)] public float curvature = 0.3f; 22 | 23 | private void OnValidate() { 24 | SmoothAll(); 25 | } 26 | 27 | private void OnEnable() { 28 | Spline.NodeListChanged += Spline_NodeListChanged; 29 | foreach(var node in Spline.nodes) { 30 | node.Changed += OnNodeChanged; 31 | } 32 | SmoothAll(); 33 | } 34 | 35 | private void OnDisable() { 36 | Spline.NodeListChanged -= Spline_NodeListChanged; 37 | foreach (var node in Spline.nodes) { 38 | node.Changed -= OnNodeChanged; 39 | } 40 | } 41 | 42 | private void Spline_NodeListChanged(object sender, ListChangedEventArgs args) { 43 | if(args.newItems != null) { 44 | foreach (var node in args.newItems) { 45 | node.Changed += OnNodeChanged; 46 | } 47 | } 48 | if(args.removedItems != null) { 49 | foreach (var node in args.removedItems) { 50 | node.Changed -= OnNodeChanged; 51 | } 52 | } 53 | } 54 | 55 | private void OnNodeChanged(object sender, EventArgs e) { 56 | var node = (SplineNode)sender; 57 | SmoothNode(node); 58 | var index = Spline.nodes.IndexOf(node); 59 | if(index > 0) { 60 | SmoothNode(Spline.nodes[index - 1]); 61 | } 62 | if(index < Spline.nodes.Count - 1) { 63 | SmoothNode(Spline.nodes[index + 1]); 64 | 65 | } 66 | } 67 | 68 | private void SmoothNode(SplineNode node) { 69 | var index = Spline.nodes.IndexOf(node); 70 | var pos = node.Position; 71 | // For the direction, we need to compute a smooth vector. 72 | // Orientation is obtained by substracting the vectors to the previous and next way points, 73 | // which give an acceptable tangent in most situations. 74 | // Then we apply a part of the average magnitude of these two vectors, according to the smoothness we want. 75 | var dir = Vector3.zero; 76 | float averageMagnitude = 0; 77 | if (index != 0) { 78 | var previousPos = Spline.nodes[index - 1].Position; 79 | var toPrevious = pos - previousPos; 80 | averageMagnitude += toPrevious.magnitude; 81 | dir += toPrevious.normalized; 82 | } 83 | if (index != Spline.nodes.Count - 1) { 84 | var nextPos = Spline.nodes[index + 1].Position; 85 | var toNext = pos - nextPos; 86 | averageMagnitude += toNext.magnitude; 87 | dir -= toNext.normalized; 88 | } 89 | averageMagnitude *= 0.5f; 90 | // This constant should vary between 0 and 0.5, and allows to add more or less smoothness. 91 | dir = dir.normalized * averageMagnitude * curvature; 92 | 93 | // In SplineMesh, the node direction is not relative to the node position. 94 | var controlPoint = dir + pos; 95 | 96 | // We only set one direction at each spline node because SplineMesh only support mirrored direction between curves. 97 | node.Direction = controlPoint; 98 | } 99 | 100 | 101 | private void SmoothAll() { 102 | foreach(var node in Spline.nodes) { 103 | SmoothNode(node); 104 | } 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Bezier/SplineSmoother.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3c62baecdb58fe4583d8f8283102e76 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c764e36e8d99fb44a7c58115383e6fe 3 | folderAsset: yes 4 | timeCreated: 1496349582 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Editor/SplineEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 939ffc1cc7c3bfc42b8b61242dd8f0f6 3 | timeCreated: 1500675319 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Editor/SplineExtrusionEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEditor; 4 | 5 | namespace SplineMesh { 6 | [CustomEditor(typeof(SplineExtrusion))] 7 | public class SplineExtrusionEditor : Editor { 8 | private const int QUAD_SIZE = 10; 9 | private Color CURVE_COLOR = new Color(0.8f, 0.8f, 0.8f); 10 | private bool mustCreateNewNode = false; 11 | private SerializedProperty textureScale; 12 | private SerializedProperty sampleSpacing; 13 | private SerializedProperty material; 14 | private SerializedProperty vertices; 15 | 16 | private SplineExtrusion se; 17 | private ExtrusionSegment.Vertex selection = null; 18 | private int selectionIndex = -1; 19 | 20 | private void OnEnable() { 21 | se = (SplineExtrusion)target; 22 | textureScale = serializedObject.FindProperty("textureScale"); 23 | sampleSpacing = serializedObject.FindProperty("sampleSpacing"); 24 | material = serializedObject.FindProperty("material"); 25 | vertices = serializedObject.FindProperty("shapeVertices"); 26 | 27 | if (se.shapeVertices.Count > 0) { 28 | if (se.selectedVertexIndex < 0 || se.selectedVertexIndex > se.shapeVertices.Count - 1) { 29 | se.selectedVertexIndex = 0; 30 | } 31 | selection = se.shapeVertices[se.selectedVertexIndex]; 32 | selectionIndex = se.selectedVertexIndex; 33 | } else { 34 | selection = null; 35 | selectionIndex = -1; 36 | } 37 | } 38 | 39 | void OnSceneGUI() { 40 | if (se.shapeVertices.Count > 0 && (selection == null || selectionIndex != se.selectedVertexIndex)) { 41 | if (se.selectedVertexIndex < 0 || se.selectedVertexIndex > se.shapeVertices.Count - 1) { 42 | se.selectedVertexIndex = 0; 43 | } 44 | selection = se.shapeVertices[se.selectedVertexIndex]; 45 | selectionIndex = se.selectedVertexIndex; 46 | } 47 | 48 | Event e = Event.current; 49 | if (e.type == EventType.MouseDown) { 50 | // if alt key pressed, we will have to create a new vertex if position is changed 51 | if (e.alt) { 52 | mustCreateNewNode = true; 53 | } 54 | } 55 | if (e.type == EventType.MouseUp) { 56 | mustCreateNewNode = false; 57 | } 58 | var spline = se.GetComponent(); 59 | 60 | CurveSample startSample = spline.GetSample(0); 61 | Quaternion q = startSample.Rotation; 62 | int vIdx = -1; 63 | foreach (ExtrusionSegment.Vertex v in se.shapeVertices) { 64 | ++vIdx; 65 | // we create point and normal relative to the spline start where the shape is drawn 66 | Vector3 point = se.transform.TransformPoint(q * v.point + startSample.location); 67 | Vector3 normal = se.transform.TransformPoint(q * (v.point + v.normal) + startSample.location); 68 | 69 | // first we check if at least one thing is in the camera field of view 70 | if (!CameraUtility.IsOnScreen(point) && !CameraUtility.IsOnScreen(normal)) continue; 71 | 72 | if (v == selection) { 73 | // draw the handles for selected vertex position and normal 74 | float size = HandleUtility.GetHandleSize(point) * 0.3f; 75 | float snap = 0.1f; 76 | 77 | // create a handle for the vertex position 78 | Vector3 movedPoint = Handles.Slider2D(0, point, startSample.tangent, Vector3.right, Vector3.up, size, Handles.CircleHandleCap, new Vector2(snap, snap)); 79 | if (movedPoint != point) { 80 | // position has been moved 81 | Vector2 newVertexPoint = Quaternion.Inverse(q) * (se.transform.InverseTransformPoint(movedPoint) - startSample.location); 82 | if (mustCreateNewNode) { 83 | Undo.RecordObject(se, $"Created new vertex {vIdx+1} in {se.name}"); 84 | 85 | // We must create a new node 86 | mustCreateNewNode = false; 87 | ExtrusionSegment.Vertex newVertex = new ExtrusionSegment.Vertex(newVertexPoint, v.normal, v.uCoord); 88 | if (vIdx == se.shapeVertices.Count - 1) { 89 | se.shapeVertices.Add(newVertex); 90 | } else { 91 | se.shapeVertices.Insert(vIdx + 1, newVertex); 92 | } 93 | selection = newVertex; 94 | se.selectedVertexIndex = vIdx + 1; 95 | selectionIndex = vIdx + 1; 96 | } else { 97 | Undo.RecordObject(se, $"Moved vertex {vIdx} in {se.name}"); 98 | 99 | v.point = newVertexPoint; 100 | // normal must be updated if point has been moved 101 | normal = se.transform.TransformPoint(q * (v.point + v.normal) + startSample.location); 102 | } 103 | se.SetToUpdate(); 104 | } else { 105 | // vertex position handle hasn't been moved 106 | // create a handle for normal 107 | Vector3 movedNormal = Handles.Slider2D(normal, startSample.tangent, Vector3.right, Vector3.up, size, Handles.CircleHandleCap, snap); 108 | if (movedNormal != normal) { 109 | Undo.RecordObject(se, $"Moved normal of vertex {vIdx} in {se.name}"); 110 | 111 | // normal has been moved 112 | v.normal = (Vector2)(Quaternion.Inverse(q) * (se.transform.InverseTransformPoint(movedNormal) - startSample.location)) - v.point; 113 | se.SetToUpdate(); 114 | } 115 | } 116 | 117 | Handles.BeginGUI(); 118 | DrawQuad(HandleUtility.WorldToGUIPoint(point), CURVE_COLOR); 119 | DrawQuad(HandleUtility.WorldToGUIPoint(normal), Color.red); 120 | Handles.EndGUI(); 121 | } else { 122 | // we draw a button to allow selection of the vertex 123 | Handles.BeginGUI(); 124 | Vector2 p = HandleUtility.WorldToGUIPoint(point); 125 | if (GUI.Button(new Rect(p - new Vector2(QUAD_SIZE / 2, QUAD_SIZE / 2), new Vector2(QUAD_SIZE, QUAD_SIZE)), GUIContent.none)) { 126 | Undo.RecordObject(se, $"Selected vertex {vIdx} of {se.name}"); 127 | selection = v; 128 | se.selectedVertexIndex = vIdx; 129 | selectionIndex = vIdx; 130 | } 131 | Handles.EndGUI(); 132 | } 133 | 134 | // draw an arrow from the vertex location to the normal 135 | Handles.color = Color.red; 136 | Handles.DrawLine(point, normal); 137 | 138 | // draw a line between that vertex and the next one 139 | int index = se.shapeVertices.IndexOf(v); 140 | int nextIndex = index == se.shapeVertices.Count - 1 ? 0 : index + 1; 141 | ExtrusionSegment.Vertex next = se.shapeVertices[nextIndex]; 142 | Handles.color = CURVE_COLOR; 143 | Vector3 vAtSplineEnd = se.transform.TransformPoint(q * next.point + startSample.location); 144 | Handles.DrawLine(point, vAtSplineEnd); 145 | } 146 | } 147 | 148 | void DrawQuad(Rect rect, Color color) { 149 | Texture2D texture = new Texture2D(1, 1); 150 | texture.SetPixel(0, 0, color); 151 | texture.Apply(); 152 | GUI.skin.box.normal.background = texture; 153 | GUI.Box(rect, GUIContent.none); 154 | } 155 | 156 | void DrawQuad(Vector2 position, Color color) { 157 | DrawQuad(new Rect(position - new Vector2(QUAD_SIZE / 2, QUAD_SIZE / 2), new Vector2(QUAD_SIZE, QUAD_SIZE)), color); 158 | } 159 | 160 | public override void OnInspectorGUI() { 161 | serializedObject.Update(); 162 | // Add vertex hint 163 | EditorGUILayout.HelpBox("Hold Alt and drag a vertex to create a new one.", MessageType.Info); 164 | 165 | // Delete vertex button 166 | if (selection == null || se.shapeVertices.Count <= 3) { 167 | GUI.enabled = false; 168 | } 169 | if (GUILayout.Button("Delete selected vertex")) { 170 | Undo.RegisterCompleteObjectUndo(se, "delete vertex"); 171 | se.shapeVertices.Remove(selection); 172 | selection = null; 173 | se.selectedVertexIndex = -1; 174 | selectionIndex = -1; 175 | se.SetToUpdate(); 176 | } 177 | GUI.enabled = true; 178 | 179 | // Properties 180 | EditorGUILayout.PropertyField(textureScale, true); 181 | EditorGUILayout.PropertyField(sampleSpacing, true); 182 | EditorGUILayout.PropertyField(material, true); 183 | 184 | EditorGUILayout.PropertyField(vertices); 185 | EditorGUI.indentLevel += 1; 186 | if (vertices.isExpanded) { 187 | for (int i = 0; i < vertices.arraySize; i++) { 188 | EditorGUILayout.PropertyField(vertices.GetArrayElementAtIndex(i), new GUIContent("Vertex " + i), true); 189 | } 190 | } 191 | EditorGUI.indentLevel -= 1; 192 | 193 | serializedObject.ApplyModifiedProperties(); 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Editor/SplineExtrusionEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f8d2f224507f8d4881b64654b6cb902 3 | timeCreated: 1499183036 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f08b8edc2f03d414d87eb3b7dbb457cb 3 | folderAsset: yes 4 | timeCreated: 1499182645 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleContortAlong.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace SplineMesh { 7 | /// 8 | /// Example of component to show the deformation of a mesh in a changing 9 | /// interval in spline space. 10 | /// 11 | /// This component is only for demo purpose and is not intended to be used as-is. 12 | /// 13 | [ExecuteInEditMode] 14 | [RequireComponent(typeof(Spline))] 15 | public class ExampleContortAlong : MonoBehaviour { 16 | private Spline spline; 17 | private float rate = 0; 18 | private MeshBender meshBender; 19 | 20 | [HideInInspector] 21 | public GameObject generated; 22 | 23 | public Mesh mesh; 24 | public Material material; 25 | public Vector3 rotation; 26 | public Vector3 scale; 27 | 28 | public float DurationInSecond; 29 | 30 | private void OnEnable() { 31 | rate = 0; 32 | Init(); 33 | #if UNITY_EDITOR 34 | EditorApplication.update += EditorUpdate; 35 | #endif 36 | } 37 | 38 | void OnDisable() { 39 | #if UNITY_EDITOR 40 | EditorApplication.update -= EditorUpdate; 41 | #endif 42 | } 43 | 44 | private void OnValidate() { 45 | Init(); 46 | } 47 | 48 | void EditorUpdate() { 49 | rate += Time.deltaTime / DurationInSecond; 50 | if (rate > 1) { 51 | rate --; 52 | } 53 | Contort(); 54 | } 55 | 56 | private void Contort() { 57 | if (generated != null) { 58 | meshBender.SetInterval(spline, spline.Length * rate); 59 | meshBender.ComputeIfNeeded(); 60 | } 61 | } 62 | 63 | private void Init() { 64 | string generatedName = "generated by " + GetType().Name; 65 | var generatedTranform = transform.Find(generatedName); 66 | generated = generatedTranform != null ? generatedTranform.gameObject : UOUtility.Create(generatedName, gameObject, 67 | typeof(MeshFilter), 68 | typeof(MeshRenderer), 69 | typeof(MeshBender)); 70 | 71 | generated.GetComponent().material = material; 72 | 73 | meshBender = generated.GetComponent(); 74 | spline = GetComponent(); 75 | 76 | meshBender.Source = SourceMesh.Build(mesh) 77 | .Rotate(Quaternion.Euler(rotation)) 78 | .Scale(scale); 79 | meshBender.Mode = MeshBender.FillingMode.Once; 80 | meshBender.SetInterval(spline, 0); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleContortAlong.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d306cefadf2ceb47a68968ad99b781f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleFollowSpline.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace SplineMesh { 7 | /// 8 | /// Example of component to show that the spline is an independant mathematical component and can be used for other purposes than mesh deformation. 9 | /// 10 | /// This component is only for demo purpose and is not intended to be used as-is. 11 | /// 12 | /// We only move an object along the spline. Imagine a camera route, a ship patrol... 13 | /// 14 | [ExecuteInEditMode] 15 | [RequireComponent(typeof(Spline))] 16 | public class ExampleFollowSpline : MonoBehaviour { 17 | private GameObject generated; 18 | private Spline spline; 19 | private float rate = 0; 20 | 21 | public GameObject Follower; 22 | public float DurationInSecond; 23 | 24 | private void OnEnable() { 25 | rate = 0; 26 | string generatedName = "generated by " + GetType().Name; 27 | var generatedTranform = transform.Find(generatedName); 28 | generated = generatedTranform != null ? generatedTranform.gameObject : Instantiate(Follower, gameObject.transform); 29 | generated.name = generatedName; 30 | 31 | spline = GetComponent(); 32 | #if UNITY_EDITOR 33 | EditorApplication.update += EditorUpdate; 34 | #endif 35 | } 36 | 37 | void OnDisable() { 38 | #if UNITY_EDITOR 39 | EditorApplication.update -= EditorUpdate; 40 | #endif 41 | } 42 | 43 | void EditorUpdate() { 44 | rate += Time.deltaTime / DurationInSecond; 45 | if (rate > spline.nodes.Count - 1) { 46 | rate -= spline.nodes.Count - 1; 47 | } 48 | PlaceFollower(); 49 | } 50 | 51 | private void PlaceFollower() { 52 | if (generated != null) { 53 | CurveSample sample = spline.GetSample(rate); 54 | generated.transform.localPosition = sample.location; 55 | generated.transform.localRotation = sample.Rotation; 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleFollowSpline.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 371753988c008004ca1da9ce435ba75b 3 | timeCreated: 1510601846 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleGrowingRoot.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace SplineMesh { 7 | /// 8 | /// Example of component to show the deformation of the mesh on a changing 9 | /// interval and changing spline nodes. 10 | /// 11 | /// In this example, as the MeshBender is working on spline space, it will update 12 | /// the mesh if one of the curve change. Each change make the MeshBender "dirty" and 13 | /// it will compute the mesh only once on it's next update call. 14 | /// 15 | /// This component is only for demo purpose and is not intended to be used as-is. 16 | /// 17 | [ExecuteInEditMode] 18 | [RequireComponent(typeof(Spline))] 19 | public class ExampleGrowingRoot : MonoBehaviour { 20 | private GameObject generated; 21 | private Spline spline; 22 | private float rate = 0; 23 | private MeshBender meshBender; 24 | 25 | public Mesh mesh; 26 | public Material material; 27 | public Vector3 rotation; 28 | public Vector3 scale; 29 | 30 | public float startScale = 1; 31 | 32 | public float DurationInSecond; 33 | 34 | private void OnEnable() { 35 | rate = 0; 36 | Init(); 37 | #if UNITY_EDITOR 38 | EditorApplication.update += EditorUpdate; 39 | #endif 40 | } 41 | 42 | void OnDisable() { 43 | #if UNITY_EDITOR 44 | EditorApplication.update -= EditorUpdate; 45 | #endif 46 | } 47 | 48 | private void OnValidate() { 49 | Init(); 50 | } 51 | 52 | private void Update() { 53 | EditorUpdate(); 54 | } 55 | 56 | void EditorUpdate() { 57 | rate += Time.deltaTime / DurationInSecond; 58 | if (rate > 1) { 59 | rate --; 60 | } 61 | Contort(); 62 | } 63 | 64 | private void Contort() { 65 | float nodeDistance = 0; 66 | int i = 0; 67 | foreach (var n in spline.nodes) { 68 | float nodeDistanceRate = nodeDistance / spline.Length; 69 | float nodeScale = startScale * (rate - nodeDistanceRate); 70 | n.Scale = new Vector2(nodeScale, nodeScale); 71 | if (i < spline.curves.Count) { 72 | nodeDistance += spline.curves[i++].Length; 73 | } 74 | } 75 | 76 | if (generated != null) { 77 | meshBender.SetInterval(spline, 0, spline.Length * rate); 78 | meshBender.ComputeIfNeeded(); 79 | } 80 | } 81 | 82 | private void Init() { 83 | string generatedName = "generated by " + GetType().Name; 84 | var generatedTranform = transform.Find(generatedName); 85 | generated = generatedTranform != null ? generatedTranform.gameObject : UOUtility.Create(generatedName, gameObject, 86 | typeof(MeshFilter), 87 | typeof(MeshRenderer), 88 | typeof(MeshBender)); 89 | 90 | generated.GetComponent().material = material; 91 | 92 | meshBender = generated.GetComponent(); 93 | spline = GetComponent(); 94 | 95 | meshBender.Source = SourceMesh.Build(mesh) 96 | .Rotate(Quaternion.Euler(rotation)) 97 | .Scale(scale); 98 | meshBender.Mode = MeshBender.FillingMode.StretchToInterval; 99 | meshBender.SetInterval(spline, 0, 0.01f); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleGrowingRoot.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0509837adb1f3f6429965e5500c48b55 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleSower.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnityEngine; 6 | 7 | namespace SplineMesh { 8 | /// 9 | /// Example of component to places assets along a spline. This component can be used as-is but will most likely be a base for your own component. 10 | /// 11 | /// In this example, the user gives the prefab to place, a spacing value between two placements, the prefab scale and an horizontal offset to the spline. 12 | /// These three last values have an additional range, allowing to add some randomness. for each placement, the computed value will be between value and value+range. 13 | /// 14 | /// Prefabs are placed from the start of the spline at computed spacing, unitl there is no lentgh remaining. Prefabs are stored, destroyed 15 | /// and built again each time the spline or one of its curves change. 16 | /// 17 | /// A random seed is used to obtain the same random numbers at each update. The user can specify the seed to test some other random number set. 18 | /// 19 | /// Place prefab along a spline and deform it easily have a lot of usages if you have some imagination : 20 | /// - place trees along a road 21 | /// - create a rocky bridge 22 | /// - create a footstep track with decals 23 | /// - create a path of firefly in the dark 24 | /// - create a natural wall with overlapping rocks 25 | /// - etc. 26 | /// 27 | [ExecuteInEditMode] 28 | [SelectionBase] 29 | [DisallowMultipleComponent] 30 | public class ExampleSower : MonoBehaviour { 31 | private GameObject generated; 32 | private Spline spline = null; 33 | private bool toUpdate = true; 34 | 35 | public GameObject prefab = null; 36 | public float scale = 1, scaleRange = 0; 37 | public float spacing = 1, spacingRange = 0; 38 | public float offset = 0, offsetRange = 0; 39 | public bool isRandomYaw = false; 40 | public int randomSeed = 0; 41 | 42 | private void OnEnable() { 43 | string generatedName = "generated by "+GetType().Name; 44 | var generatedTranform = transform.Find(generatedName); 45 | generated = generatedTranform != null ? generatedTranform.gameObject : UOUtility.Create(generatedName, gameObject); 46 | 47 | spline = GetComponentInParent(); 48 | spline.NodeListChanged += (s, e) => { 49 | toUpdate = true; 50 | foreach (CubicBezierCurve curve in spline.GetCurves()) { 51 | curve.Changed.AddListener(() => toUpdate = true); 52 | } 53 | }; 54 | foreach (CubicBezierCurve curve in spline.GetCurves()) { 55 | curve.Changed.AddListener(() => toUpdate = true); 56 | } 57 | } 58 | 59 | private void OnValidate() { 60 | toUpdate = true; 61 | } 62 | 63 | private void Update() { 64 | if (toUpdate) { 65 | Sow(); 66 | toUpdate = false; 67 | } 68 | } 69 | 70 | public void Sow() { 71 | UOUtility.DestroyChildren(generated); 72 | 73 | UnityEngine.Random.InitState(randomSeed); 74 | if (spacing + spacingRange <= 0 || 75 | prefab == null) 76 | return; 77 | 78 | float distance = 0; 79 | while (distance <= spline.Length) { 80 | CurveSample sample = spline.GetSampleAtDistance(distance); 81 | 82 | GameObject go; 83 | go = Instantiate(prefab, generated.transform); 84 | go.transform.localRotation = Quaternion.identity; 85 | go.transform.localPosition = Vector3.zero; 86 | go.transform.localScale = Vector3.one; 87 | 88 | // move along spline, according to spacing + random 89 | go.transform.localPosition = sample.location; 90 | // apply scale + random 91 | float rangedScale = scale + UnityEngine.Random.Range(0, scaleRange); 92 | go.transform.localScale = new Vector3(rangedScale, rangedScale, rangedScale); 93 | // rotate with random yaw 94 | if (isRandomYaw) { 95 | go.transform.Rotate(0, 0, UnityEngine.Random.Range(-180, 180)); 96 | } else { 97 | go.transform.rotation = sample.Rotation; 98 | } 99 | // move orthogonaly to the spline, according to offset + random 100 | var binormal = (Quaternion.LookRotation(sample.tangent, sample.up) * Vector3.right).normalized; 101 | var localOffset = offset + UnityEngine.Random.Range(0, offsetRange * Math.Sign(offset)); 102 | localOffset *= sample.scale.x; 103 | binormal *= localOffset; 104 | go.transform.position += binormal; 105 | 106 | distance += spacing + UnityEngine.Random.Range(0, spacingRange); 107 | } 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleSower.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67bc80d4c1c799346b57921fb3aaeeeb 3 | timeCreated: 1504637208 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleTentacle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace SplineMesh { 7 | /// 8 | /// Example of component to bend a mesh along a spline with some interpolation of scales and rolls. This component can be used as-is but will most likely be a base for your own component. 9 | /// 10 | /// For explanations of the base component, 11 | /// 12 | /// In this component, we have added properties to make scale and roll vary between spline start and end. 13 | /// Intermediate scale and roll values are calculated at each spline node accordingly to the distance, then given to the MeshBenders component. 14 | /// MeshBender applies scales and rolls values by interpollation if they differ from strat to end of the curve. 15 | /// 16 | /// You can easily imagine a list of scales to apply to each node independantly to create your own variation. 17 | /// 18 | [DisallowMultipleComponent] 19 | public class ExampleTentacle : MonoBehaviour { 20 | private Spline spline { get => GetComponent(); } 21 | 22 | public float startScale = 1, endScale = 1; 23 | public float startRoll = 0, endRoll = 0; 24 | 25 | private void OnValidate() { 26 | // apply scale and roll at each node 27 | float currentLength = 0; 28 | foreach (CubicBezierCurve curve in spline.GetCurves()) { 29 | float startRate = currentLength / spline.Length; 30 | currentLength += curve.Length; 31 | float endRate = currentLength / spline.Length; 32 | 33 | curve.n1.Scale = Vector2.one * (startScale + (endScale - startScale) * startRate); 34 | curve.n2.Scale = Vector2.one * (startScale + (endScale - startScale) * endRate); 35 | 36 | curve.n1.Roll = startRoll + (endRoll - startRoll) * startRate; 37 | curve.n2.Roll = startRoll + (endRoll - startRoll) * endRate; 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleTentacle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24d1b6e1e070eb14fa89607942b123cf 3 | timeCreated: 1499271585 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleTrack.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace SplineMesh { 8 | /// 9 | /// Example of component to bend many meshes along a spline. This component can be used as-is but will most likely be a base for your own component. 10 | /// 11 | /// This is a more advanced and real-life SplineMesh component. Use it as a source of inspiration. 12 | /// 13 | /// In this script, you will learn to : 14 | /// - preserve baked lightmap when entering playmode, 15 | /// - better manage the generated content life cycle to avoid useless calculations 16 | /// - create data class to produce richer content along your spline 17 | /// 18 | /// This is the most complete Example provided in the asset. For further help, information and ideas, please visit 19 | /// the officiel thread on Unity forum. 20 | /// 21 | /// And if you like SplineMesh, please review it on the asset store ! 22 | /// 23 | /// Now you should be able to bend the world to your will. 24 | /// 25 | /// Have fun with SplineMesh ! 26 | /// 27 | /// 28 | [ExecuteInEditMode] 29 | [SelectionBase] 30 | [DisallowMultipleComponent] 31 | public class ExampleTrack : MonoBehaviour { 32 | private GameObject generated; 33 | private Spline spline = null; 34 | private bool toUpdate = false; 35 | 36 | /// 37 | /// A list of object that are storing data for each segment of the curve. 38 | /// 39 | public List segments = new List(); 40 | 41 | /// 42 | /// If true, the generated content will be updated in play mode. 43 | /// If false, the content generated and saved to the scene will be used in playmode without modification. 44 | /// Usefull to preserve lightmaps baked for static objects. 45 | /// 46 | public bool updateInPlayMode; 47 | 48 | private void OnEnable() { 49 | string generatedName = "generated by " + GetType().Name; 50 | var generatedTranform = transform.Find(generatedName); 51 | generated = generatedTranform != null ? generatedTranform.gameObject : UOUtility.Create(generatedName, gameObject); 52 | 53 | spline = GetComponentInParent(); 54 | 55 | // we listen changes in the spline's node list and we update the list of segment accordingly 56 | // this way, if we insert a node between two others, a segment will be inserted too and the data won't shift 57 | while (segments.Count < spline.nodes.Count) { 58 | segments.Add(new TrackSegment()); 59 | } 60 | while (segments.Count > spline.nodes.Count) { 61 | segments.RemoveAt(segments.Count - 1); 62 | } 63 | spline.NodeListChanged += (s, e) => { 64 | switch (e.type) { 65 | case ListChangeType.Add: 66 | segments.Add(new TrackSegment()); 67 | break; 68 | case ListChangeType.Remove: 69 | segments.RemoveAt(e.removeIndex); 70 | break; 71 | case ListChangeType.Insert: 72 | segments.Insert(e.insertIndex, new TrackSegment()); 73 | break; 74 | } 75 | toUpdate = true; 76 | }; 77 | toUpdate = true; 78 | } 79 | 80 | private void OnValidate() { 81 | if (spline == null) return; 82 | toUpdate = true; 83 | } 84 | 85 | private void Update() { 86 | // we can prevent the generated content to be updated during playmode to preserve baked data saved in the scene 87 | if (!updateInPlayMode && Application.isPlaying) return; 88 | 89 | if (toUpdate) { 90 | toUpdate = false; 91 | CreateMeshes(); 92 | } 93 | } 94 | 95 | public void CreateMeshes() { 96 | List used = new List(); 97 | 98 | for (int i = 0; i < spline.GetCurves().Count; i++) { 99 | var curve = spline.GetCurves()[i]; 100 | foreach (var tm in segments[i].transformedMeshes) { 101 | if (tm.mesh == null) { 102 | // if there is no mesh specified for this segment, we ignore it. 103 | continue; 104 | } 105 | 106 | // we try to find a game object previously generated. this avoids destroying/creating 107 | // game objects at each update, wich is faster. 108 | var childName = "segment " + i + " mesh " + segments[i].transformedMeshes.IndexOf(tm); 109 | var childTransform = generated.transform.Find(childName); 110 | GameObject go; 111 | if (childTransform == null) { 112 | go = UOUtility.Create(childName, 113 | generated, 114 | typeof(MeshFilter), 115 | typeof(MeshRenderer), 116 | typeof(MeshBender), 117 | typeof(MeshCollider)); 118 | go.isStatic = true; 119 | } else { 120 | go = childTransform.gameObject; 121 | } 122 | go.GetComponent().material = tm.material; 123 | go.GetComponent().material = tm.physicMaterial; 124 | 125 | // we update the data in the bender. It will decide itself if the bending must be recalculated. 126 | MeshBender mb = go.GetComponent(); 127 | mb.Source = SourceMesh.Build(tm.mesh) 128 | .Translate(tm.translation) 129 | .Rotate(Quaternion.Euler(tm.rotation)) 130 | .Scale(tm.scale); 131 | mb.SetInterval(curve); 132 | mb.ComputeIfNeeded(); 133 | used.Add(go); 134 | } 135 | } 136 | 137 | // finally, we destroy the unused objects 138 | foreach (var go in generated.transform 139 | .Cast() 140 | .Select(child => child.gameObject).Except(used)) { 141 | UOUtility.Destroy(go); 142 | } 143 | } 144 | } 145 | 146 | /// 147 | /// This class store any data associated with a spline segment. 148 | /// In this example, a list of meshes. 149 | /// It is intended to be edited in the inspector. 150 | /// 151 | [Serializable] 152 | public class TrackSegment { 153 | public List transformedMeshes = new List(); 154 | } 155 | 156 | /// 157 | /// This class stores all needed data to represent a mesh in situation. 158 | /// It is intended to be edited in the inspector. 159 | /// 160 | [Serializable] 161 | public class TransformedMesh { 162 | public TransformedMesh() { 163 | scale = Vector3.one; 164 | } 165 | public Mesh mesh; 166 | public Material material; 167 | public PhysicMaterial physicMaterial; 168 | public Vector3 translation; 169 | public Vector3 rotation; 170 | public Vector3 scale = Vector3.one; 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/ExampleTrack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da5789f52fd48f54fb21c95bd79108e0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/RopeBuilder.cs: -------------------------------------------------------------------------------- 1 | using SplineMesh; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnityEngine; 6 | 7 | namespace SplineMesh { 8 | [ExecuteInEditMode] 9 | [RequireComponent(typeof(Spline))] 10 | public class RopeBuilder : MonoBehaviour { 11 | private bool toUpdate = false; 12 | private GameObject generated; 13 | private GameObject Generated { 14 | get { 15 | if (generated == null) { 16 | string generatedName = "generated by " + GetType().Name; 17 | var generatedTranform = transform.Find(generatedName); 18 | generated = generatedTranform != null ? generatedTranform.gameObject : UOUtility.Create(generatedName, gameObject); 19 | } 20 | return generated; 21 | } 22 | } 23 | 24 | private Spline spline; 25 | private GameObject firstSegment; 26 | 27 | [SerializeField] 28 | public List wayPoints = new List(); 29 | 30 | public GameObject segmentPrefab; 31 | public int segmentCount; 32 | public float segmentSpacing; 33 | 34 | private void OnEnable() { 35 | spline = GetComponent(); 36 | toUpdate = true; 37 | } 38 | 39 | private void OnValidate() { 40 | toUpdate = true; 41 | } 42 | 43 | private void Update() { 44 | if (toUpdate) { 45 | toUpdate = false; 46 | Generate(); 47 | UpdateSpline(); 48 | } 49 | UpdateNodes(); 50 | 51 | // balancing 52 | if (Application.isPlaying) { 53 | firstSegment.transform.localPosition = new Vector3(Mathf.Sin(Time.time) * 3, 0, 0); 54 | } 55 | } 56 | 57 | private void UpdateNodes() { 58 | int i = 0; 59 | foreach (GameObject wayPoint in wayPoints) { 60 | var node = spline.nodes[i++]; 61 | if (Vector3.Distance(node.Position, transform.InverseTransformPoint(wayPoint.transform.position)) > 0.001f) { 62 | node.Position = transform.InverseTransformPoint(wayPoint.transform.position); 63 | node.Up = wayPoint.transform.up; 64 | } 65 | } 66 | } 67 | 68 | private void UpdateSpline() { 69 | foreach (var penisNode in wayPoints.ToList()) { 70 | if (penisNode == null) wayPoints.Remove(penisNode); 71 | } 72 | int nodeCount = wayPoints.Count; 73 | // adjust the number of nodes in the spline. 74 | while (spline.nodes.Count < nodeCount) { 75 | spline.AddNode(new SplineNode(Vector3.zero, Vector3.zero)); 76 | } 77 | while (spline.nodes.Count > nodeCount && spline.nodes.Count > 2) { 78 | spline.RemoveNode(spline.nodes.Last()); 79 | } 80 | } 81 | 82 | private void Generate() { 83 | UOUtility.DestroyChildren(Generated); 84 | wayPoints.Clear(); 85 | 86 | float localSpacing = 0; 87 | Joint joint = null; 88 | for (int i = 0; i < segmentCount; i++) { 89 | var seg = UOUtility.Instantiate(segmentPrefab, Generated.transform); 90 | seg.transform.Translate(0, 0, localSpacing); 91 | 92 | var segRB = seg.GetComponent(); 93 | // we fix the first segment so that the rope won't fall 94 | if (i == 0) { 95 | firstSegment = seg; 96 | segRB.constraints = RigidbodyConstraints.FreezePosition; 97 | } 98 | 99 | // we attach the rigidbody to the joint of the previous segment 100 | if (joint != null) { 101 | joint.connectedBody = segRB; 102 | } 103 | joint = seg.GetComponent(); 104 | 105 | // we save segments as way points for the spline deformation. 106 | wayPoints.Add(seg); 107 | localSpacing += segmentSpacing; 108 | } 109 | UOUtility.Destroy(joint); 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Example/RopeBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 527bc1a47e91189469f521ea197a5f6c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f3755077c971d54492da57d5b6497f1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/ExtrusionSegment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace SplineMesh { 8 | [ExecuteInEditMode] 9 | [DisallowMultipleComponent] 10 | [RequireComponent(typeof(MeshFilter))] 11 | [RequireComponent(typeof(MeshRenderer))] 12 | public class ExtrusionSegment : MonoBehaviour { 13 | private bool isDirty = false; 14 | 15 | private MeshFilter mf; 16 | private Mesh result; 17 | 18 | private bool useSpline = false; 19 | private CubicBezierCurve curve; 20 | private Spline spline; 21 | private float intervalStart, intervalEnd; 22 | 23 | private List shapeVertices = new List(); 24 | /// 25 | /// 26 | /// 27 | public List ShapeVertices { 28 | get { return shapeVertices; } 29 | set { 30 | if (value == shapeVertices) return; 31 | SetDirty(); 32 | shapeVertices = value; 33 | } 34 | } 35 | 36 | private float textureScale = 1; 37 | /// 38 | /// 39 | /// 40 | public float TextureScale { 41 | get { return textureScale; } 42 | set { 43 | if (value == textureScale) return; 44 | SetDirty(); 45 | textureScale = value; 46 | } 47 | } 48 | 49 | private float textureOffset = 0; 50 | /// 51 | /// 52 | /// 53 | public float TextureOffset { 54 | get { return textureOffset; } 55 | set { 56 | if (value == textureOffset) return; 57 | SetDirty(); 58 | textureOffset = value; 59 | } 60 | } 61 | 62 | private float sampleSpacing = 0.1f; 63 | /// 64 | /// 65 | /// 66 | public float SampleSpacing { 67 | get { return sampleSpacing; } 68 | set { 69 | if (value == sampleSpacing) return; 70 | if (value <= 0) throw new ArgumentOutOfRangeException("SampleSpacing", "Must be greater than 0"); 71 | SetDirty(); 72 | sampleSpacing = value; 73 | } 74 | } 75 | 76 | private void OnEnable() { 77 | mf = GetComponent(); 78 | if (mf.sharedMesh == null) { 79 | mf.sharedMesh = new Mesh(); 80 | } 81 | } 82 | 83 | /// 84 | /// Set the cubic Bézier curve to use to bend the source mesh, and begin to listen to curve control points for changes. 85 | /// 86 | /// 87 | /// If let to true, update the resulting mesh immediatly. 88 | public void SetInterval(CubicBezierCurve curve) { 89 | if (this.curve == curve) return; 90 | if (curve == null) throw new ArgumentNullException("curve"); 91 | 92 | if (this.curve != null) { 93 | this.curve.Changed.RemoveListener(SetDirty); 94 | } 95 | this.curve = curve; 96 | spline = null; 97 | curve.Changed.AddListener(SetDirty); 98 | useSpline = false; 99 | SetDirty(); 100 | } 101 | 102 | public void SetInterval(Spline spline, float intervalStart, float intervalEnd = 0) { 103 | if (this.spline == spline && this.intervalStart == intervalStart && this.intervalEnd == intervalEnd) return; 104 | if (spline == null) throw new ArgumentNullException("spline"); 105 | if (intervalStart < 0 || intervalStart >= spline.Length) { 106 | throw new ArgumentOutOfRangeException("interval start must be 0 or greater and lesser than spline length (was " + intervalStart + ")"); 107 | } 108 | if (intervalEnd != 0 && intervalEnd <= intervalStart || intervalEnd > spline.Length) { 109 | throw new ArgumentOutOfRangeException("interval end must be 0 or greater than interval start, and lesser than spline length (was " + intervalEnd + ")"); 110 | } 111 | if (this.spline != null) { 112 | // unlistening previous spline 113 | this.spline.CurveChanged.RemoveListener(SetDirty); 114 | } 115 | this.spline = spline; 116 | // listening new spline 117 | spline.CurveChanged.AddListener(SetDirty); 118 | 119 | curve = null; 120 | this.intervalStart = intervalStart; 121 | this.intervalEnd = intervalEnd; 122 | useSpline = true; 123 | SetDirty(); 124 | } 125 | 126 | private void SetDirty() { 127 | isDirty = true; 128 | } 129 | 130 | private void LateUpdate() { 131 | ComputeIfNeeded(); 132 | } 133 | 134 | public void ComputeIfNeeded() { 135 | if (isDirty) { 136 | Compute(); 137 | isDirty = false; 138 | } 139 | } 140 | 141 | private List GetPath() { 142 | var path = new List(); 143 | if (useSpline) { 144 | // calculate path from spline interval 145 | float d = intervalStart; 146 | while (d < intervalEnd) { 147 | path.Add(spline.GetSampleAtDistance(d)); 148 | d += sampleSpacing; 149 | } 150 | path.Add(spline.GetSampleAtDistance(intervalEnd)); 151 | } else { 152 | // calculate path in a curve 153 | float d = 0; 154 | while (d < curve.Length) { 155 | path.Add(curve.GetSampleAtDistance(d)); 156 | d += sampleSpacing; 157 | } 158 | path.Add(curve.GetSampleAtDistance(curve.Length)); 159 | } 160 | return path; 161 | } 162 | 163 | public void Compute() { 164 | List path = GetPath(); 165 | 166 | int vertsInShape = shapeVertices.Count; 167 | int segmentCount = path.Count - 1; 168 | 169 | var triangleIndices = new List(vertsInShape * 2 * segmentCount * 3); 170 | var bentVertices = new List(vertsInShape * 2 * segmentCount * 3); 171 | 172 | foreach (var sample in path) { 173 | foreach (Vertex v in shapeVertices) { 174 | bentVertices.Add(sample.GetBent(new MeshVertex( 175 | new Vector3(0, v.point.y, -v.point.x), 176 | new Vector3(0, v.normal.y, -v.normal.x), 177 | new Vector2(v.uCoord, textureScale * (sample.distanceInCurve + textureOffset))))); 178 | } 179 | } 180 | var index = 0; 181 | for (int i = 0; i < segmentCount; i++) { 182 | for (int j = 0; j < shapeVertices.Count; j++) { 183 | int offset = j == shapeVertices.Count - 1 ? -(shapeVertices.Count - 1) : 1; 184 | int a = index + shapeVertices.Count; 185 | int b = index; 186 | int c = index + offset; 187 | int d = index + offset + shapeVertices.Count; 188 | triangleIndices.Add(c); 189 | triangleIndices.Add(b); 190 | triangleIndices.Add(a); 191 | triangleIndices.Add(a); 192 | triangleIndices.Add(d); 193 | triangleIndices.Add(c); 194 | index++; 195 | } 196 | } 197 | 198 | MeshUtility.Update(mf.sharedMesh, 199 | mf.sharedMesh, 200 | triangleIndices, 201 | bentVertices.Select(b => b.position), 202 | bentVertices.Select(b => b.normal), 203 | bentVertices.Select(b => b.uv)); 204 | var mc = GetComponent(); 205 | if(mc != null) { 206 | mc.sharedMesh = mf.sharedMesh; 207 | } 208 | } 209 | 210 | [Serializable] 211 | public class Vertex { 212 | public Vector2 point; 213 | public Vector2 normal; 214 | public float uCoord; 215 | 216 | public Vertex(Vector2 point, Vector2 normal, float uCoord) { 217 | this.point = point; 218 | this.normal = normal; 219 | this.uCoord = uCoord; 220 | } 221 | public Vertex(Vertex other) { 222 | this.point = other.point; 223 | this.normal = other.normal; 224 | this.uCoord = other.uCoord; 225 | } 226 | } 227 | } 228 | } 229 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/ExtrusionSegment.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67dc87f5a664ca14d9492006284bbca2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/MeshBender.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8cda9ed2ad6a8b4781166236afc26b3 3 | timeCreated: 1499508394 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/MeshVertex.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | 5 | namespace SplineMesh { 6 | [Serializable] 7 | public class MeshVertex { 8 | public Vector3 position; 9 | public Vector3 normal; 10 | public Vector2 uv; 11 | 12 | public MeshVertex(Vector3 position, Vector3 normal, Vector2 uv) { 13 | this.position = position; 14 | this.normal = normal; 15 | this.uv = uv; 16 | } 17 | 18 | public MeshVertex(Vector3 position, Vector3 normal) 19 | : this(position, normal, Vector2.zero) 20 | { 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/MeshVertex.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9956472d7384e9140aecfec0a88b1962 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/SourceMesh.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections.Generic; 4 | using System; 5 | 6 | namespace SplineMesh { 7 | /// 8 | /// This class returns a transformed version of a given source mesh, plus others 9 | /// informations to help bending the mesh along a curve. 10 | /// It is imutable to ensure better performances. 11 | /// 12 | /// To obtain an instance, call the static method . 13 | /// The building is made in a fluent way. 14 | /// 15 | public struct SourceMesh { 16 | private Vector3 translation; 17 | private Quaternion rotation; 18 | private Vector3 scale; 19 | 20 | internal Mesh Mesh { get; } 21 | 22 | private List vertices; 23 | internal List Vertices { 24 | get { 25 | if (vertices == null) BuildData(); 26 | return vertices; 27 | } 28 | } 29 | 30 | private int[] triangles; 31 | internal int[] Triangles { 32 | get { 33 | if (vertices == null) BuildData(); 34 | return triangles; 35 | } 36 | } 37 | 38 | private float minX; 39 | internal float MinX { 40 | get { 41 | if (vertices == null) BuildData(); 42 | return minX; 43 | } 44 | } 45 | 46 | private float length; 47 | internal float Length { 48 | get { 49 | if (vertices == null) BuildData(); 50 | return length; 51 | } 52 | } 53 | 54 | /// 55 | /// constructor is private to enable fluent builder pattern. 56 | /// Use to obtain an instance. 57 | /// 58 | /// 59 | private SourceMesh(Mesh mesh) { 60 | Mesh = mesh; 61 | translation = default(Vector3); 62 | rotation = default(Quaternion); 63 | scale = default(Vector3); 64 | vertices = null; 65 | triangles = null; 66 | minX = 0; 67 | length = 0; 68 | } 69 | 70 | /// 71 | /// copy constructor 72 | /// 73 | /// 74 | private SourceMesh(SourceMesh other) { 75 | Mesh = other.Mesh; 76 | translation = other.translation; 77 | rotation = other.rotation; 78 | scale = other.scale; 79 | vertices = null; 80 | triangles = null; 81 | minX = 0; 82 | length = 0; 83 | } 84 | 85 | public static SourceMesh Build(Mesh mesh) { 86 | return new SourceMesh(mesh); 87 | } 88 | 89 | public SourceMesh Translate(Vector3 translation) { 90 | var res = new SourceMesh(this) { 91 | translation = translation 92 | }; 93 | return res; 94 | } 95 | 96 | public SourceMesh Translate(float x, float y, float z) { 97 | return Translate(new Vector3(x, y, z)); 98 | } 99 | 100 | public SourceMesh Rotate(Quaternion rotation) { 101 | var res = new SourceMesh(this) { 102 | rotation = rotation 103 | }; 104 | return res; 105 | } 106 | 107 | public SourceMesh Scale(Vector3 scale) { 108 | var res = new SourceMesh(this) { 109 | scale = scale 110 | }; 111 | return res; 112 | } 113 | 114 | public SourceMesh Scale(float x, float y, float z) { 115 | return Scale(new Vector3(x, y, z)); 116 | } 117 | 118 | private void BuildData() { 119 | // if the mesh is reversed by scale, we must change the culling of the faces by inversing all triangles. 120 | // the mesh is reverse only if the number of resersing axes is impair. 121 | bool reversed = scale.x < 0; 122 | if (scale.y < 0) reversed = !reversed; 123 | if (scale.z < 0) reversed = !reversed; 124 | triangles = reversed ? MeshUtility.GetReversedTriangles(Mesh) : Mesh.triangles; 125 | 126 | // we transform the source mesh vertices according to rotation/translation/scale 127 | int i = 0; 128 | vertices = new List(Mesh.vertexCount); 129 | foreach (Vector3 vert in Mesh.vertices) { 130 | var transformed = new MeshVertex(vert, Mesh.normals[i++]); 131 | // application of rotation 132 | if (rotation != Quaternion.identity) { 133 | transformed.position = rotation * transformed.position; 134 | transformed.normal = rotation * transformed.normal; 135 | } 136 | if (scale != Vector3.one) { 137 | transformed.position = Vector3.Scale(transformed.position, scale); 138 | transformed.normal = Vector3.Scale(transformed.normal, scale); 139 | } 140 | if (translation != Vector3.zero) { 141 | transformed.position += translation; 142 | } 143 | vertices.Add(transformed); 144 | } 145 | 146 | // find the bounds along x 147 | minX = float.MaxValue; 148 | float maxX = float.MinValue; 149 | foreach (var vert in vertices) { 150 | Vector3 p = vert.position; 151 | maxX = Math.Max(maxX, p.x); 152 | minX = Math.Min(minX, p.x); 153 | } 154 | length = Math.Abs(maxX - minX); 155 | } 156 | 157 | public override bool Equals(object obj) { 158 | if (obj == null || GetType() != obj.GetType()) { 159 | return false; 160 | } 161 | var other = (SourceMesh)obj; 162 | return Mesh == other.Mesh && 163 | translation == other.translation && 164 | rotation == other.rotation && 165 | scale == other.scale; 166 | } 167 | 168 | public override int GetHashCode() { 169 | return base.GetHashCode(); 170 | } 171 | 172 | public static bool operator ==(SourceMesh sm1, SourceMesh sm2) { 173 | return sm1.Equals(sm2); 174 | } 175 | public static bool operator !=(SourceMesh sm1, SourceMesh sm2) { 176 | return sm1.Equals(sm2); 177 | } 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/SourceMesh.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6809125401b4116468732e472cad438b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/SplineExtrusion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnityEngine; 6 | 7 | namespace SplineMesh { 8 | /// 9 | /// Special component to extrude shape along a spline. 10 | /// 11 | /// Note : This component is not lightweight and should be used as-is mostly for prototyping. It allows to quickly create meshes by 12 | /// drawing only the 2D shape to extrude along the spline. The result is not intended to be used in a production context and you will most likely 13 | /// create eventualy the mesh you need in a modeling tool to save performances and have better control. 14 | /// 15 | /// The special editor of this component allow you to draw a 2D shape with vertices, normals and U texture coordinate. The V coordinate is set 16 | /// for the whole spline, by setting the number of times the texture must be repeated. 17 | /// 18 | /// All faces of the resulting mesh are smoothed. If you want to obtain an edge without smoothing, you will have to overlap two vertices and set two normals. 19 | /// 20 | /// You can expand the vertices list in the inspector to access data and enter precise values. 21 | /// 22 | /// This component doesn't offer much control as Unity is not a modeling tool. That said, you should be able to create your own version easily. 23 | /// 24 | [ExecuteInEditMode] 25 | [RequireComponent(typeof(Spline))] 26 | public class SplineExtrusion : MonoBehaviour { 27 | #if UNITY_EDITOR 28 | /// 29 | /// Used by SplineExtrusionEditor to know which vertex was last selected for this SplineExtrusion. 30 | /// Editor only (not included in runtime). 31 | /// 32 | [HideInInspector] 33 | public int selectedVertexIndex; 34 | #endif 35 | private Spline spline; 36 | private bool toUpdate = true; 37 | private GameObject generated; 38 | 39 | public List shapeVertices = new List(); 40 | public Material material; 41 | public float textureScale = 1; 42 | public float sampleSpacing = 0.1f; 43 | 44 | /// 45 | /// Clear shape vertices, then create three vertices with three normals for the extrusion to be visible 46 | /// 47 | private void Reset() { 48 | shapeVertices.Clear(); 49 | shapeVertices.Add(new ExtrusionSegment.Vertex(new Vector2(0, 0.5f), new Vector2(0, 1), 0)); 50 | shapeVertices.Add(new ExtrusionSegment.Vertex(new Vector2(1, -0.5f), new Vector2(1, -1), 0.33f)); 51 | shapeVertices.Add(new ExtrusionSegment.Vertex(new Vector2(-1, -0.5f), new Vector2(-1, -1), 0.66f)); 52 | toUpdate = true; 53 | OnEnable(); 54 | } 55 | 56 | private void OnValidate() { 57 | toUpdate = true; 58 | } 59 | 60 | private void OnEnable() { 61 | string generatedName = "generated by " + GetType().Name; 62 | var generatedTranform = transform.Find(generatedName); 63 | generated = generatedTranform != null ? generatedTranform.gameObject : UOUtility.Create(generatedName, gameObject); 64 | 65 | spline = GetComponentInParent(); 66 | spline.NodeListChanged += (s, e) => toUpdate = true; 67 | } 68 | 69 | private void Update() { 70 | if (toUpdate) { 71 | GenerateMesh(); 72 | toUpdate = false; 73 | } 74 | } 75 | 76 | private void GenerateMesh() { 77 | UOUtility.DestroyChildren(generated); 78 | 79 | int i = 0; 80 | float textureOffset = 0.0f; 81 | foreach (CubicBezierCurve curve in spline.GetCurves()) { 82 | GameObject go = UOUtility.Create("segment " + i++, 83 | generated, 84 | typeof(MeshFilter), 85 | typeof(MeshRenderer), 86 | typeof(ExtrusionSegment), 87 | typeof(MeshCollider)); 88 | go.GetComponent().material = material; 89 | ExtrusionSegment seg = go.GetComponent(); 90 | seg.ShapeVertices = shapeVertices; 91 | seg.TextureScale = textureScale; 92 | seg.TextureOffset = textureOffset; 93 | seg.SampleSpacing = sampleSpacing; 94 | seg.SetInterval(curve); 95 | 96 | textureOffset += curve.Length; 97 | } 98 | } 99 | 100 | public void SetToUpdate() { 101 | toUpdate = true; 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/SplineExtrusion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d1eb05ecfaa05444b40d40a2ea2268f 3 | timeCreated: 1499169609 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/SplineMeshTiling.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | #if UNITY_EDITOR 7 | using UnityEditor.Experimental.SceneManagement; 8 | #endif 9 | 10 | namespace SplineMesh { 11 | /// 12 | /// Deform a mesh and place it along a spline, given various parameters. 13 | /// 14 | /// This class intend to cover the most common situations of mesh bending. It can be used as-is in your project, 15 | /// or can serve as a source of inspiration to write your own procedural generator. 16 | /// 17 | [ExecuteInEditMode] 18 | [SelectionBase] 19 | [DisallowMultipleComponent] 20 | public class SplineMeshTiling : MonoBehaviour { 21 | private GameObject generated; 22 | private Spline spline = null; 23 | private bool toUpdate = false; 24 | 25 | [Tooltip("Mesh to bend along the spline.")] 26 | public Mesh mesh; 27 | [Tooltip("Material to apply on the bent mesh.")] 28 | public Material material; 29 | [Tooltip("Physic material to apply on the bent mesh.")] 30 | public PhysicMaterial physicMaterial; 31 | [Tooltip("Translation to apply on the mesh before bending it.")] 32 | public Vector3 translation; 33 | [Tooltip("Rotation to apply on the mesh before bending it.")] 34 | public Vector3 rotation; 35 | [Tooltip("Scale to apply on the mesh before bending it.")] 36 | public Vector3 scale = Vector3.one; 37 | 38 | [Tooltip("If true, a mesh collider will be generated.")] 39 | public bool generateCollider = true; 40 | 41 | [Tooltip("If true, the mesh will be bent on play mode. If false, the bent mesh will be kept from the editor mode, allowing lighting baking.")] 42 | public bool updateInPlayMode; 43 | 44 | [Tooltip("If true, a mesh will be placed on each curve of the spline. If false, a single mesh will be placed for the whole spline.")] 45 | public bool curveSpace = false; 46 | 47 | [Tooltip("The mode to use to fill the choosen interval with the bent mesh.")] 48 | public MeshBender.FillingMode mode = MeshBender.FillingMode.StretchToInterval; 49 | 50 | private void OnEnable() { 51 | // tip : if you name all generated content in the same way, you can easily find all of it 52 | // at once in the scene view, with a single search. 53 | string generatedName = "generated by " + GetType().Name; 54 | var generatedTranform = transform.Find(generatedName); 55 | generated = generatedTranform != null ? generatedTranform.gameObject : UOUtility.Create(generatedName, gameObject); 56 | 57 | spline = GetComponentInParent(); 58 | spline.NodeListChanged += (s, e) => toUpdate = true; 59 | 60 | toUpdate = true; 61 | } 62 | 63 | private void OnValidate() { 64 | if (spline == null) return; 65 | toUpdate = true; 66 | } 67 | 68 | private void Update() { 69 | // we can prevent the generated content to be updated during playmode to preserve baked data saved in the scene 70 | if (!updateInPlayMode && Application.isPlaying) return; 71 | 72 | if (toUpdate) { 73 | toUpdate = false; 74 | CreateMeshes(); 75 | } 76 | } 77 | 78 | public void CreateMeshes() { 79 | #if UNITY_EDITOR 80 | // we don't update if we are in prefab mode 81 | if (PrefabStageUtility.GetCurrentPrefabStage() != null) return; 82 | #endif 83 | var used = new List(); 84 | 85 | if (curveSpace) { 86 | int i = 0; 87 | foreach (var curve in spline.curves) { 88 | var go = FindOrCreate("segment " + i++ + " mesh"); 89 | go.GetComponent().SetInterval(curve); 90 | go.GetComponent().enabled = generateCollider; 91 | used.Add(go); 92 | } 93 | } else { 94 | var go = FindOrCreate("segment 1 mesh"); 95 | go.GetComponent().SetInterval(spline, 0); 96 | go.GetComponent().enabled = generateCollider; 97 | used.Add(go); 98 | } 99 | 100 | // we destroy the unused objects. This is classic pooling to recycle game objects. 101 | foreach (var go in generated.transform 102 | .Cast() 103 | .Select(child => child.gameObject).Except(used).ToList()) { 104 | UOUtility.Destroy(go); 105 | } 106 | } 107 | 108 | private GameObject FindOrCreate(string name) { 109 | var childTransform = generated.transform.Find(name); 110 | GameObject res; 111 | if (childTransform == null) { 112 | res = UOUtility.Create(name, 113 | generated, 114 | typeof(MeshFilter), 115 | typeof(MeshRenderer), 116 | typeof(MeshBender), 117 | typeof(MeshCollider)); 118 | res.isStatic = !updateInPlayMode; 119 | } else { 120 | res = childTransform.gameObject; 121 | } 122 | res.GetComponent().material = material; 123 | res.GetComponent().material = physicMaterial; 124 | MeshBender mb = res.GetComponent(); 125 | mb.Source = SourceMesh.Build(mesh) 126 | .Translate(translation) 127 | .Rotate(Quaternion.Euler(rotation)) 128 | .Scale(scale); 129 | mb.Mode = mode; 130 | return res; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/MeshProcessing/SplineMeshTiling.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 174367e175762fb48ba55d6171e99990 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42e70c99c5a7ff64db0ef5efafa2c82e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Utils/CameraUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace SplineMesh { 8 | public static class CameraUtility { 9 | public static bool IsOnScreen(Vector3 position) { 10 | Vector3 onScreen = Camera.current.WorldToViewportPoint(position); 11 | return onScreen.z > 0 && onScreen.x > 0 && onScreen.y > 0 && onScreen.x < 1 && onScreen.y < 1; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Utils/CameraUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a781badaa77fcbd409622fbddeeda765 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Utils/MeshUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace SplineMesh { 8 | public class MeshUtility { 9 | 10 | /// 11 | /// Returns a mesh with reserved triangles to turn back the face culling. 12 | /// This is usefull when a mesh needs to have a negative scale. 13 | /// 14 | /// 15 | /// 16 | public static int[] GetReversedTriangles(Mesh mesh) { 17 | var res = mesh.triangles.ToArray(); 18 | var triangleCount = res.Length / 3; 19 | for (var i = 0; i < triangleCount; i++) { 20 | var tmp = res[i * 3]; 21 | res[i * 3] = res[i * 3 + 1]; 22 | res[i * 3 + 1] = tmp; 23 | } 24 | return res; 25 | } 26 | 27 | /// 28 | /// Returns a mesh similar to the given source plus given optionnal parameters. 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// 34 | /// 35 | /// 36 | /// 37 | /// 38 | /// 39 | /// 40 | /// 41 | /// 42 | /// 43 | public static void Update(Mesh mesh, 44 | Mesh source, 45 | IEnumerable triangles = null, 46 | IEnumerable vertices = null, 47 | IEnumerable normals = null, 48 | IEnumerable uv = null, 49 | IEnumerable uv2 = null, 50 | IEnumerable uv3 = null, 51 | IEnumerable uv4 = null, 52 | IEnumerable uv5 = null, 53 | IEnumerable uv6 = null, 54 | IEnumerable uv7 = null, 55 | IEnumerable uv8 = null) { 56 | mesh.hideFlags = source.hideFlags; 57 | #if UNITY_2017_3_OR_NEWER 58 | mesh.indexFormat = source.indexFormat; 59 | #endif 60 | 61 | mesh.triangles = new int[0]; 62 | mesh.vertices = vertices == null ? source.vertices : vertices.ToArray(); 63 | mesh.normals = normals == null ? source.normals : normals.ToArray(); 64 | mesh.uv = uv == null? source.uv : uv.ToArray(); 65 | mesh.uv2 = uv2 == null ? source.uv2 : uv2.ToArray(); 66 | mesh.uv3 = uv3 == null ? source.uv3 : uv3.ToArray(); 67 | mesh.uv4 = uv4 == null ? source.uv4 : uv4.ToArray(); 68 | #if UNITY_2018_2_OR_NEWER 69 | mesh.uv5 = uv5 == null ? source.uv5 : uv5.ToArray(); 70 | mesh.uv6 = uv6 == null ? source.uv6 : uv6.ToArray(); 71 | mesh.uv7 = uv7 == null ? source.uv7 : uv7.ToArray(); 72 | mesh.uv8 = uv8 == null ? source.uv8 : uv8.ToArray(); 73 | #endif 74 | mesh.triangles = triangles == null ? source.triangles : triangles.ToArray(); 75 | mesh.RecalculateBounds(); 76 | mesh.RecalculateTangents(); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Utils/MeshUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c524c1f7e9141014aba14c56c6b1baad 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Utils/UOUtility.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Linq; 4 | using System; 5 | 6 | namespace SplineMesh { 7 | public static class UOUtility { 8 | public static GameObject Create(string name, GameObject parent, params Type[] components) { 9 | var res = new GameObject(name, components); 10 | res.transform.parent = parent.transform; 11 | res.transform.localPosition = Vector3.zero; 12 | res.transform.localScale = Vector3.one; 13 | res.transform.localRotation = Quaternion.identity; 14 | return res; 15 | } 16 | 17 | public static GameObject Instantiate(GameObject prefab, Transform parent) { 18 | var res = UnityEngine.Object.Instantiate(prefab, parent); 19 | res.transform.localPosition = Vector3.zero; 20 | res.transform.localRotation = Quaternion.identity; 21 | res.transform.localScale = Vector3.one; 22 | return res; 23 | } 24 | 25 | public static void Destroy(GameObject go) { 26 | if (Application.isPlaying) { 27 | UnityEngine.Object.Destroy(go); 28 | } else { 29 | UnityEngine.Object.DestroyImmediate(go); 30 | } 31 | } 32 | 33 | public static void Destroy(Component comp) { 34 | if (Application.isPlaying) { 35 | UnityEngine.Object.Destroy(comp); 36 | } else { 37 | UnityEngine.Object.DestroyImmediate(comp); 38 | } 39 | } 40 | 41 | public static void DestroyChildren(GameObject go) { 42 | var childList = go.transform.Cast().ToList(); 43 | foreach (Transform childTransform in childList) { 44 | Destroy(childTransform.gameObject); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Scripts/Utils/UOUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a4e07385171f27439dd485c6211462f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/SplineMesh/Showcase.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e717c5efb24aa349a1ed37e8978438b 3 | timeCreated: 1509734707 4 | licenseType: Free 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Benoît 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/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": "1.0.0", 4 | "com.unity.2d.tilemap": "1.0.0", 5 | "com.unity.ads": "3.5.2", 6 | "com.unity.analytics": "3.5.3", 7 | "com.unity.collab-proxy": "1.3.9", 8 | "com.unity.ext.nunit": "1.0.6", 9 | "com.unity.ide.rider": "3.0.5", 10 | "com.unity.ide.visualstudio": "2.0.7", 11 | "com.unity.ide.vscode": "1.2.3", 12 | "com.unity.multiplayer-hlapi": "1.0.6", 13 | "com.unity.purchasing": "3.0.1", 14 | "com.unity.test-framework": "1.1.22", 15 | "com.unity.textmeshpro": "3.0.4", 16 | "com.unity.timeline": "1.5.2", 17 | "com.unity.ugui": "1.0.0", 18 | "com.unity.xr.legacyinputhelpers": "2.1.7", 19 | "com.unity.modules.ai": "1.0.0", 20 | "com.unity.modules.androidjni": "1.0.0", 21 | "com.unity.modules.animation": "1.0.0", 22 | "com.unity.modules.assetbundle": "1.0.0", 23 | "com.unity.modules.audio": "1.0.0", 24 | "com.unity.modules.cloth": "1.0.0", 25 | "com.unity.modules.director": "1.0.0", 26 | "com.unity.modules.imageconversion": "1.0.0", 27 | "com.unity.modules.imgui": "1.0.0", 28 | "com.unity.modules.jsonserialize": "1.0.0", 29 | "com.unity.modules.particlesystem": "1.0.0", 30 | "com.unity.modules.physics": "1.0.0", 31 | "com.unity.modules.physics2d": "1.0.0", 32 | "com.unity.modules.screencapture": "1.0.0", 33 | "com.unity.modules.terrain": "1.0.0", 34 | "com.unity.modules.terrainphysics": "1.0.0", 35 | "com.unity.modules.tilemap": "1.0.0", 36 | "com.unity.modules.ui": "1.0.0", 37 | "com.unity.modules.uielements": "1.0.0", 38 | "com.unity.modules.umbra": "1.0.0", 39 | "com.unity.modules.unityanalytics": "1.0.0", 40 | "com.unity.modules.unitywebrequest": "1.0.0", 41 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 42 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 43 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 44 | "com.unity.modules.unitywebrequestwww": "1.0.0", 45 | "com.unity.modules.vehicles": "1.0.0", 46 | "com.unity.modules.video": "1.0.0", 47 | "com.unity.modules.vr": "1.0.0", 48 | "com.unity.modules.wind": "1.0.0", 49 | "com.unity.modules.xr": "1.0.0" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": { 4 | "version": "1.0.0", 5 | "depth": 0, 6 | "source": "builtin", 7 | "dependencies": {} 8 | }, 9 | "com.unity.2d.tilemap": { 10 | "version": "1.0.0", 11 | "depth": 0, 12 | "source": "builtin", 13 | "dependencies": {} 14 | }, 15 | "com.unity.ads": { 16 | "version": "3.5.2", 17 | "depth": 0, 18 | "source": "registry", 19 | "dependencies": { 20 | "com.unity.ugui": "1.0.0" 21 | }, 22 | "url": "https://packages.unity.com" 23 | }, 24 | "com.unity.analytics": { 25 | "version": "3.5.3", 26 | "depth": 0, 27 | "source": "registry", 28 | "dependencies": { 29 | "com.unity.ugui": "1.0.0" 30 | }, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.collab-proxy": { 34 | "version": "1.3.9", 35 | "depth": 0, 36 | "source": "registry", 37 | "dependencies": {}, 38 | "url": "https://packages.unity.com" 39 | }, 40 | "com.unity.ext.nunit": { 41 | "version": "1.0.6", 42 | "depth": 0, 43 | "source": "registry", 44 | "dependencies": {}, 45 | "url": "https://packages.unity.com" 46 | }, 47 | "com.unity.ide.rider": { 48 | "version": "3.0.5", 49 | "depth": 0, 50 | "source": "registry", 51 | "dependencies": {}, 52 | "url": "https://packages.unity.com" 53 | }, 54 | "com.unity.ide.visualstudio": { 55 | "version": "2.0.7", 56 | "depth": 0, 57 | "source": "registry", 58 | "dependencies": { 59 | "com.unity.test-framework": "1.1.9" 60 | }, 61 | "url": "https://packages.unity.com" 62 | }, 63 | "com.unity.ide.vscode": { 64 | "version": "1.2.3", 65 | "depth": 0, 66 | "source": "registry", 67 | "dependencies": {}, 68 | "url": "https://packages.unity.com" 69 | }, 70 | "com.unity.multiplayer-hlapi": { 71 | "version": "1.0.6", 72 | "depth": 0, 73 | "source": "registry", 74 | "dependencies": { 75 | "nuget.mono-cecil": "0.1.6-preview" 76 | }, 77 | "url": "https://packages.unity.com" 78 | }, 79 | "com.unity.purchasing": { 80 | "version": "3.0.1", 81 | "depth": 0, 82 | "source": "registry", 83 | "dependencies": { 84 | "com.unity.ugui": "1.0.0", 85 | "com.unity.modules.unityanalytics": "1.0.0", 86 | "com.unity.modules.unitywebrequest": "1.0.0", 87 | "com.unity.modules.jsonserialize": "1.0.0", 88 | "com.unity.modules.androidjni": "1.0.0" 89 | }, 90 | "url": "https://packages.unity.com" 91 | }, 92 | "com.unity.test-framework": { 93 | "version": "1.1.22", 94 | "depth": 0, 95 | "source": "registry", 96 | "dependencies": { 97 | "com.unity.ext.nunit": "1.0.6", 98 | "com.unity.modules.imgui": "1.0.0", 99 | "com.unity.modules.jsonserialize": "1.0.0" 100 | }, 101 | "url": "https://packages.unity.com" 102 | }, 103 | "com.unity.textmeshpro": { 104 | "version": "3.0.4", 105 | "depth": 0, 106 | "source": "registry", 107 | "dependencies": { 108 | "com.unity.ugui": "1.0.0" 109 | }, 110 | "url": "https://packages.unity.com" 111 | }, 112 | "com.unity.timeline": { 113 | "version": "1.5.2", 114 | "depth": 0, 115 | "source": "registry", 116 | "dependencies": { 117 | "com.unity.modules.director": "1.0.0", 118 | "com.unity.modules.animation": "1.0.0", 119 | "com.unity.modules.audio": "1.0.0", 120 | "com.unity.modules.particlesystem": "1.0.0" 121 | }, 122 | "url": "https://packages.unity.com" 123 | }, 124 | "com.unity.ugui": { 125 | "version": "1.0.0", 126 | "depth": 0, 127 | "source": "builtin", 128 | "dependencies": { 129 | "com.unity.modules.ui": "1.0.0", 130 | "com.unity.modules.imgui": "1.0.0" 131 | } 132 | }, 133 | "com.unity.xr.legacyinputhelpers": { 134 | "version": "2.1.7", 135 | "depth": 0, 136 | "source": "registry", 137 | "dependencies": { 138 | "com.unity.modules.vr": "1.0.0", 139 | "com.unity.modules.xr": "1.0.0" 140 | }, 141 | "url": "https://packages.unity.com" 142 | }, 143 | "nuget.mono-cecil": { 144 | "version": "0.1.6-preview", 145 | "depth": 1, 146 | "source": "registry", 147 | "dependencies": {}, 148 | "url": "https://packages.unity.com" 149 | }, 150 | "com.unity.modules.ai": { 151 | "version": "1.0.0", 152 | "depth": 0, 153 | "source": "builtin", 154 | "dependencies": {} 155 | }, 156 | "com.unity.modules.androidjni": { 157 | "version": "1.0.0", 158 | "depth": 0, 159 | "source": "builtin", 160 | "dependencies": {} 161 | }, 162 | "com.unity.modules.animation": { 163 | "version": "1.0.0", 164 | "depth": 0, 165 | "source": "builtin", 166 | "dependencies": {} 167 | }, 168 | "com.unity.modules.assetbundle": { 169 | "version": "1.0.0", 170 | "depth": 0, 171 | "source": "builtin", 172 | "dependencies": {} 173 | }, 174 | "com.unity.modules.audio": { 175 | "version": "1.0.0", 176 | "depth": 0, 177 | "source": "builtin", 178 | "dependencies": {} 179 | }, 180 | "com.unity.modules.cloth": { 181 | "version": "1.0.0", 182 | "depth": 0, 183 | "source": "builtin", 184 | "dependencies": { 185 | "com.unity.modules.physics": "1.0.0" 186 | } 187 | }, 188 | "com.unity.modules.director": { 189 | "version": "1.0.0", 190 | "depth": 0, 191 | "source": "builtin", 192 | "dependencies": { 193 | "com.unity.modules.audio": "1.0.0", 194 | "com.unity.modules.animation": "1.0.0" 195 | } 196 | }, 197 | "com.unity.modules.imageconversion": { 198 | "version": "1.0.0", 199 | "depth": 0, 200 | "source": "builtin", 201 | "dependencies": {} 202 | }, 203 | "com.unity.modules.imgui": { 204 | "version": "1.0.0", 205 | "depth": 0, 206 | "source": "builtin", 207 | "dependencies": {} 208 | }, 209 | "com.unity.modules.jsonserialize": { 210 | "version": "1.0.0", 211 | "depth": 0, 212 | "source": "builtin", 213 | "dependencies": {} 214 | }, 215 | "com.unity.modules.particlesystem": { 216 | "version": "1.0.0", 217 | "depth": 0, 218 | "source": "builtin", 219 | "dependencies": {} 220 | }, 221 | "com.unity.modules.physics": { 222 | "version": "1.0.0", 223 | "depth": 0, 224 | "source": "builtin", 225 | "dependencies": {} 226 | }, 227 | "com.unity.modules.physics2d": { 228 | "version": "1.0.0", 229 | "depth": 0, 230 | "source": "builtin", 231 | "dependencies": {} 232 | }, 233 | "com.unity.modules.screencapture": { 234 | "version": "1.0.0", 235 | "depth": 0, 236 | "source": "builtin", 237 | "dependencies": { 238 | "com.unity.modules.imageconversion": "1.0.0" 239 | } 240 | }, 241 | "com.unity.modules.subsystems": { 242 | "version": "1.0.0", 243 | "depth": 1, 244 | "source": "builtin", 245 | "dependencies": { 246 | "com.unity.modules.jsonserialize": "1.0.0" 247 | } 248 | }, 249 | "com.unity.modules.terrain": { 250 | "version": "1.0.0", 251 | "depth": 0, 252 | "source": "builtin", 253 | "dependencies": {} 254 | }, 255 | "com.unity.modules.terrainphysics": { 256 | "version": "1.0.0", 257 | "depth": 0, 258 | "source": "builtin", 259 | "dependencies": { 260 | "com.unity.modules.physics": "1.0.0", 261 | "com.unity.modules.terrain": "1.0.0" 262 | } 263 | }, 264 | "com.unity.modules.tilemap": { 265 | "version": "1.0.0", 266 | "depth": 0, 267 | "source": "builtin", 268 | "dependencies": { 269 | "com.unity.modules.physics2d": "1.0.0" 270 | } 271 | }, 272 | "com.unity.modules.ui": { 273 | "version": "1.0.0", 274 | "depth": 0, 275 | "source": "builtin", 276 | "dependencies": {} 277 | }, 278 | "com.unity.modules.uielements": { 279 | "version": "1.0.0", 280 | "depth": 0, 281 | "source": "builtin", 282 | "dependencies": { 283 | "com.unity.modules.ui": "1.0.0", 284 | "com.unity.modules.imgui": "1.0.0", 285 | "com.unity.modules.jsonserialize": "1.0.0", 286 | "com.unity.modules.uielementsnative": "1.0.0" 287 | } 288 | }, 289 | "com.unity.modules.uielementsnative": { 290 | "version": "1.0.0", 291 | "depth": 1, 292 | "source": "builtin", 293 | "dependencies": { 294 | "com.unity.modules.ui": "1.0.0", 295 | "com.unity.modules.imgui": "1.0.0", 296 | "com.unity.modules.jsonserialize": "1.0.0" 297 | } 298 | }, 299 | "com.unity.modules.umbra": { 300 | "version": "1.0.0", 301 | "depth": 0, 302 | "source": "builtin", 303 | "dependencies": {} 304 | }, 305 | "com.unity.modules.unityanalytics": { 306 | "version": "1.0.0", 307 | "depth": 0, 308 | "source": "builtin", 309 | "dependencies": { 310 | "com.unity.modules.unitywebrequest": "1.0.0", 311 | "com.unity.modules.jsonserialize": "1.0.0" 312 | } 313 | }, 314 | "com.unity.modules.unitywebrequest": { 315 | "version": "1.0.0", 316 | "depth": 0, 317 | "source": "builtin", 318 | "dependencies": {} 319 | }, 320 | "com.unity.modules.unitywebrequestassetbundle": { 321 | "version": "1.0.0", 322 | "depth": 0, 323 | "source": "builtin", 324 | "dependencies": { 325 | "com.unity.modules.assetbundle": "1.0.0", 326 | "com.unity.modules.unitywebrequest": "1.0.0" 327 | } 328 | }, 329 | "com.unity.modules.unitywebrequestaudio": { 330 | "version": "1.0.0", 331 | "depth": 0, 332 | "source": "builtin", 333 | "dependencies": { 334 | "com.unity.modules.unitywebrequest": "1.0.0", 335 | "com.unity.modules.audio": "1.0.0" 336 | } 337 | }, 338 | "com.unity.modules.unitywebrequesttexture": { 339 | "version": "1.0.0", 340 | "depth": 0, 341 | "source": "builtin", 342 | "dependencies": { 343 | "com.unity.modules.unitywebrequest": "1.0.0", 344 | "com.unity.modules.imageconversion": "1.0.0" 345 | } 346 | }, 347 | "com.unity.modules.unitywebrequestwww": { 348 | "version": "1.0.0", 349 | "depth": 0, 350 | "source": "builtin", 351 | "dependencies": { 352 | "com.unity.modules.unitywebrequest": "1.0.0", 353 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 354 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 355 | "com.unity.modules.audio": "1.0.0", 356 | "com.unity.modules.assetbundle": "1.0.0", 357 | "com.unity.modules.imageconversion": "1.0.0" 358 | } 359 | }, 360 | "com.unity.modules.vehicles": { 361 | "version": "1.0.0", 362 | "depth": 0, 363 | "source": "builtin", 364 | "dependencies": { 365 | "com.unity.modules.physics": "1.0.0" 366 | } 367 | }, 368 | "com.unity.modules.video": { 369 | "version": "1.0.0", 370 | "depth": 0, 371 | "source": "builtin", 372 | "dependencies": { 373 | "com.unity.modules.audio": "1.0.0", 374 | "com.unity.modules.ui": "1.0.0", 375 | "com.unity.modules.unitywebrequest": "1.0.0" 376 | } 377 | }, 378 | "com.unity.modules.vr": { 379 | "version": "1.0.0", 380 | "depth": 0, 381 | "source": "builtin", 382 | "dependencies": { 383 | "com.unity.modules.jsonserialize": "1.0.0", 384 | "com.unity.modules.physics": "1.0.0", 385 | "com.unity.modules.xr": "1.0.0" 386 | } 387 | }, 388 | "com.unity.modules.wind": { 389 | "version": "1.0.0", 390 | "depth": 0, 391 | "source": "builtin", 392 | "dependencies": {} 393 | }, 394 | "com.unity.modules.xr": { 395 | "version": "1.0.0", 396 | "depth": 0, 397 | "source": "builtin", 398 | "dependencies": { 399 | "com.unity.modules.physics": "1.0.0", 400 | "com.unity.modules.jsonserialize": "1.0.0", 401 | "com.unity.modules.subsystems": "1.0.0" 402 | } 403 | } 404 | } 405 | } 406 | -------------------------------------------------------------------------------- /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 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: 3 7 | m_Gravity: {x: 0, y: -9.81, 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_EnablePCM: 1 18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 19 | m_AutoSimulation: 1 20 | m_AutoSyncTransforms: 1 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: 5 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_DefaultBehaviorMode: 0 10 | m_SpritePackerMode: 0 11 | m_SpritePackerPaddingPower: 1 12 | m_EtcTextureCompressorBehavior: 1 13 | m_EtcTextureFastCompressor: 1 14 | m_EtcTextureNormalCompressor: 2 15 | m_EtcTextureBestCompressor: 4 16 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 17 | m_ProjectGenerationRootNamespace: 18 | m_UserGeneratedProjectSuffix: 19 | m_CollabEditorSettings: 20 | inProgressEnabled: 1 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_ErrorMessage: 32 | m_Original: 33 | m_Id: 34 | m_Name: 35 | m_Url: 36 | m_Scopes: [] 37 | m_IsDefault: 0 38 | m_Capabilities: 0 39 | m_Modified: 0 40 | m_Name: 41 | m_Url: 42 | m_Scopes: 43 | - 44 | m_SelectedScopeIndex: 0 45 | m_LoadAssets: 0 46 | -------------------------------------------------------------------------------- /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: 3 7 | m_Gravity: {x: 0, y: -9.81} 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_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.1.0f1 2 | m_EditorVersionWithRevision: 2021.1.0f1 (61a549675243) 3 | -------------------------------------------------------------------------------- /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 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 0 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 70 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 2 136 | antiAliasing: 2 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 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: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSM: 5 183 | PSP2: 2 184 | Samsung TV: 2 185 | Standalone: 5 186 | Tizen: 2 187 | WebGL: 3 188 | WiiU: 5 189 | Windows Store Apps: 5 190 | XboxOne: 5 191 | iPhone: 2 192 | tvOS: 2 193 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 1 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![please report broken links](https://s9.postimg.cc/5rf3y5lxr/bandeau_github.png) 2 | 3 | **Follow me on twitter !** 4 | 5 | **Watch SplineMesh in action** 6 | 7 | # What is SplineMesh? 8 | 9 | Inspired by Unreal Engine 4 spline component, SplineMesh is a Unity 3D plugin that allows you to create curved content: 10 | - Generalistic spline component 11 | - Mesh bending along spline 12 | - 2D shape extrusion along spline 13 | - Easy-to-use editor 14 | - Complete mathematical Bézier curves 15 | - Strong real-time performances 16 | 17 | > If you like SplineMesh **please** take some time to vote for the [asset on the store](https://assetstore.unity.com/packages/tools/modeling/splinemesh-104989), it helps a lot ! Reviews are much appreciated too. 18 | 19 | ## How to use it? 20 | Get the asset on the Asset Store [here](https://assetstore.unity.com/packages/tools/modeling/splinemesh-104989). It includes doc, comments and a complete showcase with exemples in action for your convienence. 21 | 22 | Don't hesitate to contact the author via the store or github issue page. 23 | 24 | ## How to contribute? 25 | SplineMesh is free and open-source. You can support the author by buying [the paid version](https://assetstore.unity.com/packages/tools/modeling/splinemesh-paid-version-104998), which contains no additional feature. 26 | 27 | You can also contribute to the code itself by sending code, pull request or your own exemple components, the author will be glad to include your work on the store. 28 | 29 | ![please report broken links](https://s9.postimg.cc/mf6m0obkf/Showcase.png) 30 | 31 | ![please report broken links](https://s9.postimg.cc/foq4r9bjz/Road.png) 32 | -------------------------------------------------------------------------------- /UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | vcSharedLogLevel: 9 | value: 0d5e400f0650 10 | flags: 0 11 | m_VCAutomaticAdd: 1 12 | m_VCDebugCom: 0 13 | m_VCDebugCmd: 0 14 | m_VCDebugOut: 0 15 | m_SemanticMergeMode: 2 16 | m_VCShowFailedCheckout: 1 17 | m_VCOverwriteFailedCheckoutAssets: 1 18 | m_VCOverlayIcons: 1 19 | m_VCAllowAsyncUpdate: 0 20 | --------------------------------------------------------------------------------