├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── ci.yml ├── .gitignore ├── .releaserc.json ├── Assets ├── Mesh Tilesets.meta └── Mesh Tilesets │ ├── CHANGELOG.md │ ├── CHANGELOG.md.meta │ ├── Editor.meta │ ├── Editor │ ├── SceneOverlayWindow.cs │ ├── SceneOverlayWindow.cs.meta │ ├── SerializedProperyExtension.cs │ ├── SerializedProperyExtension.cs.meta │ ├── TagExtensionPropertyDrawer.cs │ ├── TagExtensionPropertyDrawer.cs.meta │ ├── TileEditor.cs │ ├── TileEditor.cs.meta │ ├── TilesetEditor.cs │ ├── TilesetEditor.cs.meta │ ├── TilesetFlagsMaskDrawer.cs │ ├── TilesetFlagsMaskDrawer.cs.meta │ ├── TilesetRendererEditor.cs │ ├── TilesetRendererEditor.cs.meta │ ├── TilesetRendererScenePostProcessor.cs │ ├── TilesetRendererScenePostProcessor.cs.meta │ ├── com.freshlybrewedcode.MeshTilesetsEditor.asmdef │ └── com.freshlybrewedcode.MeshTilesetsEditor.asmdef.meta │ ├── Runtime.meta │ ├── Runtime │ ├── TagExtension.cs │ ├── TagExtension.cs.meta │ ├── Tile.cs │ ├── Tile.cs.meta │ ├── TileHideGroup.cs │ ├── TileHideGroup.cs.meta │ ├── TileInstance.cs │ ├── TileInstance.cs.meta │ ├── TilePool.cs │ ├── TilePool.cs.meta │ ├── Tileset.cs │ ├── Tileset.cs.meta │ ├── TilesetRenderer.cs │ ├── TilesetRenderer.cs.meta │ ├── UtilityAttributeDrawers.cs │ ├── UtilityAttributeDrawers.cs.meta │ ├── com.freshlybrewedcode.MeshTilesets.asmdef │ └── com.freshlybrewedcode.MeshTilesets.asmdef.meta │ ├── Samples.meta │ ├── Samples │ ├── Models.meta │ ├── Models │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── Metal.mat │ │ │ └── Metal.mat.meta │ │ ├── building_kit.fbx │ │ ├── building_kit.fbx.meta │ │ ├── catwalk_kit.fbx │ │ ├── catwalk_kit.fbx.meta │ │ ├── duct_kit.fbx │ │ ├── duct_kit.fbx.meta │ │ ├── pipe_kit.fbx │ │ ├── pipe_kit.fbx.meta │ │ ├── railing_kit.fbx │ │ └── railing_kit.fbx.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── SampleScene.meta │ │ ├── SampleScene.unity │ │ ├── SampleScene.unity.meta │ │ ├── SampleScene │ │ │ ├── LightingData.asset │ │ │ ├── LightingData.asset.meta │ │ │ ├── Lightmap-0_comp_dir.png │ │ │ ├── Lightmap-0_comp_dir.png.meta │ │ │ ├── Lightmap-0_comp_light.exr │ │ │ ├── Lightmap-0_comp_light.exr.meta │ │ │ ├── Lightmap-0_comp_shadowmask.png │ │ │ ├── Lightmap-0_comp_shadowmask.png.meta │ │ │ ├── Lightmap-1_comp_dir.png │ │ │ ├── Lightmap-1_comp_dir.png.meta │ │ │ ├── Lightmap-1_comp_light.exr │ │ │ ├── Lightmap-1_comp_light.exr.meta │ │ │ ├── Lightmap-1_comp_shadowmask.png │ │ │ ├── Lightmap-1_comp_shadowmask.png.meta │ │ │ ├── Lightmap-2_comp_dir.png │ │ │ ├── Lightmap-2_comp_dir.png.meta │ │ │ ├── Lightmap-2_comp_light.exr │ │ │ ├── Lightmap-2_comp_light.exr.meta │ │ │ ├── Lightmap-2_comp_shadowmask.png │ │ │ ├── Lightmap-2_comp_shadowmask.png.meta │ │ │ ├── ReflectionProbe-0.exr │ │ │ └── ReflectionProbe-0.exr.meta │ │ ├── SampleSceneSettings.lighting │ │ ├── SampleSceneSettings.lighting.meta │ │ ├── SampleScene_Profiles.meta │ │ └── SampleScene_Profiles │ │ │ ├── Post-process Volume Profile.asset │ │ │ └── Post-process Volume Profile.asset.meta │ ├── Tilesets.meta │ └── Tilesets │ │ ├── Duct_Tileset.prefab │ │ ├── Duct_Tileset.prefab.meta │ │ ├── Pipe_Tileset.prefab │ │ ├── Pipe_Tileset.prefab.meta │ │ ├── Railing_Tileset.prefab │ │ ├── Railing_Tileset.prefab.meta │ │ ├── building_kitTileset.prefab │ │ ├── building_kitTileset.prefab.meta │ │ ├── catwalk_kitTileset.prefab │ │ └── catwalk_kitTileset.prefab.meta │ ├── package.json │ └── package.json.meta ├── Docs ├── Components.md ├── Media │ ├── building_example.png │ ├── catwalk_example.png │ ├── duct_example.png │ ├── pipe_tileset.png │ ├── pipes_example.png │ ├── railing_example.png │ ├── rectangular_quads.png │ ├── showcase.gif │ ├── simple_pipe.png │ └── tileset_renderer.png └── README.md ├── 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 ├── Packages │ ├── com.unity.polybrush │ │ └── Settings.json │ ├── com.unity.probuilder │ │ └── Settings.json │ ├── com.unity.progrids │ │ └── Settings.json │ └── com.unity.settings-manager │ │ └── Settings.json ├── 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 /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report unexpected behavior or exceptions 4 | title: "[Bug]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Description** 11 | A clear and concise description of what the bug is. 12 | Include steps to reproduce if possible. 13 | 14 | **Error Log/Screenshots** 15 | ``` 16 | Paste errors/exceptions from the console here 17 | ``` 18 | 19 | **Version** 20 | Unity: 20XX.X 21 | Mesh Tilesets: 1.X.X 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[Feature]" 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Related problem** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Description** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Alternatives** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | release: 8 | if: "!contains(github.event.head_commit.message, 'skip ci')" 9 | name: Release 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | with: 14 | fetch-depth: 0 15 | 16 | - name: Semantic Release 17 | id: semantic 18 | uses: cycjimmy/semantic-release-action@v2.1.3 19 | with: 20 | extra_plugins: | 21 | @semantic-release/changelog 22 | @semantic-release/git 23 | branch: master 24 | env: 25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 26 | 27 | - name: Create UPM branch 28 | run: | 29 | git branch -d upm &> /dev/null || echo upm branch not found 30 | git subtree split -P "$PKG_ROOT" -b upm 31 | git checkout upm 32 | if [[ -d "Samples" ]]; then 33 | git mv Samples Samples~ 34 | rm -f Samples.meta 35 | git config --global user.name 'github-bot' 36 | git config --global user.email 'github-bot@users.noreply.github.com' 37 | git commit -am "fix: Samples => Samples~" 38 | fi 39 | git push -f -u origin upm 40 | env: 41 | PKG_ROOT: "Assets/Mesh Tilesets" 42 | 43 | - name: Create UPM git tag 44 | if: steps.semantic.outputs.new_release_published == 'true' 45 | run: | 46 | git tag $TAG upm 47 | git push origin --tags 48 | env: 49 | TAG: upm/v${{ steps.semantic.outputs.new_release_version }} 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Asset meta data should only be ignored when the corresponding asset is also ignored 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | .idea/ 25 | 26 | # Gradle cache directory 27 | .gradle/ 28 | 29 | # Autogenerated VS/MD/Consulo solution and project files 30 | ExportedObj/ 31 | .consulo/ 32 | *.csproj 33 | *.unityproj 34 | *.sln 35 | *.suo 36 | *.tmp 37 | *.user 38 | *.userprefs 39 | *.pidb 40 | *.booproj 41 | *.svd 42 | *.pdb 43 | *.mdb 44 | *.opendb 45 | *.VC.db 46 | *.DotSettings 47 | 48 | # Unity3D generated meta files 49 | *.pidb.meta 50 | *.pdb.meta 51 | *.mdb.meta 52 | 53 | # Unity3D generated file on crash reports 54 | sysinfo.txt 55 | 56 | # Builds 57 | *.apk 58 | *.unitypackage 59 | 60 | # Crashlytics generated file 61 | crashlytics-build.properties 62 | 63 | -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "tagFormat": "v${version}", 3 | "plugins": [ 4 | ["@semantic-release/commit-analyzer", { 5 | "preset": "angular" 6 | }], 7 | "@semantic-release/release-notes-generator", 8 | ["@semantic-release/changelog", { 9 | "preset": "angular", 10 | "changelogFile": "Assets/Mesh Tilesets/CHANGELOG.md" 11 | }], 12 | ["@semantic-release/npm", { 13 | "npmPublish": false, 14 | "pkgRoot": "Assets/Mesh Tilesets" 15 | }], 16 | ["@semantic-release/git", { 17 | "assets": ["Assets/Mesh Tilesets/package.json", "Assets/Mesh Tilesets/CHANGELOG.md"], 18 | "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" 19 | }], 20 | "@semantic-release/github" 21 | ] 22 | } -------------------------------------------------------------------------------- /Assets/Mesh Tilesets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35098111e6e704040853fb8ad0b901bb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.4](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/compare/v1.0.3...v1.0.4) (2021-01-23) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * adjust reflection code in `SceneOverlayWindow` for Unity 2019 ([8cff072](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/commit/8cff0721a7c317a142d5f440c2237afc264c2349)), closes [#2](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/issues/2) 7 | * fix incorrect height for first flag in `TilesetFlagsMaskDrawer` ([5939246](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/commit/59392468e1ed3728a0a2a5731e18ccc085aab08f)) 8 | * Unity 2020 code for `SceneOverlayWindow` ([6194578](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/commit/61945783f428a3f860b469c5031ec35edc2dbc16)) 9 | 10 | ## [1.0.3](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/compare/v1.0.2...v1.0.3) (2021-01-02) 11 | 12 | 13 | ### Bug Fixes 14 | 15 | * fix material of pipe kit ([1f83984](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/commit/1f83984e811ffb1c9cd7a9d3eb83c9164db8e934)) 16 | * remove GUILayout calls from `TilesetFlagsMaskDrawer` ([4705437](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/commit/4705437011143207ddd4673b09af876ff15c48a8)) 17 | 18 | ## [1.0.2](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/compare/v1.0.1...v1.0.2) (2021-01-02) 19 | 20 | 21 | ### Bug Fixes 22 | 23 | * add assembly definitions ([ab3c64f](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/commit/ab3c64f4a41a12cd5d252d36eec113997e4c84cd)) 24 | 25 | ## [1.0.1](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/compare/v1.0.0...v1.0.1) (2021-01-02) 26 | 27 | 28 | ### Bug Fixes 29 | 30 | * add samples to `package.json` ([467346e](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/commit/467346e8cad9e7af27bdf8961cf7d2dc72461e9f)) 31 | 32 | # 1.0.0 (2021-01-01) 33 | 34 | 35 | ### Features 36 | 37 | * initial release ([5439344](https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/commit/543934476792a0fc139d07e70d8c643160e2500d)) 38 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af1588fe1a21c114aa2f5e22a178c6ba 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee7ec6d40b1a38742ad1dc8bbd9ce622 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/SceneOverlayWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reflection; 4 | using UnityEditor; 5 | using UnityEngine; 6 | 7 | namespace MeshTilesetsEditor 8 | { 9 | public class SceneOverlayWindow 10 | { 11 | public delegate void WindowFunction(SceneView sceneView); 12 | 13 | private object sceneOverlayWindow; 14 | private MethodInfo windowMethod; 15 | private object[] windowMethodParams; 16 | public UnityEngine.Object target; 17 | 18 | // public delegate void ShowWindowFunc(object overlayWindow); 19 | public delegate void OnWindowGUICallback(UnityEngine.Object target, SceneView sceneView); 20 | 21 | public SceneOverlayWindow(GUIContent title, OnWindowGUICallback onWindowGUI, UnityEngine.Object target, int priority = int.MaxValue) 22 | { 23 | this.target = target; 24 | var unityEditor = Assembly.GetAssembly(typeof(UnityEditor.SceneView)); 25 | 26 | // Credit to @LogicalError for the Unity 2019 code path 27 | // (Original: https://github.com/RadicalCSG/Chisel.Prototype/blob/master/Packages/com.chisel.editor/Chisel/Editor/Editor/Scene/Overlays/ChiselOverlay.cs) 28 | #if UNITY_2019_3 || UNITY_2019_4 29 | var overlayWindowType = unityEditor.GetType("UnityEditor.SceneViewOverlay+OverlayWindow"); 30 | #elif UNITY_2020_1_OR_NEWER 31 | var overlayWindowType = unityEditor.GetType("UnityEditor.OverlayWindow"); 32 | #endif 33 | var sceneViewOverlayType = unityEditor.GetType("UnityEditor.SceneViewOverlay"); 34 | var windowFuncType = sceneViewOverlayType.GetNestedType("WindowFunction"); 35 | var sceneViewFuncDelegate = Delegate.CreateDelegate(windowFuncType, onWindowGUI.Target, onWindowGUI.Method); 36 | 37 | var windowDisplayOptionType = sceneViewOverlayType.GetNestedType("WindowDisplayOption"); 38 | var windowDisplayOption = Enum.Parse(windowDisplayOptionType, "OneWindowPerTarget"); 39 | 40 | #if UNITY_2019_3 || UNITY_2019_4 41 | windowMethod = sceneViewOverlayType.GetMethods(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public).FirstOrDefault(t => t.Name == "Window" && t.GetParameters().Length == 6); 42 | windowMethodParams = new object[] 43 | { 44 | title, sceneViewFuncDelegate, priority, target, windowDisplayOption, null 45 | }; 46 | #elif UNITY_2020_1_OR_NEWER 47 | //public static void ShowWindow(OverlayWindow window) 48 | windowMethod = sceneViewOverlayType.GetMethod("ShowWindow", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public); 49 | 50 | //public OverlayWindow(GUIContent title, SceneViewOverlay.WindowFunction guiFunction, int primaryOrder, Object target, SceneViewOverlay.WindowDisplayOption option) 51 | sceneOverlayWindow = Activator.CreateInstance(overlayWindowType, 52 | title, 53 | sceneViewFuncDelegate, 54 | int.MaxValue, this.target, 55 | windowDisplayOption //SceneViewOverlay.WindowDisplayOption.OneWindowPerTarget 56 | ); 57 | windowMethodParams = new object[] { sceneOverlayWindow }; 58 | #endif 59 | } 60 | 61 | public void ShowWindow() 62 | { 63 | if (windowMethod != null) 64 | windowMethod.Invoke(null, windowMethodParams); 65 | } 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/SceneOverlayWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2cde8a0c6e2ba2498a71047d108df25 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/SerializedProperyExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Linq; 3 | using System.Reflection; 4 | using System.Text.RegularExpressions; 5 | using UnityEditor; 6 | 7 | // Credit: https://gist.github.com/douduck08/6d3e323b538a741466de00c30aa4b61f 8 | namespace MeshTilesetsEditor 9 | { 10 | public static class SerializedPropertyExtensions { 11 | 12 | public static T GetValue (this SerializedProperty property) where T : class { 13 | object obj = property.serializedObject.targetObject; 14 | string path = property.propertyPath.Replace (".Array.data", ""); 15 | string[] fieldStructure = path.Split ('.'); 16 | Regex rgx = new Regex (@"\[\d+\]"); 17 | for (int i = 0; i < fieldStructure.Length; i++) { 18 | if (fieldStructure[i].Contains ("[")) { 19 | int index = System.Convert.ToInt32 (new string (fieldStructure[i].Where (c => char.IsDigit (c)).ToArray ())); 20 | obj = GetFieldValueWithIndex (rgx.Replace (fieldStructure[i], ""), obj, index); 21 | } else { 22 | obj = GetFieldValue (fieldStructure[i], obj); 23 | } 24 | } 25 | return (T) obj; 26 | } 27 | 28 | public static bool SetValue (this SerializedProperty property, T value) where T : class { 29 | object obj = property.serializedObject.targetObject; 30 | string path = property.propertyPath.Replace (".Array.data", ""); 31 | string[] fieldStructure = path.Split ('.'); 32 | Regex rgx = new Regex (@"\[\d+\]"); 33 | for (int i = 0; i < fieldStructure.Length - 1; i++) { 34 | if (fieldStructure[i].Contains ("[")) { 35 | int index = System.Convert.ToInt32 (new string (fieldStructure[i].Where (c => char.IsDigit (c)).ToArray ())); 36 | obj = GetFieldValueWithIndex (rgx.Replace (fieldStructure[i], ""), obj, index); 37 | } else { 38 | obj = GetFieldValue (fieldStructure[i], obj); 39 | } 40 | } 41 | 42 | string fieldName = fieldStructure.Last (); 43 | if (fieldName.Contains ("[")) { 44 | int index = System.Convert.ToInt32 (new string (fieldName.Where (c => char.IsDigit (c)).ToArray ())); 45 | return SetFieldValueWithIndex (rgx.Replace (fieldName, ""), obj, index, value); 46 | } else { 47 | return SetFieldValue (fieldName, obj, value); 48 | } 49 | } 50 | 51 | private static object GetFieldValue (string fieldName, object obj, BindingFlags bindings = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) { 52 | FieldInfo field = obj.GetType ().GetField (fieldName, bindings); 53 | if (field != null) { 54 | return field.GetValue (obj); 55 | } 56 | return default (object); 57 | } 58 | 59 | private static object GetFieldValueWithIndex (string fieldName, object obj, int index, BindingFlags bindings = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) { 60 | FieldInfo field = obj.GetType ().GetField (fieldName, bindings); 61 | if (field != null) { 62 | object list = field.GetValue (obj); 63 | if (list.GetType ().IsArray) { 64 | return ((object[]) list)[index]; 65 | } else if (list is IEnumerable) { 66 | return ((IList) list)[index]; 67 | } 68 | } 69 | return default (object); 70 | } 71 | 72 | public static bool SetFieldValue (string fieldName, object obj, object value, bool includeAllBases = false, BindingFlags bindings = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) { 73 | FieldInfo field = obj.GetType ().GetField (fieldName, bindings); 74 | if (field != null) { 75 | field.SetValue (obj, value); 76 | return true; 77 | } 78 | return false; 79 | } 80 | 81 | public static bool SetFieldValueWithIndex (string fieldName, object obj, int index, object value, bool includeAllBases = false, BindingFlags bindings = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) { 82 | FieldInfo field = obj.GetType ().GetField (fieldName, bindings); 83 | if (field != null) { 84 | object list = field.GetValue (obj); 85 | if (list.GetType ().IsArray) { 86 | ((object[]) list)[index] = value; 87 | return true; 88 | } else if (value is IEnumerable) { 89 | ((IList) list)[index] = value; 90 | return true; 91 | } 92 | } 93 | return false; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/SerializedProperyExtension.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2ccdacaf6548d44fae0a75ced0ffdc4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TagExtensionPropertyDrawer.cs: -------------------------------------------------------------------------------- 1 | using MeshTilesets; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace MeshTilesetsEditor 6 | { 7 | [CustomPropertyDrawer(typeof(Tag))] 8 | public class TagExtensionPropertyDrawer : PropertyDrawer 9 | { 10 | public override void OnGUI(Rect position, SerializedProperty property, 11 | GUIContent label) 12 | { 13 | EditorGUI.BeginProperty(position, label, property); 14 | 15 | var tagName = property.FindPropertyRelative("tagName"); 16 | tagName.stringValue = EditorGUI.TagField(position, label, tagName.stringValue); 17 | 18 | EditorGUI.EndProperty(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TagExtensionPropertyDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 092394dfa1614b5fa8751ae12161a017 3 | timeCreated: 1599949971 -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TileEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MeshTilesets; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace MeshTilesetsEditor 7 | { 8 | [CanEditMultipleObjects] 9 | [CustomEditor(typeof(Tile))] 10 | public class TileEditor : Editor 11 | { 12 | private Tile Target => target as Tile; 13 | private Tile[] Targets => targets as Tile[]; 14 | private bool tilesetFlagsFoldout = false; 15 | 16 | private bool utilityFoldout; 17 | 18 | public override void OnInspectorGUI() 19 | { 20 | if (!Target.Tileset) 21 | { 22 | Tileset targetTileset = Target.transform.parent ? Target.transform.parent.GetComponent() : null; 23 | if (!targetTileset) 24 | { 25 | EditorGUILayout.HelpBox("A Tileset component is required on the parent object.", MessageType.Warning); 26 | return; 27 | } 28 | 29 | Target.Tileset = targetTileset; 30 | } 31 | 32 | base.OnInspectorGUI(); 33 | TilesetFlagsMaskDrawer.DrawTilesetFlagsMask(new GUIContent("Tileset Flags"), Target.tilesetFlags, Target.Tileset, ref tilesetFlagsFoldout); 34 | if(GUI.changed) EditorUtility.SetDirty(Target); 35 | 36 | utilityFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(utilityFoldout, "Utilities"); 37 | if (utilityFoldout) 38 | { 39 | if (GUILayout.Button("Size from bounds")) DoAll(t => t.SetBoundsFromChildren()); 40 | GUILayout.BeginHorizontal(); 41 | if(GUILayout.Button("Rotate X")) DoAll(t => t.RotateWithoutChildren(Quaternion.Euler(new Vector3(90, 0, 0)))); 42 | if(GUILayout.Button("Rotate Y")) DoAll(t => t.RotateWithoutChildren(Quaternion.Euler(new Vector3(0, 90, 0)))); 43 | if(GUILayout.Button("Rotate Z")) DoAll(t => t.RotateWithoutChildren(Quaternion.Euler(new Vector3(0, 0, 90)))); 44 | GUILayout.EndHorizontal(); 45 | } 46 | EditorGUILayout.EndFoldoutHeaderGroup(); 47 | } 48 | 49 | private void DoAll(Action operation) 50 | { 51 | foreach (var t in targets) 52 | { 53 | operation(t as Tile); 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TileEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29dfe8c9e15ec8f40b897f840ce5b8ff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TilesetEditor.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Linq; 3 | using MeshTilesets; 4 | using UnityEditor; 5 | using UnityEditorInternal; 6 | using UnityEngine; 7 | 8 | namespace MeshTilesetsEditor 9 | { 10 | [CustomEditor(typeof(Tileset))] 11 | public class TilesetEditor : Editor 12 | { 13 | private Tileset Target => target as Tileset; 14 | private ReorderableList tileList; 15 | 16 | private bool utilityFoldout; 17 | 18 | private void OnEnable() 19 | { 20 | // Setup tile list 21 | var tiles = serializedObject.FindProperty("tiles"); 22 | tileList = new ReorderableList(serializedObject, tiles); 23 | tileList.drawHeaderCallback = rect => GUI.Label(rect, "Tiles"); 24 | tileList.drawElementCallback = DrawTileListElement; 25 | tileList.onAddCallback = list => 26 | { 27 | var index = list.serializedProperty.arraySize; 28 | list.serializedProperty.arraySize++; 29 | list.serializedProperty.GetArrayElementAtIndex(index).objectReferenceValue = null; 30 | }; 31 | tileList.onRemoveCallback = list => 32 | { 33 | // We have to call delete twice to get rid of the element if a tile is assigned 34 | if(list.serializedProperty.GetArrayElementAtIndex(list.index).objectReferenceValue != null) 35 | list.serializedProperty.DeleteArrayElementAtIndex(list.index); 36 | list.serializedProperty.DeleteArrayElementAtIndex(list.index); 37 | }; 38 | } 39 | 40 | private void DrawTileListElement(Rect rect, int i, bool isactive, bool isfocused) 41 | { 42 | var prop = tileList.serializedProperty.GetArrayElementAtIndex(i); 43 | // GUI.enabled = tileList.list[i] == null; 44 | GUI.enabled = prop.objectReferenceValue == null; 45 | // tileList.list[i] = (Tile) EditorGUI.ObjectField(rect.Padding(1f, 2f), tileList.list[i] as Tile, typeof(Tile), true); 46 | EditorGUI.PropertyField(rect.Padding(1f, 2f), prop, GUIContent.none); 47 | GUI.enabled = true; 48 | } 49 | 50 | public override void OnInspectorGUI() 51 | { 52 | EditorGUILayout.HelpBox("Reorder the tiles to get the desired matching behavior. Tiles further up in " + 53 | "the list will be tested first during the matching process. Because of this tiles " + 54 | "with more specific matching conditions (tile flags, specific edge flags) should be " + 55 | "placed before other more general tiles.", MessageType.Info); 56 | serializedObject.Update(); 57 | tileList.DoLayoutList(); 58 | serializedObject.ApplyModifiedProperties(); 59 | base.OnInspectorGUI(); 60 | 61 | utilityFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(utilityFoldout, "Utilities"); 62 | if (utilityFoldout) 63 | { 64 | if (GUILayout.Button("Tile-ify Children")) 65 | { 66 | CreateTilesFromChildren(Target); 67 | } 68 | } 69 | EditorGUILayout.EndFoldoutHeaderGroup(); 70 | } 71 | 72 | public static void CreateTilesFromChildren(Tileset tileset) 73 | { 74 | var children = tileset.transform.Cast().ToList(); 75 | 76 | foreach (Transform child in children) 77 | { 78 | if(child.GetComponent() != null) continue; 79 | 80 | GameObject newTile = new GameObject(child.gameObject.name); 81 | newTile.transform.parent = tileset.transform; 82 | newTile.transform.position = child.position; 83 | child.SetParent(newTile.transform); 84 | 85 | var tile = newTile.AddComponent(); 86 | tile.SetBoundsFromChildren(); 87 | tile.GetIdFromTileset(tileset); 88 | tileset.AddTile(tile); 89 | } 90 | } 91 | 92 | [MenuItem("Assets/Create/Mesh-based Tileset", priority = 120)] 93 | public static void CreateTilesetAsset() 94 | { 95 | var tileset = new GameObject("NewTileset", typeof(Tileset)); 96 | var path = GetSelectedPathOrFallback(); 97 | 98 | var uniquePath = AssetDatabase.GenerateUniqueAssetPath($"{path}/{tileset.name}.prefab"); 99 | var prefab = PrefabUtility.SaveAsPrefabAsset(tileset, uniquePath); 100 | DestroyImmediate(tileset); 101 | 102 | Selection.activeObject = prefab; 103 | } 104 | 105 | [MenuItem("Assets/Create tileset from children", priority = 120)] 106 | public static void CreateTilesetAssetFromChildren() 107 | { 108 | var model = PrefabUtility.InstantiatePrefab(Selection.activeGameObject) as GameObject; 109 | PrefabUtility.UnpackPrefabInstance(model, PrefabUnpackMode.Completely, InteractionMode.AutomatedAction); 110 | var tileset = model.AddComponent(); 111 | CreateTilesFromChildren(tileset); 112 | model.name = $"{model.name}Tileset"; 113 | tileset.RefreshLookup(); 114 | EditorUtility.SetDirty(tileset); 115 | 116 | var path = GetSelectedPathOrFallback(); 117 | var uniquePath = AssetDatabase.GenerateUniqueAssetPath($"{path}/{model.name}.prefab"); 118 | var prefab = PrefabUtility.SaveAsPrefabAsset(model, uniquePath); 119 | DestroyImmediate(model); 120 | 121 | Selection.activeObject = prefab; 122 | } 123 | 124 | [MenuItem("Assets/Create tileset from children", validate = true)] 125 | public static bool CanCreateTilesetAssetFromChildren() 126 | { 127 | return Selection.activeGameObject != null && 128 | PrefabUtility.GetPrefabAssetType(Selection.activeGameObject) == PrefabAssetType.Model; 129 | } 130 | 131 | public static string GetSelectedPathOrFallback() 132 | { 133 | string path = "Assets"; 134 | 135 | foreach (UnityEngine.Object obj in Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Assets)) 136 | { 137 | path = AssetDatabase.GetAssetPath(obj); 138 | if (!string.IsNullOrEmpty(path) && File.Exists(path)) 139 | { 140 | path = Path.GetDirectoryName(path); 141 | break; 142 | } 143 | } 144 | return path; 145 | } 146 | } 147 | 148 | public static class RectExtension 149 | { 150 | public static Rect Padding(this Rect rect, float vertical, float horizontal) 151 | { 152 | return rect.Padding(vertical, vertical, horizontal, horizontal); 153 | } 154 | 155 | public static Rect Padding(this Rect rect, float top, float bottom, float left, float right) 156 | { 157 | return new Rect(rect.x + left, rect.y + top, rect.width - left - right, rect.height - top - bottom); 158 | } 159 | 160 | public static Rect[] SplitX(this Rect rect, params float[] segments) 161 | { 162 | var rects = new Rect[segments.Length]; 163 | 164 | float start = rect.x; 165 | for (int i = 0; i < rects.Length; i++) 166 | { 167 | rects[i] = new Rect(start, rect.y, rect.width * segments[i], rect.height); 168 | start = rects[i].xMax; 169 | } 170 | 171 | return rects; 172 | } 173 | } 174 | } 175 | 176 | 177 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TilesetEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78a6fc44dfdb51047a7ca0e96a6c7f9d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TilesetFlagsMaskDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using MeshTilesets; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace MeshTilesetsEditor 7 | { 8 | [CustomPropertyDrawer(typeof(TilesetFlagsMask))] 9 | public class TilesetFlagsMaskDrawer : PropertyDrawer 10 | { 11 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 12 | { 13 | if (property.serializedObject.targetObject is Component c) 14 | { 15 | var tileset = c.gameObject.GetComponentInParent(); 16 | if (tileset != null) 17 | { 18 | if (!property.isExpanded) return EditorGUIUtility.singleLineHeight; 19 | 20 | var mask = property.GetValue(); 21 | return EditorGUIUtility.singleLineHeight + tileset.TilesetFlags.GetDisplayHeight(); 22 | } 23 | } 24 | 25 | return EditorGUIUtility.singleLineHeight * 2; 26 | } 27 | 28 | // TODO: implement generic property drawer 29 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 30 | { 31 | if (property.serializedObject.targetObject is Component c) 32 | { 33 | var tileset = c.gameObject.GetComponentInParent(); 34 | if (tileset != null) 35 | { 36 | // EditorGUI.BeginProperty(position, label, property); 37 | var mask = property.GetValue(); 38 | bool foldout = property.isExpanded; 39 | DrawTilesetFlagsMask(position, label, mask, tileset, ref foldout); 40 | property.isExpanded = foldout; 41 | if (GUI.changed) property.SetValue(mask); 42 | // EditorGUI.EndProperty(); 43 | return; 44 | } 45 | } 46 | EditorGUI.HelpBox(position, "No Tileset found", MessageType.None); 47 | } 48 | 49 | public static void DrawTilesetFlagsMask(Rect pos, GUIContent label, TilesetFlagsMask mask, Tileset tileset, ref bool foldout) 50 | { 51 | // Foldout 52 | pos.height = EditorGUIUtility.singleLineHeight; 53 | foldout = EditorGUI.Foldout(pos, foldout, label); 54 | pos.y += pos.height + EditorGUIUtility.standardVerticalSpacing; 55 | 56 | // Indent 57 | pos.x += EditorGUIUtility.singleLineHeight; 58 | pos.width -= EditorGUIUtility.singleLineHeight; 59 | 60 | if (foldout) 61 | { 62 | DrawTilesetFlagsMask(pos, label, mask, tileset); 63 | } 64 | // EditorGUILayout.EndFoldoutHeaderGroup(); 65 | } 66 | 67 | public static void DrawTilesetFlagsMask(Rect pos, GUIContent label, TilesetFlagsMask mask, Tileset tileset) 68 | { 69 | var flags = tileset.TilesetFlags; 70 | pos.height = EditorGUIUtility.singleLineHeight; 71 | 72 | for (int i = 0; i < Tileset.TILESET_FLAGS_COUNT; i++) 73 | { 74 | if(!flags[i].IsEnabled) continue; 75 | 76 | if (flags[i].isToggle) 77 | { 78 | mask[i] = EditorGUI.Toggle(pos, flags[i].name, mask[i] == 1) ? 1 : 0; 79 | } 80 | else 81 | { 82 | mask[i] = EditorGUI.Popup(pos, flags[i].name, mask[i], flags[i].OptionsWithUndefined); 83 | } 84 | 85 | pos.y += pos.height + EditorGUIUtility.standardVerticalSpacing; 86 | } 87 | } 88 | 89 | public static void DrawTilesetFlagsMask(GUIContent label, TilesetFlagsMask mask, Tileset tileset, ref bool foldout) 90 | { 91 | float height = EditorGUIUtility.singleLineHeight + (foldout ? tileset.TilesetFlags.GetDisplayHeight() : 0); 92 | var rect = GUILayoutUtility.GetRect(0, EditorGUIUtility.currentViewWidth, height, height); 93 | DrawTilesetFlagsMask(rect, label, mask, tileset, ref foldout); 94 | } 95 | 96 | public static void DrawTilesetFlagsMask(GUIContent label, TilesetFlagsMask mask, Tileset tileset) 97 | { 98 | float height = tileset.TilesetFlags.GetDisplayHeight(); 99 | var rect = GUILayoutUtility.GetRect(0, EditorGUIUtility.currentViewWidth, height, height); 100 | DrawTilesetFlagsMask(rect, label, mask, tileset); 101 | } 102 | } 103 | 104 | public static class TilesetFlagsExtension 105 | { 106 | public static float GetDisplayHeight(this TilesetFlags[] flags) 107 | { 108 | return flags.Aggregate(0f, (r, f) => 109 | r + (f.IsEnabled ? EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing : 0) 110 | ); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TilesetFlagsMaskDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e85ac5be98e996144914fcb0839ffc90 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TilesetRendererEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using MeshTilesets; 4 | using UnityEditor; 5 | using UnityEditor.ProBuilder; 6 | using UnityEngine; 7 | using UnityEngine.ProBuilder; 8 | 9 | namespace MeshTilesetsEditor 10 | { 11 | [CustomEditor(typeof(TilesetRenderer))] 12 | public class TilesetRendererEditor : Editor 13 | { 14 | TilesetRenderer Target => target as TilesetRenderer; 15 | private int lastFaceCount; 16 | private int lastVertCount; 17 | private SceneOverlayWindow tileOverlay; 18 | 19 | private bool debugFoldout; 20 | private bool selectedTileFoldout; 21 | private bool visualizationFoldout; 22 | 23 | private bool disabled = false; 24 | 25 | private void OnEnable() 26 | { 27 | if (Target.Mesh == null) 28 | { 29 | disabled = true; 30 | return; 31 | } 32 | 33 | // Register events 34 | ProBuilderEditor.afterMeshModification += OnafterMeshModification; 35 | ProBuilderEditor.selectionUpdated += ProBuilderEditorOnselectionUpdated; 36 | 37 | Target.ApplyHiddenMaterial(); 38 | 39 | // Refresh the tileset renderer 40 | Target.Refresh(); 41 | 42 | // Initialized the scene overlay window 43 | tileOverlay = new SceneOverlayWindow(new GUIContent("Tile"), DoTileOverlayUI, Target); 44 | 45 | // Load the visualization settings 46 | var visSettings = EditorPrefs.GetString($"{nameof(MeshTilesets)}.VisualizationSettings", "{}"); 47 | Target.Visualization = JsonUtility.FromJson(visSettings); 48 | } 49 | 50 | private void OnDisable() 51 | { 52 | ProBuilderEditor.afterMeshModification -= OnafterMeshModification; 53 | ProBuilderEditor.selectionUpdated -= ProBuilderEditorOnselectionUpdated; 54 | 55 | // Save the visualization settings 56 | if(Target != null) 57 | EditorPrefs.SetString($"{nameof(MeshTilesets)}.VisualizationSettings", JsonUtility.ToJson(Target.Visualization)); 58 | } 59 | 60 | private void OnafterMeshModification(IEnumerable meshes) 61 | { 62 | if(meshes.Contains(Target.Mesh)) Target.FullRefresh(); 63 | } 64 | 65 | private void ProBuilderEditorOnselectionUpdated(IEnumerable obj) 66 | { 67 | // Debug.Log("Update"); 68 | 69 | if (lastFaceCount != Target.Mesh.faceCount || lastVertCount != Target.Mesh.vertexCount) 70 | { 71 | lastFaceCount = Target.Mesh.faceCount; 72 | lastVertCount = Target.Mesh.vertexCount; 73 | 74 | Target.FullRefresh(); 75 | } 76 | else 77 | { 78 | Target.Refresh(); 79 | } 80 | } 81 | 82 | public override void OnInspectorGUI() 83 | { 84 | if (disabled) 85 | { 86 | if (Target.Mesh != null) 87 | { 88 | disabled = false; 89 | OnEnable(); 90 | return; 91 | } 92 | 93 | EditorGUILayout.HelpBox("Tileset Renderer requires a Pro Builder Mesh component. " + 94 | "Create a new Pro Builder Shape and attach a Tileset Renderer to the " + 95 | "resulting GameObject", MessageType.Error); 96 | return; 97 | } 98 | 99 | // Draw default inspector 100 | base.OnInspectorGUI(); 101 | if(GUI.changed) Target.FullRefresh(); 102 | 103 | // Draw selected tile section 104 | selectedTileFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(selectedTileFoldout, "Selected Tile"); 105 | if (selectedTileFoldout) 106 | { 107 | if (Target.Mesh.selectedFaceCount == 1) 108 | { 109 | EditorGUI.indentLevel++; 110 | GUI.enabled = false; 111 | 112 | var tile = Target.LookupTile(Target.Mesh.selectedFaceIndexes[0]); 113 | if (tile != null) 114 | { 115 | EditorGUILayout.ObjectField("Tile Instance", 116 | tile.matchedTileInstance != null ? tile.matchedTileInstance.instance : null, 117 | typeof(GameObject), 118 | false); 119 | 120 | EditorGUILayout.Toggle("Flags Undefined", tile.tilesetFlags.IsUndefined); 121 | GUI.enabled = true; 122 | 123 | var foldout = true; 124 | GUI.changed = false; 125 | TilesetFlagsMaskDrawer.DrawTilesetFlagsMask(new GUIContent("Flags"), tile.tilesetFlags, 126 | Target.Tileset, ref foldout); 127 | if (GUI.changed) Target.WriteTileFlagsToVertexColors(); 128 | } 129 | 130 | GUI.enabled = true; 131 | EditorGUI.indentLevel--; 132 | } 133 | else 134 | { 135 | EditorGUILayout.HelpBox("Select a face from the tile mesh", MessageType.Info); 136 | } 137 | } 138 | EditorGUILayout.EndFoldoutHeaderGroup(); 139 | 140 | // Draw visualization section 141 | visualizationFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(visualizationFoldout, "Visualization"); 142 | if(visualizationFoldout) DoVisualizationSettings(); 143 | EditorGUILayout.EndFoldoutHeaderGroup(); 144 | 145 | // Draw debug section 146 | debugFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(debugFoldout, "Debug"); 147 | if (debugFoldout) 148 | { 149 | GUILayout.BeginHorizontal(); 150 | if (GUILayout.Button("Clear Pool")) 151 | { 152 | Target.TilePool.ReturnTiles(); 153 | Target.TilePool.ClearPool(); 154 | } 155 | if(GUILayout.Button("Rebuild Pool")) Target.TilePool.RebuildPool(); 156 | if(GUILayout.Button("Full Refresh")) Target.FullRefresh(); 157 | 158 | // Toggle visibility 159 | var firstChild = Target.transform.childCount > 0 ? Target.transform.GetChild(0) : null; 160 | if (!firstChild) GUI.enabled = false; 161 | var visible = firstChild ? firstChild.gameObject.hideFlags == HideFlags.None : false; 162 | if(GUILayout.Button((visible ? "Hide" : "Show") + " Tiles")) Target.SetTileVisibility(!visible); 163 | GUI.enabled = true; 164 | 165 | GUILayout.EndHorizontal(); 166 | } 167 | EditorGUILayout.EndFoldoutHeaderGroup(); 168 | } 169 | 170 | private void OnSceneGUI() 171 | { 172 | if(disabled) return; 173 | tileOverlay.ShowWindow(); 174 | } 175 | 176 | private static void DoTileOverlayUI(UnityEngine.Object target, SceneView sceneView) 177 | { 178 | var Target = target as TilesetRenderer; 179 | 180 | if (Target.Mesh.selectedFaceCount >= 1) 181 | { 182 | var tile = Target.LookupTile(Target.Mesh.selectedFaceIndexes[0]); 183 | if (tile != null) 184 | { 185 | var labelSize = EditorGUIUtility.labelWidth; 186 | var fieldSize = EditorGUIUtility.fieldWidth; 187 | EditorGUIUtility.labelWidth = 120f; 188 | EditorGUIUtility.fieldWidth = 100f; 189 | GUI.changed = false; 190 | TilesetFlagsMaskDrawer.DrawTilesetFlagsMask(new GUIContent("Flags"), tile.tilesetFlags, Target.Tileset); 191 | if (GUI.changed) 192 | { 193 | if (Target.Mesh.selectedFaceCount > 1) 194 | { 195 | for (int i = 1; i < Target.Mesh.selectedFaceCount; i++) 196 | { 197 | var t = Target.LookupTile(Target.Mesh.selectedFaceIndexes[i]); 198 | if (t != null) t.tilesetFlags.Copy(tile.tilesetFlags); 199 | } 200 | } 201 | 202 | Target.WriteTileFlagsToVertexColors(); 203 | Target.FullRefresh(); 204 | } 205 | EditorGUIUtility.labelWidth = labelSize; 206 | EditorGUIUtility.fieldWidth = fieldSize; 207 | } 208 | } 209 | else 210 | { 211 | GUILayout.Label("No tile selected"); 212 | } 213 | } 214 | 215 | private void DoVisualizationSettings(bool horizontal = false) 216 | { 217 | var vis = Target.Visualization; 218 | DoVisualizationSettings(ref vis); 219 | Target.Visualization = vis; 220 | } 221 | 222 | private static void DoVisualizationSettings(ref TilesetRenderer.VisualizationSettings vis) 223 | { 224 | vis.drawNormals = EditorGUILayout.ToggleLeft("Normals", vis.drawNormals); 225 | vis.drawEdgeFlags = EditorGUILayout.ToggleLeft("Edge Flags", vis.drawEdgeFlags); 226 | vis.drawPivot = EditorGUILayout.ToggleLeft("Orientation", vis.drawPivot); 227 | } 228 | } 229 | } 230 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TilesetRendererEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9cac14bdb3677cd4699e25988e495280 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TilesetRendererScenePostProcessor.cs: -------------------------------------------------------------------------------- 1 | using MeshTilesets; 2 | using UnityEditor.Callbacks; 3 | using UnityEngine; 4 | using UnityEngine.ProBuilder; 5 | 6 | namespace MeshTilesetsEditor 7 | { 8 | public static class TilesetRendererScenePostProcessor 9 | { 10 | [PostProcessScene] 11 | public static void PostProcessScene() 12 | { 13 | foreach (TilesetRenderer t in Object.FindObjectsOfType()) 14 | { 15 | if (UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode) 16 | return; 17 | 18 | var meshRenderer = t.GetComponent(); 19 | var meshFilter = t.GetComponent(); 20 | var proBuilder = t.GetComponent(); 21 | 22 | if(proBuilder) Object.DestroyImmediate(proBuilder); 23 | if(meshRenderer) Object.DestroyImmediate(meshRenderer); 24 | if(meshFilter) Object.DestroyImmediate(meshFilter); 25 | Object.DestroyImmediate(t); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/TilesetRendererScenePostProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e96b7b462b915bb408c3d17ef9b3116d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/com.freshlybrewedcode.MeshTilesetsEditor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MeshTilesetsEditor", 3 | "rootNamespace": "MeshTilesetsEditor", 4 | "references": [ 5 | "GUID:c564902498b8c5b489ba9e489914c038", 6 | "GUID:1826c0224c0d048b88112c79bbb0cd85", 7 | "GUID:03ca3ee4acaf74592bc6d299ca86aa27" 8 | ], 9 | "includePlatforms": [ 10 | "Editor" 11 | ], 12 | "excludePlatforms": [], 13 | "allowUnsafeCode": false, 14 | "overrideReferences": false, 15 | "precompiledReferences": [], 16 | "autoReferenced": true, 17 | "defineConstraints": [], 18 | "versionDefines": [], 19 | "noEngineReferences": false 20 | } -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Editor/com.freshlybrewedcode.MeshTilesetsEditor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a41daa2018f889c479b9e8a25a4e6dea 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04f0d4d1cbf6968469f1505bcb898ce4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/TagExtension.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MeshTilesets 4 | { 5 | [System.Serializable] 6 | public class Tag 7 | { 8 | [SerializeField] 9 | private string tagName; 10 | public string TagName => tagName; 11 | 12 | public Tag(string tag) 13 | { 14 | tagName = tag; 15 | } 16 | 17 | public override string ToString() 18 | { 19 | return tagName; 20 | } 21 | 22 | public override bool Equals(object obj) 23 | { 24 | if (obj is Tag other) return string.Equals(tagName, other.TagName); 25 | if (obj is string s) return string.Equals(tagName, s); 26 | return base.Equals(obj); 27 | } 28 | 29 | public bool Compare(GameObject obj) 30 | { 31 | return obj.CompareTag(tagName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/TagExtension.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc88f119d9156b04191ce9a4b598726d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/Tile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | #if UNITY_EDITOR 5 | using UnityEditor; 6 | #endif 7 | 8 | namespace MeshTilesets 9 | { 10 | public enum EdgeFlag 11 | { 12 | Any = 0, // Matches with everything 13 | Empty = 1, // Matches if edge has no adjacent tiles 14 | AnyTile = 2, // Matches if edge has any adjacent tiles 15 | Flat = 3, // Matches if edge has an adjacent tile with the same normal 16 | ConvexDown = 4, // Matches if edge has an adjacent tile that bends down (convex geometry) 17 | ConcaveUp = 5, // Matches if edge has an adjacent tile that bends up (concave geometry) 18 | NotFlat = 6, // NotFlat = Flat * 2 19 | NotConvexDown = 8, 20 | NotConcaveUp = 10 21 | } 22 | 23 | [System.Serializable] 24 | public class EdgeFlags 25 | { 26 | public EdgeFlag top = EdgeFlag.Any; 27 | public EdgeFlag bottom = EdgeFlag.Any; 28 | public EdgeFlag left = EdgeFlag.Any; 29 | public EdgeFlag right = EdgeFlag.Any; 30 | 31 | public override int GetHashCode() 32 | { 33 | return ((int) top << 0) + ((int)bottom << 3) + ((int)left << 6) + ((int)right << 9); 34 | } 35 | 36 | public static bool NotFlag(EdgeFlag a, EdgeFlag b) 37 | { 38 | if ((int) a >= 6) return (EdgeFlag) ((int) a / 2) != b; 39 | return false; 40 | } 41 | 42 | public static bool Match(EdgeFlag a, EdgeFlag b) 43 | { 44 | return a == b || a == EdgeFlag.Any || b == EdgeFlag.Any || 45 | (a == EdgeFlag.AnyTile && b > EdgeFlag.Empty && b <= EdgeFlag.ConcaveUp) || 46 | (b == EdgeFlag.AnyTile && a > EdgeFlag.Empty && a <= EdgeFlag.ConcaveUp) || 47 | NotFlag(a, b) || NotFlag(b, a); 48 | } 49 | 50 | public bool Matches(EdgeFlags other, bool allowRotation, out int rotation) 51 | { 52 | rotation = 0; 53 | 54 | // Simple match of all edges 55 | if (!allowRotation) 56 | return Match(top, other.top) && 57 | Match(bottom, other.bottom) && 58 | Match(left, other.left) && 59 | Match(right, other.right); 60 | 61 | // Try to match any rotation 62 | for (int i = 0; i < 4; i++) 63 | { 64 | rotation = i; 65 | if (this.RotatedClockwise(i).Matches(other)) return true; 66 | } 67 | 68 | return false; 69 | } 70 | 71 | public bool Matches(EdgeFlags other, bool allowRotation = false) 72 | { 73 | return Matches(other, allowRotation, out _); 74 | } 75 | 76 | public EdgeFlag this[int index] 77 | { 78 | get 79 | { 80 | switch (index) 81 | { 82 | case 0: return left; 83 | case 1: return top; 84 | case 2: return right; 85 | case 3: return bottom; 86 | default: throw new IndexOutOfRangeException(); 87 | } 88 | } 89 | set 90 | { 91 | switch (index) 92 | { 93 | case 0: 94 | left = value; 95 | break; 96 | case 1: 97 | top = value; 98 | break; 99 | case 2: 100 | right = value; 101 | break; 102 | case 3: 103 | bottom = value; 104 | break; 105 | default: throw new IndexOutOfRangeException(); 106 | } 107 | } 108 | } 109 | 110 | public EdgeFlags RotatedClockwise(int numberOfRotations) 111 | { 112 | return new EdgeFlags 113 | { 114 | left = this[(numberOfRotations + 0) % 4], 115 | top = this[(numberOfRotations + 1) % 4], 116 | right = this[(numberOfRotations + 2) % 4], 117 | bottom = this[(numberOfRotations + 3) % 4] 118 | }; 119 | } 120 | } 121 | 122 | [ExecuteInEditMode] 123 | public class Tile : MonoBehaviour 124 | { 125 | const float GIZMO_MARGIN = 0.25f; 126 | 127 | [SerializeField] private int id = -1; 128 | [SerializeField] private float width = 1; 129 | [SerializeField] private float height = 1; 130 | [SerializeField] private bool overrideOrientation = false; 131 | [EnabledIf(nameof(overrideOrientation))] 132 | [SerializeField] private TileOrientation orientation; 133 | [SerializeField] private EdgeFlags edgeFlags; 134 | [SerializeField][HideInInspector] public TilesetFlagsMask tilesetFlags; 135 | [SerializeField] private TileHideGroup[] hideGroups; 136 | 137 | private Tileset tileset; 138 | public Tileset Tileset 139 | { 140 | get => tileset; 141 | set 142 | { 143 | if(tileset) tileset.RemoveTile(this); 144 | tileset = value; 145 | tileset.AddTile(this); 146 | } 147 | } 148 | 149 | public int Id => id; 150 | public float Width => width; 151 | public float Height => height; 152 | public bool OverrideOrientation => overrideOrientation; 153 | public TileOrientation Orientation => orientation; 154 | public EdgeFlags EdgeFlags => edgeFlags; 155 | 156 | public Vector2 Size => new Vector2(width, height); 157 | 158 | public void GetIdFromTileset(Tileset tileset) 159 | { 160 | id = tileset.NewId; 161 | } 162 | 163 | private void OnDestroy() 164 | { 165 | if(tileset) tileset.RemoveTile(this); 166 | } 167 | 168 | public GameObject CreateTileInstance() 169 | { 170 | GameObject instance = new GameObject(gameObject.name); 171 | bool isPrefab = false; 172 | foreach (Transform child in transform) 173 | { 174 | GameObject childInstance; 175 | #if UNITY_EDITOR 176 | var prefabInstance = PrefabUtility.GetNearestPrefabInstanceRoot(child); 177 | if (prefabInstance != null && prefabInstance.gameObject == child.gameObject) 178 | { 179 | string prefabPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(prefabInstance); 180 | var prefab = AssetDatabase.LoadAssetAtPath(prefabPath, typeof(GameObject)); 181 | childInstance = PrefabUtility.InstantiatePrefab(prefab, instance.transform) as GameObject; 182 | isPrefab = true; 183 | } 184 | else 185 | { 186 | #endif 187 | childInstance = Instantiate(child.gameObject, instance.transform); 188 | #if UNITY_EDITOR 189 | } 190 | #endif 191 | childInstance.transform.localPosition = child.localPosition; 192 | childInstance.transform.localRotation = child.localRotation; 193 | childInstance.transform.localScale = child.localScale; 194 | } 195 | 196 | #if UNITY_EDITOR 197 | if (isPrefab && instance.transform.childCount == 1) 198 | { 199 | var prefab = instance.transform.GetChild(0).gameObject; 200 | prefab.transform.SetParent(null, true); 201 | DestroyImmediate(instance); 202 | return prefab; 203 | } 204 | #endif 205 | 206 | return instance; 207 | } 208 | 209 | public void ApplyHideGroups(TileInstance instance, Transform root) 210 | { 211 | foreach (TileHideGroup group in hideGroups) 212 | { 213 | bool hidden = group.ShouldHide(instance.tilesetFlags); 214 | foreach (Transform child in root) 215 | { 216 | if(group.GroupTag.Compare(child.gameObject)) child.gameObject.SetActive(!hidden); 217 | } 218 | } 219 | } 220 | 221 | private void OnDrawGizmos() 222 | { 223 | #if UNITY_EDITOR 224 | // Draw fancy tile gizmo... 225 | 226 | var m1 = Gizmos.matrix; 227 | var m2 = Handles.matrix; 228 | Gizmos.matrix = transform.localToWorldMatrix; 229 | Handles.matrix = transform.localToWorldMatrix; 230 | 231 | Gizmos.color = new Color(0, 0.5f, 1, 0.5f); 232 | Gizmos.DrawCube(new Vector3(0, 0, -Height / 2 - GIZMO_MARGIN / 2), new Vector3(Width + GIZMO_MARGIN * 2, 0, GIZMO_MARGIN)); 233 | Gizmos.DrawCube(new Vector3(0, 0, Height / 2 + GIZMO_MARGIN / 2), new Vector3(Width + GIZMO_MARGIN * 2, 0, GIZMO_MARGIN)); 234 | Gizmos.DrawCube(new Vector3(-Width / 2 - GIZMO_MARGIN / 2, 0, 0), new Vector3(GIZMO_MARGIN, 0, Height)); 235 | Gizmos.DrawCube(new Vector3(Width / 2 + GIZMO_MARGIN / 2, 0, 0), new Vector3(GIZMO_MARGIN, 0, Height)); 236 | 237 | Gizmos.color = Color.white; 238 | Gizmos.DrawWireCube(Vector3.zero, new Vector3(Width + GIZMO_MARGIN * 2, 0, Height + GIZMO_MARGIN * 2)); 239 | Gizmos.DrawWireCube(Vector3.zero, new Vector3(Width, 0, Height)); 240 | 241 | Handles.color = Color.green; 242 | Handles.ArrowHandleCap(0, new Vector3(-Width / 2 - GIZMO_MARGIN / 2, 0, -Height / 2 - GIZMO_MARGIN / 2), 243 | Quaternion.LookRotation(Vector3.forward), GIZMO_MARGIN, EventType.Repaint); 244 | Handles.color = Color.red; 245 | Handles.ArrowHandleCap(0, new Vector3(-Width / 2 - GIZMO_MARGIN / 2, 0, -Height / 2 - GIZMO_MARGIN / 2), 246 | Quaternion.LookRotation(Vector3.right), GIZMO_MARGIN, EventType.Repaint); 247 | 248 | GUI.color = Color.white; 249 | var pos = new Vector3(0, 0, -Height / 2 - GIZMO_MARGIN * 1.25f); 250 | var size = Mathf.RoundToInt(HandleUtility.GetHandleSize(pos) + 13); 251 | Handles.Label(pos, Width.ToString(), new GUIStyle("Label"){fontSize = size}); 252 | 253 | pos = new Vector3(-Width / 2 - GIZMO_MARGIN * 1.25f, 0, 0); 254 | size = Mathf.RoundToInt(HandleUtility.GetHandleSize(pos) + 13); 255 | Handles.Label(pos, Height.ToString(), new GUIStyle("Label"){fontSize = size}); 256 | 257 | Gizmos.matrix = m1; 258 | Handles.matrix = m2; 259 | #endif 260 | } 261 | 262 | public void SetBoundsFromChildren() 263 | { 264 | width = 0; 265 | height = 0; 266 | 267 | foreach (var renderer in GetComponentsInChildren()) 268 | { 269 | var bounds = renderer.bounds.size; 270 | width = Mathf.Max(width, 271 | Mathf.Abs(Vector3.Dot(transform.right, renderer.transform.right * bounds.x)), 272 | Mathf.Abs(Vector3.Dot(transform.right, renderer.transform.up * bounds.y)), 273 | Mathf.Abs(Vector3.Dot(transform.right, renderer.transform.forward * bounds.z))); 274 | height = Mathf.Max(height, 275 | Mathf.Abs(Vector3.Dot(transform.up, renderer.transform.right * bounds.x)), 276 | Mathf.Abs(Vector3.Dot(transform.up, renderer.transform.up * bounds.y)), 277 | Mathf.Abs(Vector3.Dot(transform.up, renderer.transform.forward * bounds.z))); 278 | } 279 | } 280 | 281 | public void RotateWithoutChildren(Quaternion rotation) 282 | { 283 | transform.rotation = rotation * transform.rotation; 284 | var invRot = Quaternion.Inverse(rotation); 285 | 286 | foreach (Transform child in transform) 287 | { 288 | child.transform.rotation = invRot * child.transform.rotation; 289 | } 290 | } 291 | } 292 | } 293 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/Tile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f52feb60ad5a0b94789d9efe4638101f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/TileHideGroup.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MeshTilesets 4 | { 5 | [System.Serializable] 6 | public class TileHideGroup 7 | { 8 | public enum HideMode 9 | { 10 | ShowOnMatch, 11 | HideOnMatch 12 | } 13 | 14 | [SerializeField] private Tag groupTag; 15 | [SerializeField] private HideMode hideMode; 16 | [SerializeField] private TilesetFlagsMask tilesetFlags; 17 | 18 | public Tag GroupTag => groupTag; 19 | 20 | public bool ShouldHide(TilesetFlagsMask flags) 21 | { 22 | return hideMode == HideMode.HideOnMatch ? flags.Matches(tilesetFlags) : !flags.Matches(tilesetFlags); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/TileHideGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c97af2360b793549acd0b5d11427cfc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/TileInstance.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using UnityEngine; 4 | using UnityEngine.ProBuilder; 5 | 6 | namespace MeshTilesets 7 | { 8 | public class TileInstance 9 | { 10 | private const float RECT_THRESHOLD = 0.001f; 11 | private const float FLAT_THRESHOLD = 0.001f; 12 | private const float SIZE_MATCH_THRESHOLD = 0.001f; 13 | 14 | public Vector3[] vertices; 15 | public int orientationOffset; 16 | public EdgeFlags edgeFlags; 17 | public Vector3 position; 18 | public Vector3 normal; 19 | public float width; 20 | public float height; 21 | public TilesetFlagsMask tilesetFlags; 22 | 23 | private int matchedTileId = -1; 24 | public int matchedRotation = 0; 25 | public int lastMatchedRotation = 0; 26 | public TilePool.TileInstanceObject matchedTileInstance; 27 | 28 | private Face face; 29 | private int faceIndex; 30 | private ProBuilderMesh mesh; 31 | private TilesetRenderer tilesetRenderer; 32 | 33 | private Vector3 lastPos; 34 | private float lastWidth, lastHeight; 35 | 36 | public int FaceIndex => faceIndex; 37 | public Face Face => face; 38 | 39 | public TileInstance(TilesetRenderer renderer, Face face, int faceIndex, ProBuilderMesh mesh) 40 | { 41 | tilesetRenderer = renderer; 42 | this.face = face; 43 | this.faceIndex = faceIndex; 44 | this.mesh = mesh; 45 | this.edgeFlags = new EdgeFlags(); 46 | this.vertices = new Vector3[4]; 47 | RefreshVertices(); 48 | } 49 | 50 | public void FullRefresh() 51 | { 52 | RefreshVertices(true); 53 | RefreshEdgeFlags(); 54 | } 55 | 56 | public bool RefreshVertices(bool refreshOrientation = false) 57 | { 58 | var quad = face.ToQuad(); 59 | var colors = new Color[vertices.Length]; 60 | 61 | if(refreshOrientation) RefreshOrientation(quad, tilesetRenderer.Orientation); 62 | 63 | for (int i = 0; i < vertices.Length; i++) 64 | { 65 | vertices[i] = mesh.positions[quad[(i + orientationOffset) % 4]]; 66 | colors[i] = mesh.colors[quad[i]]; 67 | } 68 | 69 | 70 | var leftEdge = vertices[1] - vertices[0]; 71 | var bottomEdge = vertices[3] - vertices[0]; 72 | 73 | height = leftEdge.magnitude; 74 | width = bottomEdge.magnitude; 75 | 76 | this.position = (vertices[0] + vertices[1] + vertices[2] + vertices[3]) / 4; 77 | this.normal = Vector3.Cross(leftEdge, bottomEdge).normalized; 78 | 79 | // Compute flags 80 | if(tilesetFlags == null) tilesetFlags = new TilesetFlagsMask(colors); 81 | else tilesetFlags.FromVertexColors(colors); 82 | 83 | // Check if anything has changed 84 | bool changed = lastPos != position || 85 | Mathf.Abs(lastWidth - width) > SIZE_MATCH_THRESHOLD || 86 | Mathf.Abs(lastHeight - height) > SIZE_MATCH_THRESHOLD; 87 | 88 | lastPos = position; 89 | lastWidth = width; 90 | lastHeight = height; 91 | 92 | return changed; 93 | } 94 | 95 | public void RefreshEdgeFlags() 96 | { 97 | var quad = face.ToQuad(); 98 | 99 | // Edge flags 100 | for (int i = 0; i < 4; i++) 101 | { 102 | var v1 = quad[(i + orientationOffset) % 4]; 103 | var v2 = quad[(i + 1 + orientationOffset) % 4]; 104 | 105 | var sharedV1 = tilesetRenderer.LookupSharedVertex(v1); 106 | var sharedV2 = tilesetRenderer.LookupSharedVertex(v2); 107 | 108 | var sharedFace = tilesetRenderer.LookupFaces(sharedV1) 109 | .Intersect(tilesetRenderer.LookupFaces(sharedV2)) 110 | .Where(f => f != this.faceIndex); 111 | 112 | if (sharedFace.Count() != 1) 113 | { 114 | edgeFlags[i] = EdgeFlag.Empty; 115 | } 116 | else 117 | { 118 | var face = sharedFace.First(); 119 | var tile = tilesetRenderer.LookupTile(face); 120 | 121 | if(tile == null) edgeFlags[i] = EdgeFlag.Empty; 122 | else 123 | { 124 | // Get the "tangent" i.e. a vector pointing in the direction of the edge (left, right, top or bottom) 125 | // and is perpendicular to the normal of the tile 126 | var tangent = (vertices[i] - vertices[(i + 3) % 4]).normalized; // vertices[i] - vertices[i - 1] 127 | var angle = Vector3.Dot(tangent, tile.normal); 128 | // Debug.Log(tile.normal); 129 | 130 | if (Mathf.Abs(angle) <= FLAT_THRESHOLD) edgeFlags[i] = EdgeFlag.Flat; 131 | else if (angle > FLAT_THRESHOLD) edgeFlags[i] = EdgeFlag.ConvexDown; 132 | else edgeFlags[i] = EdgeFlag.ConcaveUp; 133 | } 134 | } 135 | } 136 | } 137 | 138 | public void RefreshOrientation(int[] indices, TileOrientation orientation) 139 | { 140 | if (orientation == TileOrientation.FromVertexOrder) 141 | { 142 | orientationOffset = 0; 143 | return; 144 | } 145 | 146 | // Get the desired direction for the top edge 147 | Vector3 topTarget; 148 | switch (orientation) 149 | { 150 | case TileOrientation.TopIsWorldUp: 151 | topTarget = tilesetRenderer.transform.InverseTransformDirection(Vector3.up); 152 | break; 153 | case TileOrientation.TopIsObjectUp: 154 | topTarget = Vector3.up; 155 | break; 156 | case TileOrientation.TopIsWorldForward: 157 | topTarget = tilesetRenderer.transform.InverseTransformDirection(Vector3.forward); 158 | break; 159 | case TileOrientation.TopIsObjectForward: 160 | topTarget = Vector3.forward; 161 | break; 162 | default: 163 | throw new ArgumentOutOfRangeException(); 164 | } 165 | 166 | // We use the dot product to compare the top vector of the tile with the target top direction 167 | // The dot product is largest if the two vectors are facing in the same direction, so we 168 | // are looking for the orientation with the maximum dot product 169 | float maxDot = float.MinValue; 170 | 171 | // We try 4 different orientation offsets 172 | for (int i = 0; i < 4; i++) 173 | { 174 | // "top vector" is just the vector pointing from v[0] to v[1] 175 | var top = (mesh.positions[indices[(1 + i) % 4]] - mesh.positions[indices[(0 + i) % 4]]).normalized; 176 | var dot = Vector3.Dot(top, topTarget); 177 | if (dot > maxDot) 178 | { 179 | orientationOffset = i; 180 | maxDot = dot; 181 | } 182 | } 183 | } 184 | 185 | public bool IsRect 186 | { 187 | get 188 | { 189 | Vector3 e1 = (vertices[0] - vertices[1]).normalized; 190 | Vector3 e2 = (vertices[1] - vertices[2]).normalized; 191 | Vector3 e3 = (vertices[2] - vertices[3]).normalized; 192 | Vector3 e4 = (vertices[3] - vertices[0]).normalized; 193 | float angle1 = Vector3.Dot(e1, e2); 194 | float angle2 = Vector3.Dot(e3, e4); 195 | 196 | return Vector3.Dot(e1, e3) < (-1 + RECT_THRESHOLD) && Vector3.Dot(e2, e4) < (-1 + RECT_THRESHOLD) && 197 | Mathf.Abs(angle1) < RECT_THRESHOLD && Mathf.Abs(angle2) < RECT_THRESHOLD; 198 | } 199 | } 200 | 201 | public bool Matches(Tile tile) 202 | { 203 | int rotation; 204 | if (!MatchesEdges(tile, out rotation)) return false; 205 | bool matches = MatchesSize(tile, rotation) && MatchesTileFlags(tile); 206 | 207 | if (matches) 208 | { 209 | matchedRotation = rotation; 210 | } 211 | 212 | return matches; 213 | } 214 | 215 | public bool MatchesEdges(Tile tile, out int rotation) 216 | { 217 | var matches = tile.EdgeFlags.Matches(edgeFlags, true, out lastMatchedRotation); 218 | rotation = lastMatchedRotation; 219 | return matches; 220 | } 221 | 222 | public bool MatchesSize(Tile tile, int rotation) 223 | { 224 | bool invert = rotation % 2 == 1; 225 | return (Mathf.Abs(tile.Width - (invert ? height : width)) <= SIZE_MATCH_THRESHOLD && 226 | Mathf.Abs(tile.Height - (invert ? width : height)) <= SIZE_MATCH_THRESHOLD); 227 | } 228 | 229 | public bool MatchesTileFlags(Tile tile) 230 | { 231 | return tilesetFlags.Matches(tile.tilesetFlags); 232 | } 233 | 234 | public void SetMatchedTile(Tile tile, int matchedRotation) 235 | { 236 | if (tile != null && tile.Id != matchedTileId && tile.OverrideOrientation) 237 | { 238 | var quads = face.ToQuad(); 239 | RefreshOrientation(quads, tile.Orientation); 240 | RefreshVertices(); 241 | } 242 | matchedTileId = tile ? tile.Id : -1; 243 | this.matchedRotation = matchedRotation; 244 | } 245 | 246 | public Vector2 RotatedSize(int rotation) 247 | { 248 | return rotation % 2 == 0 249 | ? new Vector2(width, height) 250 | : new Vector2(height, width); 251 | } 252 | 253 | public void UpdateTileInstance(TilePool pool) 254 | { 255 | // Check if we need a new tile instance 256 | if (matchedTileInstance == null || matchedTileInstance.id != matchedTileId) 257 | { 258 | if(matchedTileInstance != null) pool.ReturnTileInstance(matchedTileInstance); 259 | if (matchedTileId == -1) return; 260 | 261 | matchedTileInstance = pool.GetTileInstance(matchedTileId); 262 | } 263 | 264 | // Align tile instance 265 | var tileTransform = matchedTileInstance.instance.transform; 266 | tileTransform.localPosition = position; 267 | 268 | var forward = (vertices[1] - vertices[0]).normalized; 269 | tileTransform.localRotation = Quaternion.AngleAxis(-90 * matchedRotation, normal) * Quaternion.LookRotation(forward, normal); 270 | } 271 | 272 | public void UpdateHideGroups() 273 | { 274 | if (matchedTileInstance != null) 275 | { 276 | tilesetRenderer.Tileset.LookupTile(matchedTileId).ApplyHideGroups(this, matchedTileInstance.instance.transform); 277 | } 278 | } 279 | } 280 | } 281 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/TileInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcc79405780a070479a6b68b2522ad54 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/TilePool.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | #if UNITY_EDITOR 5 | using UnityEditor; 6 | #endif 7 | 8 | namespace MeshTilesets 9 | { 10 | public class TilePool 11 | { 12 | public class TileInstanceObject 13 | { 14 | public int id; 15 | public GameObject instance; 16 | 17 | public TileInstanceObject(int id, GameObject instance) 18 | { 19 | this.id = id; 20 | this.instance = instance; 21 | } 22 | } 23 | 24 | private Tileset tileset; 25 | private Transform tileParent; 26 | private Dictionary> pool; 27 | private List allTiles; 28 | 29 | public TilePool(Tileset tileset, Transform tileParent) 30 | { 31 | this.tileset = tileset; 32 | this.tileParent = tileParent; 33 | RebuildPool(); 34 | } 35 | 36 | public void RebuildPool() 37 | { 38 | pool = new Dictionary>(); 39 | allTiles = new List(); 40 | 41 | // Clear existing untracked instances 42 | while (this.tileParent.childCount > 0) 43 | { 44 | GameObject.DestroyImmediate(tileParent.GetChild(0).gameObject); 45 | } 46 | 47 | // Initialize pool dictionary 48 | foreach (var tile in tileset) 49 | { 50 | pool.Add(tile.Id, new List()); 51 | } 52 | } 53 | 54 | public TileInstanceObject GetTileInstance(Tile tile) => GetTileInstance(tile.Id); 55 | 56 | public TileInstanceObject GetTileInstance(int id) 57 | { 58 | if(!pool.ContainsKey(id)) pool.Add(id, new List()); 59 | 60 | var tilePool = pool[id]; 61 | if (tilePool.Count > 0) 62 | { 63 | var t = tilePool[tilePool.Count - 1]; 64 | tilePool.Remove(t); 65 | t.instance.SetActive(true); 66 | 67 | return t; 68 | } 69 | 70 | return CreateTileInstance(id); 71 | } 72 | 73 | public void ReturnTileInstance(TileInstanceObject tileInstance) 74 | { 75 | tileInstance.instance.SetActive(false); 76 | var tilePool = pool[tileInstance.id]; 77 | if(!tilePool.Contains(tileInstance)) tilePool.Add(tileInstance); 78 | } 79 | 80 | public TileInstanceObject CreateTileInstance(int id) 81 | { 82 | var tile = tileset.LookupTile(id); 83 | var instance = tile.CreateTileInstance(); 84 | instance.transform.SetParent(tileParent); 85 | 86 | // Hide objects in editor 87 | #if UNITY_EDITOR 88 | // Disable picking so the tile mesh faces can be selected through the tile geometry 89 | SceneVisibilityManager.instance.DisablePicking(instance, true); 90 | // Hide the tile objects in the scene view 91 | instance.hideFlags = HideFlags.HideInHierarchy; 92 | #endif 93 | 94 | var instanceObj = new TileInstanceObject(id, instance); 95 | allTiles.Add(instanceObj); 96 | 97 | return instanceObj; 98 | } 99 | 100 | public void ClearPool() 101 | { 102 | foreach (var tilePool in pool.Values) 103 | { 104 | foreach (TileInstanceObject tile in tilePool) 105 | { 106 | allTiles.Remove(tile); 107 | GameObject.DestroyImmediate(tile.instance); 108 | } 109 | tilePool.Clear(); 110 | } 111 | } 112 | 113 | public void ReturnTiles() 114 | { 115 | foreach (TileInstanceObject t in allTiles) 116 | { 117 | ReturnTileInstance(t); 118 | } 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/TilePool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32e43b037a2591b4091f7f09d0434a5d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/Tileset.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | 6 | namespace MeshTilesets 7 | { 8 | public class Tileset : MonoBehaviour, IEnumerable 9 | { 10 | public const int TILESET_FLAGS_COUNT = 16; 11 | 12 | [HideInInspector] 13 | [SerializeField] private List tiles = new List(); 14 | 15 | [SerializeField] private TilesetFlags[] tilesetFlags = new TilesetFlags[TILESET_FLAGS_COUNT]; 16 | public TilesetFlags[] TilesetFlags => tilesetFlags; 17 | 18 | // tile id => Tile 19 | private Dictionary tileLookup; 20 | 21 | public int NewId 22 | { 23 | get 24 | { 25 | return tiles.Aggregate(0, (current, tile) => Mathf.Max(current, tile.Id)) + 1; 26 | } 27 | } 28 | 29 | public void AddTile(Tile tile) 30 | { 31 | if (!tiles.Contains(tile)) 32 | { 33 | tiles.Add(tile); 34 | tile.GetIdFromTileset(this); 35 | } 36 | RefreshLookup(); 37 | } 38 | 39 | public void RemoveTile(Tile tile) 40 | { 41 | if (tiles.Contains(tile)) tiles.Remove(tile); 42 | RefreshLookup(); 43 | } 44 | 45 | public void CleanTiles() 46 | { 47 | for (var i = 0; i < tiles.Count; i++) 48 | { 49 | if (tiles[i] != null && tiles[i].transform.parent == transform) continue; 50 | tiles.RemoveAt(i--); 51 | } 52 | RefreshLookup(); 53 | } 54 | 55 | public void RefreshTileset() 56 | { 57 | CleanTiles(); 58 | foreach (Tile tile in GetComponentsInChildren()) 59 | { 60 | if (!tiles.Contains(tile)) tiles.Add(tile); 61 | } 62 | RefreshLookup(); 63 | } 64 | 65 | public void RefreshLookup() 66 | { 67 | if(tileLookup == null) tileLookup = new Dictionary(); 68 | tileLookup.Clear(); 69 | 70 | foreach (Tile tile in tiles) 71 | { 72 | tileLookup.Add(tile.Id, tile); 73 | } 74 | } 75 | 76 | public Tile LookupTile(int id) 77 | { 78 | if(tileLookup == null || tileLookup.Count != tiles.Count) RefreshLookup(); 79 | return !tileLookup.ContainsKey(id) ? null : tileLookup[id]; 80 | } 81 | 82 | public Tile MatchTile(TileInstance instance) 83 | { 84 | // Simple match 85 | return tiles.FirstOrDefault(instance.Matches); 86 | } 87 | 88 | public Tile MatchClosestTile(TileInstance instance) 89 | { 90 | var minDistance = float.MaxValue; 91 | Tile closestTile = null; 92 | 93 | foreach (Tile tile in tiles) 94 | { 95 | // Check if the tile matches edges and tile flags 96 | if (!instance.MatchesEdges(tile, out var rotation) || !instance.MatchesTileFlags(tile)) continue; 97 | 98 | // Compute "distance" between tile dimensions and check if the tile is closer 99 | var distance = (tile.Size - instance.RotatedSize(rotation)).SqrMagnitude(); 100 | if (!(distance < minDistance)) continue; 101 | 102 | instance.matchedRotation = rotation; 103 | minDistance = distance; 104 | closestTile = tile; 105 | } 106 | 107 | return closestTile; 108 | } 109 | 110 | public IEnumerator GetEnumerator() 111 | { 112 | return tiles.GetEnumerator(); 113 | } 114 | 115 | IEnumerator IEnumerable.GetEnumerator() 116 | { 117 | return GetEnumerator(); 118 | } 119 | } 120 | 121 | [System.Serializable] 122 | public class TilesetFlags 123 | { 124 | public string name; 125 | public bool isToggle = false; 126 | public string[] options; 127 | 128 | public bool IsEnabled => !string.IsNullOrEmpty(name) && (isToggle || (options != null && options.Length > 0)); 129 | public string[] OptionsWithUndefined => new[] {"Undefined"}.Concat(options).ToArray(); 130 | } 131 | 132 | [System.Serializable] 133 | public class TilesetFlagsMask 134 | { 135 | public int[] flags; 136 | public bool IsUndefined => flags == null || flags.Length != Tileset.TILESET_FLAGS_COUNT; 137 | 138 | public TilesetFlagsMask() 139 | { 140 | flags = new int[Tileset.TILESET_FLAGS_COUNT]; 141 | } 142 | 143 | public TilesetFlagsMask(Color[] vertexColors) 144 | { 145 | FromVertexColors(vertexColors); 146 | } 147 | 148 | public int this[int index] 149 | { 150 | get 151 | { 152 | if (IsUndefined) return 0; 153 | return flags[index]; 154 | } 155 | set 156 | { 157 | if(IsUndefined && value == 0) return; 158 | if(IsUndefined) flags = new int[Tileset.TILESET_FLAGS_COUNT]; 159 | 160 | flags[index] = value; 161 | } 162 | } 163 | 164 | public Color[] AsVertexColors 165 | { 166 | get 167 | { 168 | if (IsUndefined) return null; 169 | 170 | var colors = new Color[Tileset.TILESET_FLAGS_COUNT / 4]; 171 | ToVertexColors(colors); 172 | return colors; 173 | } 174 | } 175 | 176 | public void ToVertexColors(Color[] colors) 177 | { 178 | if (IsUndefined) 179 | { 180 | for (int i = 0; i < colors.Length; i++) colors[i] = Color.clear; 181 | return; 182 | } 183 | 184 | for(int i = 0; i < flags.Length; i += 4) 185 | colors[i / 4] = new Color(flags[i + 0], flags[i + 1], flags[i + 2], flags[i + 3]); 186 | } 187 | 188 | public void FromVertexColors(Color[] colors) 189 | { 190 | // Make sure color array is valid 191 | if (colors == null || colors.Length * 4 != Tileset.TILESET_FLAGS_COUNT) return; 192 | 193 | // If color array is undefined (everything is 0) and we don't already have a flags array 194 | // we don't need to create one 195 | if(AreVertexColorsUndefined(colors) && flags == null) return; 196 | 197 | // Initialize a flags array if we don't have one 198 | if(flags == null) flags = new int[Tileset.TILESET_FLAGS_COUNT]; 199 | 200 | for (int i = 0; i < colors.Length; i++) 201 | { 202 | var c = colors[i]; 203 | flags[i * 4 + 0] = (int)c.r; 204 | flags[i * 4 + 1] = (int)c.g; 205 | flags[i * 4 + 2] = (int)c.b; 206 | flags[i * 4 + 3] = (int)c.a; 207 | } 208 | } 209 | 210 | public static bool AreVertexColorsUndefined(Color[] vertexColors) 211 | { 212 | for (int i = 0; i < vertexColors.Length; i++) 213 | { 214 | if (vertexColors[i] != Color.clear) return false; 215 | } 216 | 217 | return true; 218 | } 219 | 220 | public bool Matches(TilesetFlagsMask other) 221 | { 222 | if (other.IsUndefined) return true; 223 | 224 | for (int i = 0; i < other.flags.Length; i++) 225 | { 226 | if(other.flags[i] == 0) continue; 227 | if (other.flags[i] != this[i]) return false; 228 | } 229 | 230 | return true; 231 | } 232 | 233 | public void Copy(TilesetFlagsMask other) 234 | { 235 | if (other.IsUndefined) 236 | { 237 | flags = null; 238 | return; 239 | } 240 | else if(this.IsUndefined) flags = new int[Tileset.TILESET_FLAGS_COUNT]; 241 | other.flags.CopyTo(flags, 0); 242 | } 243 | } 244 | } 245 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/Tileset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b673cb90f50a46243b8c08cc2862ace4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/TilesetRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94ce60919f21b5847a9259a5a5df406c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/UtilityAttributeDrawers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | #if UNITY_EDITOR 3 | using UnityEditor; 4 | #endif 5 | using UnityEngine; 6 | 7 | namespace MeshTilesets 8 | { 9 | [AttributeUsage(AttributeTargets.Field)] 10 | public class EnabledIfAttribute : PropertyAttribute 11 | { 12 | public string boolFieldName; 13 | public bool invert; 14 | 15 | public EnabledIfAttribute(string boolFieldName, bool invert = false) 16 | { 17 | this.boolFieldName = boolFieldName; 18 | this.invert = invert; 19 | } 20 | } 21 | 22 | #if UNITY_EDITOR 23 | [CustomPropertyDrawer(typeof(EnabledIfAttribute))] 24 | public class EnabledIfAttributeDrawer : PropertyDrawer 25 | { 26 | private EnabledIfAttribute Attribute => attribute as EnabledIfAttribute; 27 | 28 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 29 | { 30 | var enabledProp = property.serializedObject.FindProperty(Attribute.boolFieldName); 31 | var enabled = enabledProp == null || enabledProp.boolValue; 32 | var wasEnabled = GUI.enabled; 33 | GUI.enabled = Attribute.invert ? !enabled : enabled; 34 | EditorGUI.PropertyField(position, property, label); 35 | GUI.enabled = wasEnabled; 36 | } 37 | } 38 | #endif 39 | } -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/UtilityAttributeDrawers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbcf5bfd04f3f8c459b12d774123453f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/com.freshlybrewedcode.MeshTilesets.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MeshTilesets", 3 | "rootNamespace": "MeshTilesets", 4 | "references": [ 5 | "GUID:1826c0224c0d048b88112c79bbb0cd85" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Runtime/com.freshlybrewedcode.MeshTilesets.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c564902498b8c5b489ba9e489914c038 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 644d95d0ba80d1e4dbf9a6fe59215a8c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70acb6cf52d55a142a5f64e401579434 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5d26f96f1e8e4244b4f70c0b9245fbb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/Materials/Metal.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: Metal 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.631 65 | - _GlossyReflections: 1 66 | - _Metallic: 1 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.8490566, g: 0.8490566, b: 0.8490566, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | m_BuildTextureStacks: [] 79 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/Materials/Metal.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32f4b37fa30f69f4daa949d0540f313d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/building_kit.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Models/building_kit.fbx -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/building_kit.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4772ec766a2757346b7cbe4d92da2c93 3 | ModelImporter: 4 | serializedVersion: 20200 5 | internalIDToNameTable: [] 6 | externalObjects: {} 7 | materials: 8 | materialImportMode: 2 9 | materialName: 0 10 | materialSearch: 1 11 | materialLocation: 1 12 | animations: 13 | legacyGenerateAnimations: 4 14 | bakeSimulation: 0 15 | resampleCurves: 1 16 | optimizeGameObjects: 0 17 | motionNodeName: 18 | rigImportErrors: 19 | rigImportWarnings: 20 | animationImportErrors: 21 | animationImportWarnings: 22 | animationRetargetingWarnings: 23 | animationDoRetargetingWarnings: 0 24 | importAnimatedCustomProperties: 0 25 | importConstraints: 0 26 | animationCompression: 1 27 | animationRotationError: 0.5 28 | animationPositionError: 0.5 29 | animationScaleError: 0.5 30 | animationWrapMode: 0 31 | extraExposedTransformPaths: [] 32 | extraUserProperties: [] 33 | clipAnimations: [] 34 | isReadable: 0 35 | meshes: 36 | lODScreenPercentages: [] 37 | globalScale: 1 38 | meshCompression: 0 39 | addColliders: 0 40 | useSRGBMaterialColor: 1 41 | sortHierarchyByName: 1 42 | importVisibility: 1 43 | importBlendShapes: 1 44 | importCameras: 1 45 | importLights: 1 46 | fileIdsGeneration: 2 47 | swapUVChannels: 0 48 | generateSecondaryUV: 0 49 | useFileUnits: 1 50 | keepQuads: 0 51 | weldVertices: 1 52 | bakeAxisConversion: 0 53 | preserveHierarchy: 0 54 | skinWeightsMode: 0 55 | maxBonesPerVertex: 4 56 | minBoneWeight: 0.001 57 | meshOptimizationFlags: -1 58 | indexFormat: 0 59 | secondaryUVAngleDistortion: 8 60 | secondaryUVAreaDistortion: 15.000001 61 | secondaryUVHardAngle: 88 62 | secondaryUVMarginMethod: 1 63 | secondaryUVMinLightmapResolution: 40 64 | secondaryUVMinObjectScale: 1 65 | secondaryUVPackMargin: 4 66 | useFileScale: 0 67 | tangentSpace: 68 | normalSmoothAngle: 60 69 | normalImportMode: 0 70 | tangentImportMode: 3 71 | normalCalculationMode: 4 72 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 73 | blendShapeNormalImportMode: 1 74 | normalSmoothingSource: 0 75 | referencedClips: [] 76 | importAnimation: 1 77 | humanDescription: 78 | serializedVersion: 3 79 | human: [] 80 | skeleton: [] 81 | armTwist: 0.5 82 | foreArmTwist: 0.5 83 | upperLegTwist: 0.5 84 | legTwist: 0.5 85 | armStretch: 0.05 86 | legStretch: 0.05 87 | feetSpacing: 0 88 | globalScale: 1 89 | rootMotionBoneName: 90 | hasTranslationDoF: 0 91 | hasExtraRoot: 0 92 | skeletonHasParents: 1 93 | lastHumanDescriptionAvatarSource: {instanceID: 0} 94 | autoGenerateAvatarMappingIfUnspecified: 1 95 | animationType: 2 96 | humanoidOversampling: 1 97 | avatarSetup: 0 98 | addHumanoidExtraRootOnlyWhenUsingAvatar: 1 99 | additionalBone: 0 100 | userData: 101 | assetBundleName: 102 | assetBundleVariant: 103 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/catwalk_kit.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Models/catwalk_kit.fbx -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/catwalk_kit.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 542df1a1df38e2742be418ee961ab2ac 3 | ModelImporter: 4 | serializedVersion: 20200 5 | internalIDToNameTable: [] 6 | externalObjects: 7 | - first: 8 | type: UnityEngine:Material 9 | assembly: UnityEngine.CoreModule 10 | name: No Name 11 | second: {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 12 | materials: 13 | materialImportMode: 2 14 | materialName: 0 15 | materialSearch: 1 16 | materialLocation: 1 17 | animations: 18 | legacyGenerateAnimations: 4 19 | bakeSimulation: 0 20 | resampleCurves: 1 21 | optimizeGameObjects: 0 22 | motionNodeName: 23 | rigImportErrors: 24 | rigImportWarnings: 25 | animationImportErrors: 26 | animationImportWarnings: 27 | animationRetargetingWarnings: 28 | animationDoRetargetingWarnings: 0 29 | importAnimatedCustomProperties: 0 30 | importConstraints: 0 31 | animationCompression: 1 32 | animationRotationError: 0.5 33 | animationPositionError: 0.5 34 | animationScaleError: 0.5 35 | animationWrapMode: 0 36 | extraExposedTransformPaths: [] 37 | extraUserProperties: [] 38 | clipAnimations: [] 39 | isReadable: 0 40 | meshes: 41 | lODScreenPercentages: [] 42 | globalScale: 1 43 | meshCompression: 0 44 | addColliders: 0 45 | useSRGBMaterialColor: 1 46 | sortHierarchyByName: 1 47 | importVisibility: 1 48 | importBlendShapes: 1 49 | importCameras: 1 50 | importLights: 1 51 | fileIdsGeneration: 2 52 | swapUVChannels: 0 53 | generateSecondaryUV: 0 54 | useFileUnits: 1 55 | keepQuads: 0 56 | weldVertices: 1 57 | bakeAxisConversion: 0 58 | preserveHierarchy: 0 59 | skinWeightsMode: 0 60 | maxBonesPerVertex: 4 61 | minBoneWeight: 0.001 62 | meshOptimizationFlags: -1 63 | indexFormat: 0 64 | secondaryUVAngleDistortion: 8 65 | secondaryUVAreaDistortion: 15.000001 66 | secondaryUVHardAngle: 88 67 | secondaryUVMarginMethod: 1 68 | secondaryUVMinLightmapResolution: 40 69 | secondaryUVMinObjectScale: 1 70 | secondaryUVPackMargin: 4 71 | useFileScale: 1 72 | tangentSpace: 73 | normalSmoothAngle: 60 74 | normalImportMode: 0 75 | tangentImportMode: 3 76 | normalCalculationMode: 4 77 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 78 | blendShapeNormalImportMode: 1 79 | normalSmoothingSource: 0 80 | referencedClips: [] 81 | importAnimation: 1 82 | humanDescription: 83 | serializedVersion: 3 84 | human: [] 85 | skeleton: [] 86 | armTwist: 0.5 87 | foreArmTwist: 0.5 88 | upperLegTwist: 0.5 89 | legTwist: 0.5 90 | armStretch: 0.05 91 | legStretch: 0.05 92 | feetSpacing: 0 93 | globalScale: 1 94 | rootMotionBoneName: 95 | hasTranslationDoF: 0 96 | hasExtraRoot: 0 97 | skeletonHasParents: 1 98 | lastHumanDescriptionAvatarSource: {instanceID: 0} 99 | autoGenerateAvatarMappingIfUnspecified: 1 100 | animationType: 2 101 | humanoidOversampling: 1 102 | avatarSetup: 0 103 | addHumanoidExtraRootOnlyWhenUsingAvatar: 1 104 | additionalBone: 0 105 | userData: 106 | assetBundleName: 107 | assetBundleVariant: 108 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/duct_kit.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Models/duct_kit.fbx -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/duct_kit.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 507a8a0dac68213419d18fcc2eee54e6 3 | ModelImporter: 4 | serializedVersion: 20200 5 | internalIDToNameTable: [] 6 | externalObjects: {} 7 | materials: 8 | materialImportMode: 2 9 | materialName: 0 10 | materialSearch: 1 11 | materialLocation: 1 12 | animations: 13 | legacyGenerateAnimations: 4 14 | bakeSimulation: 0 15 | resampleCurves: 1 16 | optimizeGameObjects: 0 17 | motionNodeName: 18 | rigImportErrors: 19 | rigImportWarnings: 20 | animationImportErrors: 21 | animationImportWarnings: 22 | animationRetargetingWarnings: 23 | animationDoRetargetingWarnings: 0 24 | importAnimatedCustomProperties: 0 25 | importConstraints: 0 26 | animationCompression: 1 27 | animationRotationError: 0.5 28 | animationPositionError: 0.5 29 | animationScaleError: 0.5 30 | animationWrapMode: 0 31 | extraExposedTransformPaths: [] 32 | extraUserProperties: [] 33 | clipAnimations: [] 34 | isReadable: 0 35 | meshes: 36 | lODScreenPercentages: [] 37 | globalScale: 1 38 | meshCompression: 0 39 | addColliders: 0 40 | useSRGBMaterialColor: 1 41 | sortHierarchyByName: 1 42 | importVisibility: 1 43 | importBlendShapes: 1 44 | importCameras: 1 45 | importLights: 1 46 | fileIdsGeneration: 2 47 | swapUVChannels: 0 48 | generateSecondaryUV: 0 49 | useFileUnits: 0 50 | keepQuads: 0 51 | weldVertices: 1 52 | bakeAxisConversion: 0 53 | preserveHierarchy: 0 54 | skinWeightsMode: 0 55 | maxBonesPerVertex: 4 56 | minBoneWeight: 0.001 57 | meshOptimizationFlags: -1 58 | indexFormat: 0 59 | secondaryUVAngleDistortion: 8 60 | secondaryUVAreaDistortion: 15.000001 61 | secondaryUVHardAngle: 88 62 | secondaryUVMarginMethod: 1 63 | secondaryUVMinLightmapResolution: 40 64 | secondaryUVMinObjectScale: 1 65 | secondaryUVPackMargin: 4 66 | useFileScale: 0 67 | tangentSpace: 68 | normalSmoothAngle: 60 69 | normalImportMode: 0 70 | tangentImportMode: 3 71 | normalCalculationMode: 4 72 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 73 | blendShapeNormalImportMode: 1 74 | normalSmoothingSource: 0 75 | referencedClips: [] 76 | importAnimation: 1 77 | humanDescription: 78 | serializedVersion: 3 79 | human: [] 80 | skeleton: [] 81 | armTwist: 0.5 82 | foreArmTwist: 0.5 83 | upperLegTwist: 0.5 84 | legTwist: 0.5 85 | armStretch: 0.05 86 | legStretch: 0.05 87 | feetSpacing: 0 88 | globalScale: 1 89 | rootMotionBoneName: 90 | hasTranslationDoF: 0 91 | hasExtraRoot: 0 92 | skeletonHasParents: 1 93 | lastHumanDescriptionAvatarSource: {instanceID: 0} 94 | autoGenerateAvatarMappingIfUnspecified: 1 95 | animationType: 2 96 | humanoidOversampling: 1 97 | avatarSetup: 0 98 | addHumanoidExtraRootOnlyWhenUsingAvatar: 1 99 | additionalBone: 0 100 | userData: 101 | assetBundleName: 102 | assetBundleVariant: 103 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/pipe_kit.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Models/pipe_kit.fbx -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/pipe_kit.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52d41529ac62dd741863220baea8e50f 3 | ModelImporter: 4 | serializedVersion: 20200 5 | internalIDToNameTable: [] 6 | externalObjects: 7 | - first: 8 | type: UnityEngine:Material 9 | assembly: UnityEngine.CoreModule 10 | name: No Name 11 | second: {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 12 | materials: 13 | materialImportMode: 2 14 | materialName: 0 15 | materialSearch: 1 16 | materialLocation: 1 17 | animations: 18 | legacyGenerateAnimations: 4 19 | bakeSimulation: 0 20 | resampleCurves: 1 21 | optimizeGameObjects: 0 22 | motionNodeName: 23 | rigImportErrors: 24 | rigImportWarnings: 25 | animationImportErrors: 26 | animationImportWarnings: 27 | animationRetargetingWarnings: 28 | animationDoRetargetingWarnings: 0 29 | importAnimatedCustomProperties: 0 30 | importConstraints: 0 31 | animationCompression: 1 32 | animationRotationError: 0.5 33 | animationPositionError: 0.5 34 | animationScaleError: 0.5 35 | animationWrapMode: 0 36 | extraExposedTransformPaths: [] 37 | extraUserProperties: [] 38 | clipAnimations: [] 39 | isReadable: 0 40 | meshes: 41 | lODScreenPercentages: [] 42 | globalScale: 1 43 | meshCompression: 0 44 | addColliders: 0 45 | useSRGBMaterialColor: 1 46 | sortHierarchyByName: 1 47 | importVisibility: 1 48 | importBlendShapes: 1 49 | importCameras: 1 50 | importLights: 1 51 | fileIdsGeneration: 2 52 | swapUVChannels: 0 53 | generateSecondaryUV: 0 54 | useFileUnits: 1 55 | keepQuads: 0 56 | weldVertices: 1 57 | bakeAxisConversion: 0 58 | preserveHierarchy: 0 59 | skinWeightsMode: 0 60 | maxBonesPerVertex: 4 61 | minBoneWeight: 0.001 62 | meshOptimizationFlags: -1 63 | indexFormat: 0 64 | secondaryUVAngleDistortion: 8 65 | secondaryUVAreaDistortion: 15.000001 66 | secondaryUVHardAngle: 88 67 | secondaryUVMarginMethod: 1 68 | secondaryUVMinLightmapResolution: 40 69 | secondaryUVMinObjectScale: 1 70 | secondaryUVPackMargin: 4 71 | useFileScale: 0 72 | tangentSpace: 73 | normalSmoothAngle: 60 74 | normalImportMode: 0 75 | tangentImportMode: 3 76 | normalCalculationMode: 4 77 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 78 | blendShapeNormalImportMode: 1 79 | normalSmoothingSource: 0 80 | referencedClips: [] 81 | importAnimation: 1 82 | humanDescription: 83 | serializedVersion: 3 84 | human: [] 85 | skeleton: [] 86 | armTwist: 0.5 87 | foreArmTwist: 0.5 88 | upperLegTwist: 0.5 89 | legTwist: 0.5 90 | armStretch: 0.05 91 | legStretch: 0.05 92 | feetSpacing: 0 93 | globalScale: 1 94 | rootMotionBoneName: 95 | hasTranslationDoF: 0 96 | hasExtraRoot: 0 97 | skeletonHasParents: 1 98 | lastHumanDescriptionAvatarSource: {instanceID: 0} 99 | autoGenerateAvatarMappingIfUnspecified: 1 100 | animationType: 2 101 | humanoidOversampling: 1 102 | avatarSetup: 0 103 | addHumanoidExtraRootOnlyWhenUsingAvatar: 1 104 | additionalBone: 0 105 | userData: 106 | assetBundleName: 107 | assetBundleVariant: 108 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/railing_kit.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Models/railing_kit.fbx -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Models/railing_kit.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfa51353faefb6d4d9187535951e5933 3 | ModelImporter: 4 | serializedVersion: 20200 5 | internalIDToNameTable: [] 6 | externalObjects: {} 7 | materials: 8 | materialImportMode: 2 9 | materialName: 0 10 | materialSearch: 1 11 | materialLocation: 1 12 | animations: 13 | legacyGenerateAnimations: 4 14 | bakeSimulation: 0 15 | resampleCurves: 1 16 | optimizeGameObjects: 0 17 | motionNodeName: 18 | rigImportErrors: 19 | rigImportWarnings: 20 | animationImportErrors: 21 | animationImportWarnings: 22 | animationRetargetingWarnings: 23 | animationDoRetargetingWarnings: 0 24 | importAnimatedCustomProperties: 0 25 | importConstraints: 0 26 | animationCompression: 1 27 | animationRotationError: 0.5 28 | animationPositionError: 0.5 29 | animationScaleError: 0.5 30 | animationWrapMode: 0 31 | extraExposedTransformPaths: [] 32 | extraUserProperties: [] 33 | clipAnimations: [] 34 | isReadable: 0 35 | meshes: 36 | lODScreenPercentages: [] 37 | globalScale: 1 38 | meshCompression: 0 39 | addColliders: 0 40 | useSRGBMaterialColor: 1 41 | sortHierarchyByName: 1 42 | importVisibility: 1 43 | importBlendShapes: 1 44 | importCameras: 1 45 | importLights: 1 46 | fileIdsGeneration: 2 47 | swapUVChannels: 0 48 | generateSecondaryUV: 0 49 | useFileUnits: 1 50 | keepQuads: 0 51 | weldVertices: 1 52 | bakeAxisConversion: 0 53 | preserveHierarchy: 0 54 | skinWeightsMode: 0 55 | maxBonesPerVertex: 4 56 | minBoneWeight: 0.001 57 | meshOptimizationFlags: -1 58 | indexFormat: 0 59 | secondaryUVAngleDistortion: 8 60 | secondaryUVAreaDistortion: 15.000001 61 | secondaryUVHardAngle: 88 62 | secondaryUVMarginMethod: 1 63 | secondaryUVMinLightmapResolution: 40 64 | secondaryUVMinObjectScale: 1 65 | secondaryUVPackMargin: 4 66 | useFileScale: 0 67 | tangentSpace: 68 | normalSmoothAngle: 60 69 | normalImportMode: 0 70 | tangentImportMode: 3 71 | normalCalculationMode: 4 72 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 73 | blendShapeNormalImportMode: 1 74 | normalSmoothingSource: 0 75 | referencedClips: [] 76 | importAnimation: 1 77 | humanDescription: 78 | serializedVersion: 3 79 | human: [] 80 | skeleton: [] 81 | armTwist: 0.5 82 | foreArmTwist: 0.5 83 | upperLegTwist: 0.5 84 | legTwist: 0.5 85 | armStretch: 0.05 86 | legStretch: 0.05 87 | feetSpacing: 0 88 | globalScale: 1 89 | rootMotionBoneName: 90 | hasTranslationDoF: 0 91 | hasExtraRoot: 0 92 | skeletonHasParents: 1 93 | lastHumanDescriptionAvatarSource: {instanceID: 0} 94 | autoGenerateAvatarMappingIfUnspecified: 1 95 | animationType: 2 96 | humanoidOversampling: 1 97 | avatarSetup: 0 98 | addHumanoidExtraRootOnlyWhenUsingAvatar: 1 99 | additionalBone: 0 100 | userData: 101 | assetBundleName: 102 | assetBundleVariant: 103 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9de5df922be70854b93024670993d343 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b5ddca647ddebc478b6e6146e1917ef 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/LightingData.asset -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b802563feedb1c45b5a3a4acac47517 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-0_comp_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-0_comp_dir.png -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-0_comp_dir.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2f950c4b443ca5468951423a7ffebbb 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 0 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 3 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 2 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-0_comp_light.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-0_comp_light.exr -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-0_comp_light.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1664728fe7e9064f91a285a96857740 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 3 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 0 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 6 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 2 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-0_comp_shadowmask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-0_comp_shadowmask.png -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-0_comp_shadowmask.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1535f210abf313545886baa11f4e0464 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 0 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 3 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 0 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 11 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-1_comp_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-1_comp_dir.png -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-1_comp_dir.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28883ad312ea3234ba2babae11c43a7c 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 0 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 3 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 2 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-1_comp_light.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-1_comp_light.exr -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-1_comp_light.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a47a6611dd42b644daacb6b7442ce9a7 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 3 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 0 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 6 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 2 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-1_comp_shadowmask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-1_comp_shadowmask.png -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-1_comp_shadowmask.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07c96a39861a135448f65765bc810695 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 0 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 3 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 0 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 11 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-2_comp_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-2_comp_dir.png -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-2_comp_dir.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a52607b9b962fd46858c96b0b18f17d 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 0 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 3 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 2 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-2_comp_light.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-2_comp_light.exr -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-2_comp_light.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe601d8dceb0c9946ba64791681dd355 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 3 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 0 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 6 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 2 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-2_comp_shadowmask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-2_comp_shadowmask.png -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/Lightmap-2_comp_shadowmask.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 803c1a80223a3fe44b453c8eeb8b87c4 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 0 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 1 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 3 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 0 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 11 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Assets/Mesh Tilesets/Samples/Scenes/SampleScene/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f181a4f4502a18f42981f405eabd5b51 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 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 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 1 30 | seamlessCubemap: 1 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 2 36 | aniso: 0 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 1 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 2 57 | singleChannelComponent: 0 58 | maxTextureSizeSet: 0 59 | compressionQualitySet: 0 60 | textureFormatSet: 0 61 | ignorePngGamma: 0 62 | applyGammaDecoding: 0 63 | platformSettings: 64 | - serializedVersion: 3 65 | buildTarget: DefaultTexturePlatform 66 | maxTextureSize: 2048 67 | resizeAlgorithm: 0 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 100 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | androidETC2FallbackOverride: 0 75 | forceMaximumCompressionQuality_BC6H_BC7: 0 76 | spriteSheet: 77 | serializedVersion: 2 78 | sprites: [] 79 | outline: [] 80 | physicsShape: [] 81 | bones: [] 82 | spriteID: 83 | internalID: 0 84 | vertices: [] 85 | indices: 86 | edges: [] 87 | weights: [] 88 | secondaryTextures: [] 89 | spritePackingTag: 90 | pSDRemoveMatte: 0 91 | pSDShowRemoveMatteOption: 0 92 | userData: 93 | assetBundleName: 94 | assetBundleVariant: 95 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleSceneSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: SampleSceneSettings 10 | serializedVersion: 3 11 | m_GIWorkflowMode: 1 12 | m_EnableBakedLightmaps: 1 13 | m_EnableRealtimeLightmaps: 0 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 1 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_TextureCompression: 1 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 500 45 | m_PVREnvironmentSampleCount: 500 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 1 50 | m_PVREnvironmentMIS: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleSceneSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfc52d361e226b645b88f9f0a076bb5d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene_Profiles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4db63a6b9236ff94ba2170213794a55f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene_Profiles/Post-process Volume Profile.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: 8e6292b2c06870d4495f009f912b9600, type: 3} 13 | m_Name: Post-process Volume Profile 14 | m_EditorClassIdentifier: 15 | settings: 16 | - {fileID: 7510878485596943599} 17 | --- !u!114 &7510878485596943599 18 | MonoBehaviour: 19 | m_ObjectHideFlags: 3 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_GameObject: {fileID: 0} 24 | m_Enabled: 1 25 | m_EditorHideFlags: 0 26 | m_Script: {fileID: 11500000, guid: c1cb7e9e120078f43bce4f0b1be547a7, type: 3} 27 | m_Name: AmbientOcclusion 28 | m_EditorClassIdentifier: 29 | active: 1 30 | enabled: 31 | overrideState: 1 32 | value: 1 33 | mode: 34 | overrideState: 1 35 | value: 1 36 | intensity: 37 | overrideState: 1 38 | value: 0.28 39 | color: 40 | overrideState: 0 41 | value: {r: 0, g: 0, b: 0, a: 1} 42 | ambientOnly: 43 | overrideState: 0 44 | value: 1 45 | noiseFilterTolerance: 46 | overrideState: 0 47 | value: 0 48 | blurTolerance: 49 | overrideState: 0 50 | value: -4.6 51 | upsampleTolerance: 52 | overrideState: 0 53 | value: -12 54 | thicknessModifier: 55 | overrideState: 0 56 | value: 1 57 | directLightingStrength: 58 | overrideState: 0 59 | value: 0 60 | radius: 61 | overrideState: 1 62 | value: 0.06 63 | quality: 64 | overrideState: 0 65 | value: 2 66 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Scenes/SampleScene_Profiles/Post-process Volume Profile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f9937d7b3854904db929a0b33508a9c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Tilesets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 142cad81eb3ee9e4d8b1b11980574feb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Tilesets/Duct_Tileset.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a16ff138f255cc34687697e72ee2d952 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Tilesets/Pipe_Tileset.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f8cf8d5ea43a614eab49b25fac2ba5f 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Tilesets/Railing_Tileset.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21fa0443a629d934fa27c48d8f942a82 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Tilesets/building_kitTileset.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4b3860027af21342904e57dcc9d0eb5 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/Samples/Tilesets/catwalk_kitTileset.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46448b22a87a22748b85320a53865a29 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.freshlybrewedcode.unity-mesh-tilesets", 3 | "version": "1.0.4", 4 | "displayName": "Mesh Tilesets", 5 | "description": "a Unity plugin to place objects along ProBuilder meshes based on rules from tileset. Heavily inspired by the tooling in Source 2.", 6 | "unity": "2020.2", 7 | "author": { 8 | "name": "FreshlyBrewedCode", 9 | "url": "https://github.com/FreshlyBrewedCode" 10 | }, 11 | "dependencies": { 12 | "com.unity.probuilder": "4.2.3" 13 | }, 14 | "scopedRegistries": [], 15 | "samples": [ 16 | { 17 | "displayName": "Example Tilesets", 18 | "description": "Examples tilesets for pipes, ducts, railings, catwalks and buildings.", 19 | "path": "Samples~" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Mesh Tilesets/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7972438ae8b60e341817393e67895311 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Docs/Components.md: -------------------------------------------------------------------------------- 1 | # Component Reference 2 | 3 | - [Component Reference](#component-reference) 4 | - [TilesetRenderer](#tilesetrenderer) 5 | - [Tileset](#tileset) 6 | - [Tile](#tile) 7 | 8 | 9 | ## TilesetRenderer 10 | 11 | ![TilesetRenderer Inspector](/Docs/Media/tileset_renderer.png) 12 | 13 | The `TilesetRenderer` component should be placed on the ProBuilder mesh. It is responsible for analyzing the mesh and finding tile instances, and placing matching tiles from the assigned tileset. 14 | 15 | Note that the `TilesetRenderer` will assign a special material to the ProBuilder mesh that simply hides the entire mesh. The mesh itself is visualized using gizmos. 16 | 17 | The tiles created by the `TilesetRenderer` are created as children of the mesh GameObject but are **hidden by default** to reduce clutter in the hierarchy. Additionally, **scene view selection is also disabled for all tiles**. Because of this you have to select the mesh GameObject from the hierarchy are click on the invisible mesh in the scene view (Clicking just on the tiles in the scene view won't work). 18 | 19 | Also, **do not add children to the mesh GameObject**. The `TilesetRenderer` will frequently remove/disable its children. 20 | 21 | If at any point you don't want to use the `TilesetRenderer` anymore but work with the individual generated tiles you can simply remove the `TilesetRenderer` component. This will show all tiles. 22 | 23 | The `TilesetRenderer` component should not be used to create tiles at runtime. The package included a scene post processor that will remove all `TilesetRenderer` components from the scene for builds. 24 | 25 | The following table shows a list of options you can configure in the inspector: 26 | 27 | | Option | Description | 28 | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 29 | | Tileset | The tileset component that should be used. Drag your tileset Prafab here. | 30 | | Tile Size Match | The method that should be used to compare the size (width/height) of the tiles. `Exact` will **only** match a tile if it is exactly the same size as the tile instance. `Closest Match` will **always** match the tile that is closest (useful if you want more loose tile placement like the railing tileset). | 31 | | Prefer Fewer Rotations | The `TilesetRenderer` will rotate a tile if its orientation does not match initially with the orientation of the tile instance. If this option is enabled tiles that can be matched with fewer rotations are preferred. This is useful for tilesets that contain tiles with fixed orientations (i.e. the railing tileset). | 32 | | Tile Orientation | The method that should be used to determine the orientation of the tile instances. Default is `From Vertex Order` which is fine for most tilesets that do not depend on fixed tile orientations. The other options can be used to determine orientation based on world/object space orientation. You can enable the `Orientation` option in the `Visualization` section to display the orientation of each tile instance in the mesh. | 33 | | Selected Tile | Shows debug information about the selected tile instance (the selected face) and allows you to edit the tile flags. | 34 | | Visualization | Allows you to select different visualization options for the tile instances (mainly for debugging). `Edge Flags` shows the adjacency of each tile instance using small spheres at the edges. The color indicates convex (red) or concave (green) edges. | 35 | | Debug | Some debug buttons to fix problems with the tiles. If something does not look right, tiles are not refreshed or cleaned up properly try to press "Clear Pool", "Rebuild Pool", and "Full Refresh". This will delete all tiles from the pool an perform a full refresh of the tile instances. | 36 | 37 | ## Tileset 38 | 39 | *TODO* 40 | 41 | ## Tile 42 | 43 | *TODO* -------------------------------------------------------------------------------- /Docs/Media/building_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/building_example.png -------------------------------------------------------------------------------- /Docs/Media/catwalk_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/catwalk_example.png -------------------------------------------------------------------------------- /Docs/Media/duct_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/duct_example.png -------------------------------------------------------------------------------- /Docs/Media/pipe_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/pipe_tileset.png -------------------------------------------------------------------------------- /Docs/Media/pipes_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/pipes_example.png -------------------------------------------------------------------------------- /Docs/Media/railing_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/railing_example.png -------------------------------------------------------------------------------- /Docs/Media/rectangular_quads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/rectangular_quads.png -------------------------------------------------------------------------------- /Docs/Media/showcase.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/showcase.gif -------------------------------------------------------------------------------- /Docs/Media/simple_pipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/simple_pipe.png -------------------------------------------------------------------------------- /Docs/Media/tileset_renderer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreshlyBrewedCode/unity-mesh-tilesets/bc22e306b50379122a8ce8898fc66e181c833365/Docs/Media/tileset_renderer.png -------------------------------------------------------------------------------- /Docs/README.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | - [Documentation](#documentation) 4 | - [Installation](#installation) 5 | - [Getting Started](#getting-started) 6 | - [Using the example pipes tileset](#using-the-example-pipes-tileset) 7 | - [Creating Tilesets](#creating-tilesets) 8 | - [Components](#components) 9 | 10 | ## Installation 11 | 12 | Check out the [installation section](/README.md#installation) in the main README. 13 | 14 | ## Getting Started 15 | 16 | First, you should familiarize yourself with the basic concept of the tool. You can find a [basic explanation of how the tool works](/README.md#how-it-works) in the main README. Additionally, I would highly recommend to check out the Half Life Alyx workshop tools for yourself and take a look at how Valve used this kind of tooling in the game. After all, this is what inspired the tool in the first place. 17 | 18 | You can also take a look at the [included samples](/Assets/Mesh%20Tilesets/Samples). You can import them into your project from the package manager window. 19 | 20 | ### Using the example pipes tileset 21 | 22 | In this section I will break down the included example pipes tileset, how to use it and how it works. 23 | 24 | First, let's take a look at the content of pipe tileset: 25 | 26 | 1. Import the example tilesets (Package Manager > Mesh Tilesets > Samples > Example Tilesets) 27 | 2. Open the `Pipe_Tileset` prefab (`Assets/Samples/Mesh Tilesets//Tilesets`) 28 | 29 | You should be able to see the all the tiles from the tileset in the scene view: 30 | 31 | ![Pipe Tileset](/Docs/Media/pipe_tileset.png) 32 | 33 | Each tile is a child of the tileset prefab. If you zoom in on one of tiles you can see the width and height indicated by the numbers as well as the orientation indicated by the small arrow gizmos. The red arrow points towards the "right" of the tile and the green arrow towards the "top". If you select one of the tiles from the hierarchy or the scene view you can see the `Tile` component in the inspector. Here you can find the settings of the tile including the width/height and the adjacency rules ("edge flags"). 34 | 35 | As you can see, the pipe tileset works with tiles that use whole unit increments for their width and height (1x1, 1x2, etc.). Because of this, it is best to set the grid size/increment size to 1 unit when working with this tileset. 36 | 37 | Let's use the tileset in a scene. 38 | 39 | 1. Open an existing or new scene. 40 | 2. Open the ProBuilder window (Tools > ProBuilder > ProBuilder Window) 41 | 3. Click the plus icon next to the "New Shape" option at the top of the ProBuilder window 42 | 4. Create a simple quad by selecting the "Plane" shape and setting width and length segments to 0. 43 | 5. Select the new GameObject and add the `TilesetRenderer` component. 44 | 6. Drag the `Pipe_Tileset` Prefab on the `Tileset` field of the `TilesetRenderer` component. 45 | 7. Go into ProBuilders edge mode and extrude one edge of the plane to you end up with two connected 1x1 quads (hold shift and drag to extrude using ProBuilder) 46 | 47 | You should end up with something like this: 48 | 49 | ![Simple Pipe](/Docs/Media/simple_pipe.png) 50 | 51 | You probably noticed that the two end pieces of the pipe appeared as soon as you extruded the second quad. This is because before the extrusion no tile of the tileset matched the tile instance in the mesh. 52 | 53 | You can keep extruding the mesh to add more segments to the pipe and experiment with bends and longer segments. Note that you are still just editing a primitive mesh using ProBuilder so you are not limited to just extruding the mesh. However, the `TilesetRenderer` will only create tile instances for rectangular quads. Any other faces will also appear red in the scene view: 54 | 55 | ![Invalid Mesh](/Docs/Media/rectangular_quads.png) 56 | 57 | Take a look at the next section to learn how you can create your own tilesets. Or check out the [component reference][Components] for more information on the individual components and fields. 58 | 59 | ## Creating Tilesets 60 | 61 | *TODO* 62 | 63 | ## Components 64 | 65 | See the [component reference][Components] for an overview of the individual components. 66 | 67 | 68 | [Components]: /Docs/Components.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Karl Moeller 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.collab-proxy": "1.3.9", 4 | "com.unity.ide.rider": "2.0.7", 5 | "com.unity.ide.visualstudio": "2.0.5", 6 | "com.unity.ide.vscode": "1.2.3", 7 | "com.unity.polybrush": "1.0.2", 8 | "com.unity.postprocessing": "2.3.0", 9 | "com.unity.probuilder": "4.2.3", 10 | "com.unity.progrids": "3.0.3-preview.6", 11 | "com.unity.test-framework": "1.1.19", 12 | "com.unity.textmeshpro": "3.0.1", 13 | "com.unity.timeline": "1.3.5", 14 | "com.unity.ugui": "1.0.0", 15 | "com.unity.modules.ai": "1.0.0", 16 | "com.unity.modules.androidjni": "1.0.0", 17 | "com.unity.modules.animation": "1.0.0", 18 | "com.unity.modules.assetbundle": "1.0.0", 19 | "com.unity.modules.audio": "1.0.0", 20 | "com.unity.modules.cloth": "1.0.0", 21 | "com.unity.modules.director": "1.0.0", 22 | "com.unity.modules.imageconversion": "1.0.0", 23 | "com.unity.modules.imgui": "1.0.0", 24 | "com.unity.modules.jsonserialize": "1.0.0", 25 | "com.unity.modules.particlesystem": "1.0.0", 26 | "com.unity.modules.physics": "1.0.0", 27 | "com.unity.modules.physics2d": "1.0.0", 28 | "com.unity.modules.screencapture": "1.0.0", 29 | "com.unity.modules.terrain": "1.0.0", 30 | "com.unity.modules.terrainphysics": "1.0.0", 31 | "com.unity.modules.tilemap": "1.0.0", 32 | "com.unity.modules.ui": "1.0.0", 33 | "com.unity.modules.uielements": "1.0.0", 34 | "com.unity.modules.umbra": "1.0.0", 35 | "com.unity.modules.unityanalytics": "1.0.0", 36 | "com.unity.modules.unitywebrequest": "1.0.0", 37 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 38 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 39 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 40 | "com.unity.modules.unitywebrequestwww": "1.0.0", 41 | "com.unity.modules.vehicles": "1.0.0", 42 | "com.unity.modules.video": "1.0.0", 43 | "com.unity.modules.vr": "1.0.0", 44 | "com.unity.modules.wind": "1.0.0", 45 | "com.unity.modules.xr": "1.0.0" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": { 4 | "version": "1.3.9", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.ext.nunit": { 11 | "version": "1.0.5", 12 | "depth": 1, 13 | "source": "registry", 14 | "dependencies": {}, 15 | "url": "https://packages.unity.com" 16 | }, 17 | "com.unity.ide.rider": { 18 | "version": "2.0.7", 19 | "depth": 0, 20 | "source": "registry", 21 | "dependencies": { 22 | "com.unity.test-framework": "1.1.1" 23 | }, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.ide.visualstudio": { 27 | "version": "2.0.5", 28 | "depth": 0, 29 | "source": "registry", 30 | "dependencies": {}, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.ide.vscode": { 34 | "version": "1.2.3", 35 | "depth": 0, 36 | "source": "registry", 37 | "dependencies": {}, 38 | "url": "https://packages.unity.com" 39 | }, 40 | "com.unity.polybrush": { 41 | "version": "1.0.2", 42 | "depth": 0, 43 | "source": "registry", 44 | "dependencies": { 45 | "com.unity.settings-manager": "1.0.3" 46 | }, 47 | "url": "https://packages.unity.com" 48 | }, 49 | "com.unity.postprocessing": { 50 | "version": "2.3.0", 51 | "depth": 0, 52 | "source": "registry", 53 | "dependencies": {}, 54 | "url": "https://packages.unity.com" 55 | }, 56 | "com.unity.probuilder": { 57 | "version": "4.2.3", 58 | "depth": 0, 59 | "source": "registry", 60 | "dependencies": { 61 | "com.unity.settings-manager": "1.0.0" 62 | }, 63 | "url": "https://packages.unity.com" 64 | }, 65 | "com.unity.progrids": { 66 | "version": "3.0.3-preview.6", 67 | "depth": 0, 68 | "source": "registry", 69 | "dependencies": { 70 | "com.unity.settings-manager": "1.0.2" 71 | }, 72 | "url": "https://packages.unity.com" 73 | }, 74 | "com.unity.settings-manager": { 75 | "version": "1.0.3", 76 | "depth": 1, 77 | "source": "registry", 78 | "dependencies": {}, 79 | "url": "https://packages.unity.com" 80 | }, 81 | "com.unity.test-framework": { 82 | "version": "1.1.19", 83 | "depth": 0, 84 | "source": "registry", 85 | "dependencies": { 86 | "com.unity.ext.nunit": "1.0.5", 87 | "com.unity.modules.imgui": "1.0.0", 88 | "com.unity.modules.jsonserialize": "1.0.0" 89 | }, 90 | "url": "https://packages.unity.com" 91 | }, 92 | "com.unity.textmeshpro": { 93 | "version": "3.0.1", 94 | "depth": 0, 95 | "source": "registry", 96 | "dependencies": { 97 | "com.unity.ugui": "1.0.0" 98 | }, 99 | "url": "https://packages.unity.com" 100 | }, 101 | "com.unity.timeline": { 102 | "version": "1.3.5", 103 | "depth": 0, 104 | "source": "registry", 105 | "dependencies": {}, 106 | "url": "https://packages.unity.com" 107 | }, 108 | "com.unity.ugui": { 109 | "version": "1.0.0", 110 | "depth": 0, 111 | "source": "builtin", 112 | "dependencies": { 113 | "com.unity.modules.ui": "1.0.0", 114 | "com.unity.modules.imgui": "1.0.0" 115 | } 116 | }, 117 | "com.unity.modules.ai": { 118 | "version": "1.0.0", 119 | "depth": 0, 120 | "source": "builtin", 121 | "dependencies": {} 122 | }, 123 | "com.unity.modules.androidjni": { 124 | "version": "1.0.0", 125 | "depth": 0, 126 | "source": "builtin", 127 | "dependencies": {} 128 | }, 129 | "com.unity.modules.animation": { 130 | "version": "1.0.0", 131 | "depth": 0, 132 | "source": "builtin", 133 | "dependencies": {} 134 | }, 135 | "com.unity.modules.assetbundle": { 136 | "version": "1.0.0", 137 | "depth": 0, 138 | "source": "builtin", 139 | "dependencies": {} 140 | }, 141 | "com.unity.modules.audio": { 142 | "version": "1.0.0", 143 | "depth": 0, 144 | "source": "builtin", 145 | "dependencies": {} 146 | }, 147 | "com.unity.modules.cloth": { 148 | "version": "1.0.0", 149 | "depth": 0, 150 | "source": "builtin", 151 | "dependencies": { 152 | "com.unity.modules.physics": "1.0.0" 153 | } 154 | }, 155 | "com.unity.modules.director": { 156 | "version": "1.0.0", 157 | "depth": 0, 158 | "source": "builtin", 159 | "dependencies": { 160 | "com.unity.modules.audio": "1.0.0", 161 | "com.unity.modules.animation": "1.0.0" 162 | } 163 | }, 164 | "com.unity.modules.imageconversion": { 165 | "version": "1.0.0", 166 | "depth": 0, 167 | "source": "builtin", 168 | "dependencies": {} 169 | }, 170 | "com.unity.modules.imgui": { 171 | "version": "1.0.0", 172 | "depth": 0, 173 | "source": "builtin", 174 | "dependencies": {} 175 | }, 176 | "com.unity.modules.jsonserialize": { 177 | "version": "1.0.0", 178 | "depth": 0, 179 | "source": "builtin", 180 | "dependencies": {} 181 | }, 182 | "com.unity.modules.particlesystem": { 183 | "version": "1.0.0", 184 | "depth": 0, 185 | "source": "builtin", 186 | "dependencies": {} 187 | }, 188 | "com.unity.modules.physics": { 189 | "version": "1.0.0", 190 | "depth": 0, 191 | "source": "builtin", 192 | "dependencies": {} 193 | }, 194 | "com.unity.modules.physics2d": { 195 | "version": "1.0.0", 196 | "depth": 0, 197 | "source": "builtin", 198 | "dependencies": {} 199 | }, 200 | "com.unity.modules.screencapture": { 201 | "version": "1.0.0", 202 | "depth": 0, 203 | "source": "builtin", 204 | "dependencies": { 205 | "com.unity.modules.imageconversion": "1.0.0" 206 | } 207 | }, 208 | "com.unity.modules.subsystems": { 209 | "version": "1.0.0", 210 | "depth": 1, 211 | "source": "builtin", 212 | "dependencies": { 213 | "com.unity.modules.jsonserialize": "1.0.0" 214 | } 215 | }, 216 | "com.unity.modules.terrain": { 217 | "version": "1.0.0", 218 | "depth": 0, 219 | "source": "builtin", 220 | "dependencies": {} 221 | }, 222 | "com.unity.modules.terrainphysics": { 223 | "version": "1.0.0", 224 | "depth": 0, 225 | "source": "builtin", 226 | "dependencies": { 227 | "com.unity.modules.physics": "1.0.0", 228 | "com.unity.modules.terrain": "1.0.0" 229 | } 230 | }, 231 | "com.unity.modules.tilemap": { 232 | "version": "1.0.0", 233 | "depth": 0, 234 | "source": "builtin", 235 | "dependencies": { 236 | "com.unity.modules.physics2d": "1.0.0" 237 | } 238 | }, 239 | "com.unity.modules.ui": { 240 | "version": "1.0.0", 241 | "depth": 0, 242 | "source": "builtin", 243 | "dependencies": {} 244 | }, 245 | "com.unity.modules.uielements": { 246 | "version": "1.0.0", 247 | "depth": 0, 248 | "source": "builtin", 249 | "dependencies": { 250 | "com.unity.modules.ui": "1.0.0", 251 | "com.unity.modules.imgui": "1.0.0", 252 | "com.unity.modules.jsonserialize": "1.0.0", 253 | "com.unity.modules.uielementsnative": "1.0.0" 254 | } 255 | }, 256 | "com.unity.modules.uielementsnative": { 257 | "version": "1.0.0", 258 | "depth": 1, 259 | "source": "builtin", 260 | "dependencies": { 261 | "com.unity.modules.ui": "1.0.0", 262 | "com.unity.modules.imgui": "1.0.0", 263 | "com.unity.modules.jsonserialize": "1.0.0" 264 | } 265 | }, 266 | "com.unity.modules.umbra": { 267 | "version": "1.0.0", 268 | "depth": 0, 269 | "source": "builtin", 270 | "dependencies": {} 271 | }, 272 | "com.unity.modules.unityanalytics": { 273 | "version": "1.0.0", 274 | "depth": 0, 275 | "source": "builtin", 276 | "dependencies": { 277 | "com.unity.modules.unitywebrequest": "1.0.0", 278 | "com.unity.modules.jsonserialize": "1.0.0" 279 | } 280 | }, 281 | "com.unity.modules.unitywebrequest": { 282 | "version": "1.0.0", 283 | "depth": 0, 284 | "source": "builtin", 285 | "dependencies": {} 286 | }, 287 | "com.unity.modules.unitywebrequestassetbundle": { 288 | "version": "1.0.0", 289 | "depth": 0, 290 | "source": "builtin", 291 | "dependencies": { 292 | "com.unity.modules.assetbundle": "1.0.0", 293 | "com.unity.modules.unitywebrequest": "1.0.0" 294 | } 295 | }, 296 | "com.unity.modules.unitywebrequestaudio": { 297 | "version": "1.0.0", 298 | "depth": 0, 299 | "source": "builtin", 300 | "dependencies": { 301 | "com.unity.modules.unitywebrequest": "1.0.0", 302 | "com.unity.modules.audio": "1.0.0" 303 | } 304 | }, 305 | "com.unity.modules.unitywebrequesttexture": { 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.imageconversion": "1.0.0" 312 | } 313 | }, 314 | "com.unity.modules.unitywebrequestwww": { 315 | "version": "1.0.0", 316 | "depth": 0, 317 | "source": "builtin", 318 | "dependencies": { 319 | "com.unity.modules.unitywebrequest": "1.0.0", 320 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 321 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 322 | "com.unity.modules.audio": "1.0.0", 323 | "com.unity.modules.assetbundle": "1.0.0", 324 | "com.unity.modules.imageconversion": "1.0.0" 325 | } 326 | }, 327 | "com.unity.modules.vehicles": { 328 | "version": "1.0.0", 329 | "depth": 0, 330 | "source": "builtin", 331 | "dependencies": { 332 | "com.unity.modules.physics": "1.0.0" 333 | } 334 | }, 335 | "com.unity.modules.video": { 336 | "version": "1.0.0", 337 | "depth": 0, 338 | "source": "builtin", 339 | "dependencies": { 340 | "com.unity.modules.audio": "1.0.0", 341 | "com.unity.modules.ui": "1.0.0", 342 | "com.unity.modules.unitywebrequest": "1.0.0" 343 | } 344 | }, 345 | "com.unity.modules.vr": { 346 | "version": "1.0.0", 347 | "depth": 0, 348 | "source": "builtin", 349 | "dependencies": { 350 | "com.unity.modules.jsonserialize": "1.0.0", 351 | "com.unity.modules.physics": "1.0.0", 352 | "com.unity.modules.xr": "1.0.0" 353 | } 354 | }, 355 | "com.unity.modules.wind": { 356 | "version": "1.0.0", 357 | "depth": 0, 358 | "source": "builtin", 359 | "dependencies": {} 360 | }, 361 | "com.unity.modules.xr": { 362 | "version": "1.0.0", 363 | "depth": 0, 364 | "source": "builtin", 365 | "dependencies": { 366 | "com.unity.modules.physics": "1.0.0", 367 | "com.unity.modules.jsonserialize": "1.0.0", 368 | "com.unity.modules.subsystems": "1.0.0" 369 | } 370 | } 371 | } 372 | } 373 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /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: 11 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_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /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 | - enabled: 1 9 | path: Assets/Mesh Tilesets/Samples/Scenes/SampleScene.unity 10 | guid: 9fc0d4010bbf28b4594072e72b8655ab 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /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: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 -------------------------------------------------------------------------------- /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: 13 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 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /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_EnablePreviewPackages: 1 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 1 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/Packages/com.unity.polybrush/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Name": "Settings", 3 | "m_Path": "ProjectSettings/Packages/com.unity.polybrush/Settings.json", 4 | "m_Dictionary": { 5 | "m_DictionaryValues": [] 6 | } 7 | } -------------------------------------------------------------------------------- /ProjectSettings/Packages/com.unity.progrids/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Name": "Settings", 3 | "m_Path": "ProjectSettings/Packages/com.unity.progrids/Settings.json", 4 | "m_Dictionary": { 5 | "m_DictionaryValues": [] 6 | } 7 | } -------------------------------------------------------------------------------- /ProjectSettings/Packages/com.unity.settings-manager/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Name": "Settings", 3 | "m_Path": "ProjectSettings/Packages/com.unity.settings-manager/Settings.json", 4 | "m_Dictionary": { 5 | "m_DictionaryValues": [] 6 | } 7 | } -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -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_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /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 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.2.0f1 2 | m_EditorVersionWithRevision: 2020.2.0f1 (3721df5a8b28) 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 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /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 | - Tile Hide Group 8 | layers: 9 | - Default 10 | - TransparentFX 11 | - Ignore Raycast 12 | - 13 | - Water 14 | - UI 15 | - 16 | - 17 | - PostProcess 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | - 41 | m_SortingLayers: 42 | - name: Default 43 | uniqueID: 0 44 | locked: 0 45 | -------------------------------------------------------------------------------- /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 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /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_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /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 | # Unity Mesh Tilesets 2 | 3 | [![openupm][OpenUPMBadge]][OpenUPMPackage] 4 | ![Last Commit][LastCommitBadge] 5 | [![BuyMeCoffee][buymecoffeebadge]][buymecoffee] 6 | 7 | Unity Mesh Tilesets is a [Unity] editor extension that can be used to automatically place objects along [ProBuilder] meshes based on rules from a tileset. The tool is heavily inspired by the [tile mesh feature of Valve's Source Engine 2][Source2] that was used for many different props in Half Life Alyx. 8 | 9 | ![Showcase](/Docs/Media/showcase.gif) 10 | 11 | ## Installation 12 | 13 | Mesh Tilesets requires [ProBuilder]. ProBuilder will be added automatically to your project if it has not been installed yet. It is also highly recommended to install [ProGrids] as well (note that ProGrids is still in preview so you have to [enable preview packages][PreviewPackages] in the package manager). 14 | 15 | ### OpenUPM (recommended) 16 | 17 | Make sure you have the [OpenUPM CLI][OpenUPM] installed. From the root of your project run: 18 | ``` 19 | openupm add com.freshlybrewedcode.unity-mesh-tilesets 20 | ``` 21 | 22 | ### Unity Package Manager 23 | 24 | Open the Unity package manager, click on the plus icon in the top left corner and select "Add package from git URL". Paste the following URL into the text field: 25 | ``` 26 | https://github.com/FreshlyBrewedCode/unity-mesh-tilesets.git#upm 27 | ``` 28 | 29 | **Note: You will not be able to select a specific version or update the package using this method. If you want to update to the latest version you have to remove the package and add it again using the url above.** 30 | 31 | ### Manual Download 32 | 33 | Download or clone the repository and add the `Assets/Mesh Tilesets` folder into the `Assets` folder of your Unity project. 34 | 35 | ## Getting Started 36 | 37 | Check out the [getting started section][GettingStarted] in the [documentation][Docs]. 38 | 39 | ## How It Works 40 | 41 | The tool works using primitive meshes that you create and modify directly inside of Unity using [ProBuilder]. You place the `TilesetRenderer` component on your tile mesh GameObject and it will find rectangular quads ("tile instances") in the mesh. Each tile instance has an orientation (top, bottom, left, right, normal), a size (width, height) and knows about other adjacent tiles. 42 | 43 | You assign a tileset to the `TilesetRenderer` that can contain any number of tiles. Each tile is basically a prefab that contains information about the size of the tile (width, height) and "rules" about if there can or should be any tiles adjacent to the left/right/top/bottom of the tile. 44 | 45 | For each tile instance in the mesh the `TilesetRenderer` tries to find a tile from the assigned tileset that "fits" (by comparing size and adjacency). 46 | 47 | Check out the [documentation][Docs] for more info. 48 | 49 | ## Examples 50 | 51 | Here are some example use cases for the tool. I am sure there are many more creative ways to use this tool. If you have a cool example feel free leave a pull request and add it to the list. 52 | 53 | ### Pipes, Tubes 54 | 55 | ![Pipe Example](/Docs/Media/pipes_example.png) 56 | 57 | ### Ducts, Vents 58 | 59 | ![Duct Example](/Docs/Media/duct_example.png) 60 | 61 | ### Railings, Fences 62 | 63 | ![Railing Example](/Docs/Media/railing_example.png) 64 | 65 | ### Catwalks, Bridges, Stairs 66 | 67 | ![Catwalk Example](/Docs/Media/catwalk_example.png) 68 | 69 | ### Buildings (almost) 70 | 71 | ![Building Example](/Docs/Media/building_example.png) 72 | 73 | ## Support Me 74 | 75 | If you like this tool and you would like to support me, feel free to buy me coffee: 76 | 77 | [![BuyMeCoffee][buymecoffeebadge]][buymecoffee] 78 | 79 | Thank you :) 80 | 81 | ## Contributing 82 | 83 | Pull request welcome. 84 | 85 | *TODO* 86 | 87 | ## License 88 | 89 | MIT 90 | 91 | The tool can be used freely in any project of any scale. Please don't redistribute the tool through the Unity Assetstore or a similar marketplace. 92 | 93 | [Unity]: https://unity.com 94 | [ProBuilder]: https://unity3d.com/de/unity/features/worldbuilding/probuilder 95 | [ProGrids]: https://docs.unity3d.com/Packages/com.unity.progrids@3.0/manual/index.html 96 | [PreviewPackages]: https://docs.unity3d.com/Manual/upm-ui-list.html#ShowPreview 97 | [Source2]: https://www.youtube.com/watch?v=3ki67VLL0xI&ab_channel=Hosomi 98 | [Releases]: https://github.com/FreshlyBrewedCode/unity-mesh-tilesets/releases 99 | [OpenUPM]: https://openupm.com/ 100 | [OpenUPMBadge]: https://img.shields.io/npm/v/com.freshlybrewedcode.unity-mesh-tilesets?label=openupm®istry_uri=https://package.openupm.com&style=for-the-badge 101 | [OpenUPMPackage]: https://openupm.com/packages/com.freshlybrewedcode.unity-mesh-tilesets/ 102 | [Docs]: /Docs/README.md 103 | [GettingStarted]: /Docs/README.md#getting-started 104 | 105 | [LastCommitBadge]: https://img.shields.io/github/last-commit/freshlybrewedcode/unity-mesh-tilesets?style=for-the-badge 106 | [ReleaseBadge]: https://img.shields.io/github/v/release/freshlybrewedcode/unity-mesh-tilesets?style=for-the-badge 107 | [buymecoffee]: https://ko-fi.com/freshlybrewed 108 | [buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge -------------------------------------------------------------------------------- /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 | lightmappingDeviceAndPlatform: 9 | value: 53 10 | flags: 0 11 | vcSharedLogLevel: 12 | value: 0d5e400f0650 13 | flags: 0 14 | m_VCAutomaticAdd: 1 15 | m_VCDebugCom: 0 16 | m_VCDebugCmd: 0 17 | m_VCDebugOut: 0 18 | m_SemanticMergeMode: 2 19 | m_VCShowFailedCheckout: 1 20 | m_VCOverwriteFailedCheckoutAssets: 1 21 | m_VCOverlayIcons: 1 22 | m_VCAllowAsyncUpdate: 0 23 | --------------------------------------------------------------------------------