├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── Editor.meta ├── Editor ├── MonoBehaviour.meta ├── MonoBehaviour │ ├── Node.cs │ ├── Node.cs.meta │ ├── TileMap.cs │ ├── TileMap.cs.meta │ ├── TileMapHolder.cs │ ├── TileMapHolder.cs.meta │ ├── VectorUtility.cs │ └── VectorUtility.cs.meta ├── com.3dtilemapeditor.editor.asmdef ├── com.3dtilemapeditor.editor.asmdef.meta ├── scripts.meta └── scripts │ ├── Controllers.meta │ ├── Controllers │ ├── ControllersFacade.cs │ ├── ControllersFacade.cs.meta │ ├── NodeController.cs │ ├── NodeController.cs.meta │ ├── TileMapController.cs │ ├── TileMapController.cs.meta │ ├── TileMapHolderController.cs │ └── TileMapHolderController.cs.meta │ ├── GUIElements.meta │ ├── GUIElements │ ├── GUIField.cs │ └── GUIField.cs.meta │ ├── GizmoDrawer.cs │ ├── GizmoDrawer.cs.meta │ ├── MouseStates.meta │ ├── MouseStates │ ├── MouseState.cs │ ├── MouseState.cs.meta │ ├── MouseStateContext.cs │ ├── MouseStateContext.cs.meta │ ├── States.meta │ └── States │ │ ├── MouseStateDefault.cs │ │ ├── MouseStateDefault.cs.meta │ │ ├── MouseStatePaint.cs │ │ ├── MouseStatePaint.cs.meta │ │ ├── MouseStateRemove.cs │ │ └── MouseStateRemove.cs.meta │ ├── TileMap3d.cs │ └── TileMap3d.cs.meta ├── LICENSE ├── LICENSE.meta ├── README.md ├── README.md.meta ├── Screenshot 2022-04-11 231835.jpg ├── Screenshot 2022-04-11 231835.jpg.meta ├── package.json ├── package.json.meta ├── samples.meta └── samples ├── Scene.meta └── prefabs.meta /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | 29 | - Version [e.g. 22] 30 | 31 | 32 | **Additional context** 33 | Add any other context about the problem here. 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 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 | -------------------------------------------------------------------------------- /.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 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | . 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 585576e2ecba3ca46b7d4cdcb7637d5a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/MonoBehaviour.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21ceec9f79ab3b84ebb575d2f343b350 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/MonoBehaviour/Node.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Editor.MonoBehaviour 5 | { 6 | [ExecuteInEditMode] 7 | public class Node : UnityEngine.MonoBehaviour 8 | { 9 | [SerializeField] private TileMap _tileMap; 10 | private new BoxCollider collider; 11 | 12 | public TileMap tileMap 13 | { 14 | get => _tileMap; 15 | set 16 | { 17 | //remove from previous tilemap 18 | if (_tileMap != null) 19 | { 20 | _tileMap.removeNode(this); 21 | } 22 | 23 | _tileMap = value; 24 | //update new tilemap 25 | if (_tileMap != null) 26 | { 27 | _tileMap.addNode(this); 28 | updateCoordination(); 29 | } 30 | } 31 | } 32 | 33 | [SerializeField] internal float x; 34 | [SerializeField] internal float z; 35 | public GameObject child; 36 | 37 | public void updateCoordination() 38 | { 39 | //get grid cell indexes to re position in case of tilemap size update 40 | var pos = (transform.position - tileMap.transform.position).Truncate(Vector3.zero); 41 | x = (pos.x - (pos.x % tileMap.gridSize)) / _tileMap.gridSize; 42 | z = (pos.z - (pos.z % tileMap.gridSize)) / _tileMap.gridSize; 43 | } 44 | 45 | public void reposition() 46 | { 47 | if (_tileMap == null) return; 48 | transform.position = new Vector3(x, 0, z) * _tileMap.gridSize + 49 | Vector3.one * 0.5f * _tileMap.gridSize + 50 | Vector3.up * tileMap.transform.position.y; 51 | } 52 | 53 | private void Start() 54 | { 55 | collider = GetComponent(); 56 | if (collider == null) 57 | { 58 | collider = this.gameObject.AddComponent(); 59 | collider.isTrigger = true; 60 | } 61 | 62 | 63 | resize(); 64 | } 65 | 66 | public void resize() 67 | { 68 | float newSize = _tileMap.gridSize; 69 | var size = child.GetComponent().bounds.size; 70 | //var size = Vector3.one * newSize; 71 | var rescale = transform.localScale; 72 | 73 | rescale.x = newSize * rescale.x / size.x; 74 | rescale.y = newSize * rescale.y / size.y; 75 | rescale.z = newSize * rescale.z / size.z; 76 | transform.localScale = rescale; 77 | 78 | 79 | //collider.size = GetComponent().bounds.size; 80 | } 81 | 82 | private void OnDestroy() 83 | { 84 | //remove from previous tilemap 85 | if (_tileMap != null) 86 | { 87 | _tileMap.removeNode(this); 88 | } 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /Editor/MonoBehaviour/Node.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 649d6155bef54f9eb8cf73c201a5eb52 3 | timeCreated: 1647979905 -------------------------------------------------------------------------------- /Editor/MonoBehaviour/TileMap.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using UnityEngine; 4 | 5 | namespace Editor.MonoBehaviour 6 | { 7 | [ExecuteInEditMode] 8 | public class TileMap : UnityEngine.MonoBehaviour 9 | { 10 | private TileMapHolder _tileMapHolder; 11 | 12 | public TileMapHolder tileMapHolder 13 | { 14 | get { return _tileMapHolder; } 15 | set 16 | { 17 | //remove from previous tilemap holder 18 | if (_tileMapHolder != null) 19 | { 20 | _tileMapHolder.removeTileMap(this); 21 | } 22 | 23 | _tileMapHolder = value; 24 | //update the new tilemap holder 25 | if (_tileMapHolder != null) 26 | { 27 | _tileMapHolder.addTilemap(this); 28 | } 29 | } 30 | } 31 | 32 | internal int _gridWidth = 5; //Width 33 | 34 | public int gridWidth 35 | { 36 | get { return _gridWidth; } 37 | set 38 | { 39 | _gridWidth = value; 40 | updateCollider(); 41 | } 42 | } 43 | 44 | internal int _gridLength = 5; //length 45 | 46 | public int gridLength 47 | { 48 | get { return _gridLength; } 49 | set 50 | { 51 | _gridLength = value; 52 | updateCollider(); 53 | } 54 | } 55 | 56 | [SerializeField] private float _gridSize; 57 | 58 | public float gridSize 59 | { 60 | get { return _gridSize; } 61 | set 62 | { 63 | _gridSize = value; 64 | updateCollider(); 65 | } 66 | } 67 | 68 | private BoxCollider _collider; 69 | public List nodes = new List(); 70 | 71 | private void Awake() 72 | { 73 | //setting up collider 74 | //check if collider already exist 75 | var col = GetComponent(); 76 | if (col != null) 77 | { 78 | _collider = col; 79 | return; 80 | } 81 | 82 | _collider = gameObject.AddComponent(); 83 | _collider.center = new Vector3((float) 1 / 2, 0, (float) 1 / 2); 84 | _collider.size = new Vector3(1, 0.01f, 1) * 1; //TODO fix this 85 | _collider.isTrigger = true; 86 | } 87 | 88 | // 89 | public bool itsClearCell(Node node) 90 | { 91 | foreach (var n in nodes) 92 | { 93 | if (n != node && n.x == node.x && n.z == node.z) return false; 94 | } 95 | 96 | return true; 97 | } 98 | 99 | 100 | //update collider dimension when field changes 101 | private void updateCollider() 102 | { 103 | transform.localScale = new Vector3(_gridLength, 1, gridWidth) * gridSize; 104 | resizeNodes(); 105 | } 106 | 107 | private void resizeNodes() 108 | { 109 | foreach (var node in nodes) 110 | { 111 | node.resize(); 112 | node.reposition(); 113 | } 114 | } 115 | 116 | public void addNode(Node node) 117 | { 118 | if (node == null || nodes.Contains(node)) return; 119 | nodes.Add(node); 120 | } 121 | 122 | public bool removeNode(Node node) 123 | { 124 | return nodes.Remove(node); 125 | } 126 | 127 | private void OnDestroy() 128 | { 129 | if (tileMapHolder == null) return; 130 | 131 | tileMapHolder.getTileMaps(); 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /Editor/MonoBehaviour/TileMap.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39d16f17e3e9e2a4aaa1594a535de354 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/MonoBehaviour/TileMapHolder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Editor.scripts; 3 | using UnityEngine; 4 | 5 | namespace Editor.MonoBehaviour 6 | { 7 | [ExecuteInEditMode] 8 | public class TileMapHolder : UnityEngine.MonoBehaviour 9 | { 10 | public List tilemaps = new List(); 11 | 12 | 13 | public void getTileMaps() 14 | { 15 | tilemaps.Clear(); 16 | //get all existing tilemaps 17 | var arr = GetComponentsInChildren(); 18 | foreach (var item in arr) 19 | { 20 | tilemaps.Add(item); 21 | } 22 | } 23 | 24 | public void addTilemap(TileMap tileMap) 25 | { 26 | if (tileMap == null || tilemaps.Contains(tileMap)) return; 27 | 28 | //set tile map holder as parent 29 | tileMap.transform.parent = transform; 30 | tilemaps.Add(tileMap); 31 | reallocateTilemap(); 32 | } 33 | 34 | public bool removeTileMap(TileMap tileMap) 35 | { 36 | return tilemaps.Remove(tileMap); 37 | } 38 | 39 | 40 | private void reallocateTilemap() 41 | { 42 | if (tilemaps.Count <= 1) return; 43 | var tilemap = tilemaps[tilemaps.Count - 1]; 44 | var pre_tilemap = tilemaps[tilemaps.Count - 2]; 45 | tilemap.transform.position = pre_tilemap.transform.position + Vector3.up * pre_tilemap.gridSize; 46 | } 47 | 48 | public void reallocateTilemaps() 49 | { 50 | if (tilemaps.Count <= 1) return; 51 | for (var i = 1; i < tilemaps.Count; i++) 52 | { 53 | var tilemap = tilemaps[i]; 54 | var pre_tilemap = tilemaps[i - 1]; 55 | tilemap.transform.position = pre_tilemap.transform.position + Vector3.up * pre_tilemap.gridSize; 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Editor/MonoBehaviour/TileMapHolder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd0724bcbd2e1c24699321067e12fbe6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/MonoBehaviour/VectorUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Editor.MonoBehaviour 5 | { 6 | public static class VectorUtility 7 | { 8 | public static Vector3 Truncate(this Vector3 vec, Vector3 offset = new Vector3()) 9 | { 10 | return new Vector3( 11 | (float) Math.Truncate(vec.x) + offset.x, 12 | (float) Math.Truncate(vec.y) + offset.y, 13 | (float) Math.Truncate(vec.z) + offset.z 14 | ); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Editor/MonoBehaviour/VectorUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2db546b25d2b0b640b3dc372d5ad9e5c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/com.3dtilemapeditor.editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.3dtilemapeditor.editor" 3 | } 4 | -------------------------------------------------------------------------------- /Editor/com.3dtilemapeditor.editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b3fc14a26d80704bb7eeee067f3a566 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Editor/scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 345b92a5ffa639547ad7cad044e84255 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/scripts/Controllers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79ed52cd2e664fc4996e885f5d51d792 3 | timeCreated: 1647730984 -------------------------------------------------------------------------------- /Editor/scripts/Controllers/ControllersFacade.cs: -------------------------------------------------------------------------------- 1 | using Editor.MonoBehaviour; 2 | using UnityEngine; 3 | 4 | namespace Editor.scripts.Controllers 5 | { 6 | public class ControllersFacade 7 | { 8 | private readonly TileMapHolder tileMapHolder; 9 | private readonly TileMapController tileMapController; 10 | private readonly TileMapHolderController tileMapHolderController; 11 | private readonly NodeController nodeController; 12 | 13 | public ControllersFacade() 14 | { 15 | this.tileMapController = new TileMapController(); 16 | this.tileMapHolderController = new TileMapHolderController(); 17 | this.nodeController = new NodeController(); 18 | 19 | //init TileMap Holder 20 | this.tileMapHolder = tileMapHolderController.initTileMapHolder(); 21 | } 22 | 23 | /////////////////////// Tile Map Holder Interface /////////////////// 24 | public TileMapHolder getTileMapHolder() 25 | { 26 | return tileMapHolder; 27 | } 28 | 29 | public int getTileMapsCount() 30 | { 31 | return tileMapHolder.tilemaps.Count; 32 | } 33 | 34 | public void hideTileMapsByIndex(int index = 0) 35 | { 36 | tileMapHolderController.hideTileMapsByIndex(tileMapHolder, index); 37 | } 38 | 39 | public void showAllTileMaps() 40 | { 41 | tileMapHolderController.showAllTileMaps(tileMapHolder); 42 | } 43 | 44 | /////////////////////// Tile Map Interface ////////////////////////// 45 | public void createNewTileMap(int length = 5, int width = 5, float size = 1) 46 | { 47 | tileMapController.createNewTileMap(tileMapHolder, length, width, size); 48 | } 49 | 50 | public void updateTileMap(TileMap tilemap, int length, int width, float size) 51 | { 52 | tileMapController.updateTileMap(tilemap, length, width, size); 53 | //re position all tilemaps 54 | tileMapHolder.reallocateTilemaps(); 55 | } 56 | 57 | public void removeTileMap() 58 | { 59 | tileMapController.removeTileMap(tileMapHolder); 60 | } 61 | 62 | public void removeTileMap(int index) 63 | { 64 | tileMapController.removeTileMap(tileMapHolder, index); 65 | } 66 | 67 | public void removeTileMap(TileMap tilemap) 68 | { 69 | tileMapController.removeTileMap(tileMapHolder, tilemap); 70 | } 71 | 72 | 73 | public void updateFieldFromTileMap(TileMap tilemap, ref int length, ref int width, ref float size) 74 | { 75 | length = tilemap.gridLength; 76 | size = tilemap.gridSize; 77 | width = tilemap.gridWidth; 78 | } 79 | //////////////////////// Node Interface ///////////////////////// 80 | 81 | public GameObject createNode(TileMap tileMap, GameObject selectedTile, Vector3 position, Quaternion rotation) 82 | { 83 | return nodeController.createNode(tileMap, selectedTile, position, rotation); 84 | } 85 | 86 | public GameObject copyNode(TileMap tileMap, GameObject node, Vector3 position, Quaternion rotation) 87 | { 88 | return nodeController.copyNode(tileMap, node, position, rotation); 89 | } 90 | 91 | public void destroyNode(Node node) 92 | { 93 | nodeController.destroyNode(node); 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /Editor/scripts/Controllers/ControllersFacade.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eed0c25363904192a32f23fd891cc59c 3 | timeCreated: 1647730954 -------------------------------------------------------------------------------- /Editor/scripts/Controllers/NodeController.cs: -------------------------------------------------------------------------------- 1 | using Editor.MonoBehaviour; 2 | using UnityEngine; 3 | 4 | namespace Editor.scripts.Controllers 5 | { 6 | public class NodeController 7 | { 8 | public GameObject createNode(TileMap tileMap, GameObject selectedTile, Vector3 position, Quaternion rotation) 9 | { 10 | //spawn cell and attach it to its tilemap 11 | 12 | var emptyObj = new GameObject("Node"); 13 | 14 | var node = emptyObj.AddComponent(); 15 | node.tileMap = tileMap; 16 | emptyObj.transform.parent = tileMap.transform; 17 | var obj = GameObject.Instantiate(selectedTile, position, rotation); 18 | 19 | 20 | ////////////////// 21 | float newSize = tileMap.gridSize; 22 | var size = obj.GetComponent().bounds.size; 23 | //var size = Vector3.one * newSize; 24 | var rescale = obj.transform.localScale; 25 | 26 | rescale.x = newSize * rescale.x / size.x; 27 | rescale.y = newSize * rescale.y / size.y; 28 | rescale.z = newSize * rescale.z / size.z; 29 | obj.transform.localScale = rescale; 30 | 31 | var offset = obj.GetComponent().bounds.center.y; 32 | obj.transform.position = new Vector3(emptyObj.transform.position.x, 33 | (emptyObj.transform.position.y - offset), 34 | emptyObj.transform.position.z); 35 | obj.transform.parent = emptyObj.transform; 36 | node.child = obj; 37 | 38 | 39 | return emptyObj; 40 | } 41 | 42 | public GameObject copyNode(TileMap tileMap, GameObject node, Vector3 position, Quaternion rotation) 43 | { 44 | var obj = GameObject.Instantiate(node.gameObject, position, rotation); 45 | obj.transform.parent = tileMap.transform; 46 | obj.GetComponent().tileMap = tileMap; 47 | obj.layer = LayerMask.NameToLayer("Default"); 48 | 49 | return obj; 50 | } 51 | 52 | public void destroyNode(Node node) 53 | { 54 | if (node == null) return; 55 | GameObject.DestroyImmediate(node.gameObject); 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /Editor/scripts/Controllers/NodeController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3c5cea17a5a4e798a49e2ba5a5a2ea1 3 | timeCreated: 1647980783 -------------------------------------------------------------------------------- /Editor/scripts/Controllers/TileMapController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Editor.MonoBehaviour; 3 | using UnityEngine; 4 | 5 | namespace Editor.scripts.Controllers 6 | { 7 | public class TileMapController 8 | { 9 | public void createNewTileMap(TileMapHolder tileMapHolder, int length = 5, int width = 5, float size = 1) 10 | { 11 | var newTileMap = new GameObject("tilemap " + tileMapHolder.tilemaps.Count.ToString()); 12 | var tilemap = newTileMap.AddComponent(); 13 | 14 | //set up tile map parameters 15 | updateTileMap(tilemap, length, width, size); 16 | tilemap.tileMapHolder = tileMapHolder; 17 | 18 | //add tilemap to list of tile maps 19 | tileMapHolder.addTilemap(tilemap); 20 | } 21 | 22 | public void updateTileMap(TileMap tilemap, int length, int width, float size) 23 | { 24 | if (tilemap == null) 25 | { 26 | throw new Exception("tilemap reference is null"); 27 | } 28 | 29 | tilemap.gridSize = size; 30 | tilemap.gridLength = length; 31 | tilemap.gridWidth = width; 32 | } 33 | 34 | 35 | public void removeTileMap(TileMapHolder tileMapHolder) 36 | { 37 | var tilemaps = tileMapHolder.tilemaps; 38 | var tilemap = tilemaps[tilemaps.Count - 1]; 39 | //remove tilemap 40 | removeTileMap(tileMapHolder, tilemap); 41 | } 42 | 43 | public void removeTileMap(TileMapHolder tileMapHolder, int index) 44 | { 45 | var tilemaps = tileMapHolder.tilemaps; 46 | removeTileMap(tileMapHolder, tilemaps[index]); 47 | } 48 | 49 | public void removeTileMap(TileMapHolder tileMapHolder, TileMap tilemap) 50 | { 51 | if (tilemap == null) return; 52 | tileMapHolder.tilemaps.Remove(tilemap); 53 | GameObject.DestroyImmediate(tilemap.gameObject); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /Editor/scripts/Controllers/TileMapController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf2997b199e285e40a212de5abdbd798 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/scripts/Controllers/TileMapHolderController.cs: -------------------------------------------------------------------------------- 1 | using Editor.MonoBehaviour; 2 | using UnityEngine; 3 | 4 | namespace Editor.scripts.Controllers 5 | { 6 | public class TileMapHolderController 7 | { 8 | public TileMapHolder initTileMapHolder() 9 | { 10 | //look for tilemap holder 11 | var _tileMapHolder = GameObject.FindObjectOfType(); 12 | //if tilemap holder doesnt exist 13 | //create one 14 | if (_tileMapHolder == null) 15 | { 16 | Debug.Log("There is no TileMap Holder"); 17 | Debug.Log("A TileMap Holder wil be created"); 18 | //create tilemap holder 19 | _tileMapHolder = creatTileMapHolder(); 20 | } 21 | 22 | //get All tileMaps 23 | _tileMapHolder.getTileMaps(); 24 | return _tileMapHolder; 25 | } 26 | 27 | private TileMapHolder creatTileMapHolder() 28 | { 29 | //create tilemap holder 30 | var _tileMapHolder = new GameObject("TilesMaps Holder").AddComponent(); 31 | new TileMapController().createNewTileMap(_tileMapHolder); 32 | return _tileMapHolder; 33 | } 34 | 35 | public void hideTileMapsByIndex(TileMapHolder tileMapHolder, int index) 36 | { 37 | var count = tileMapHolder.tilemaps.Count; 38 | var tilemaps = tileMapHolder.tilemaps; 39 | for (var i = 0; i < count; i++) 40 | { 41 | tilemaps[i].gameObject.SetActive(i <= index); 42 | } 43 | } 44 | 45 | public void showAllTileMaps(TileMapHolder tileMapHolder) 46 | { 47 | var count = tileMapHolder.tilemaps.Count; 48 | var tilemaps = tileMapHolder.tilemaps; 49 | for (var i = 0; i < count; i++) 50 | { 51 | tilemaps[i].gameObject.SetActive(true); 52 | } 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /Editor/scripts/Controllers/TileMapHolderController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c47a7d3cdec42f8bbcf84f9c2109fc8 3 | timeCreated: 1647731542 -------------------------------------------------------------------------------- /Editor/scripts/GUIElements.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73dd66ec3932487ab96ca75b52be59d9 3 | timeCreated: 1648325824 -------------------------------------------------------------------------------- /Editor/scripts/GUIElements/GUIField.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace Editor.scripts.GUIElements 5 | { 6 | public class GUIField 7 | { 8 | public static void showField(ref int variable, string label, int minLimit = 0, int maxLimit = 999) 9 | { 10 | var style = new GUIStyle(GUI.skin.label) {alignment = TextAnchor.MiddleCenter}; 11 | 12 | EditorGUILayout.LabelField(label, style, GUILayout.ExpandWidth(true)); 13 | 14 | EditorGUI.BeginDisabledGroup(variable <= minLimit); 15 | GUILayout.BeginHorizontal(); 16 | if (GUILayout.Button("-1")) 17 | { 18 | variable -= 1; 19 | } 20 | 21 | EditorGUI.EndDisabledGroup(); 22 | variable = EditorGUILayout.IntField("", variable); 23 | 24 | EditorGUI.BeginDisabledGroup(variable >= maxLimit); 25 | //EditorGUILayout.LabelField(selectedTileMapIndex.ToString(), style); 26 | if (GUILayout.Button("+1")) 27 | { 28 | variable += 1; 29 | } 30 | 31 | EditorGUI.EndDisabledGroup(); 32 | GUILayout.EndHorizontal(); 33 | } 34 | 35 | public static void showField(ref float variable, string label, int minLimit = 0, int maxLimit = 999) 36 | { 37 | var style = new GUIStyle(GUI.skin.label) {alignment = TextAnchor.MiddleCenter}; 38 | 39 | EditorGUILayout.LabelField(label, style, GUILayout.ExpandWidth(true)); 40 | 41 | EditorGUI.BeginDisabledGroup(variable <= minLimit); 42 | GUILayout.BeginHorizontal(); 43 | if (GUILayout.Button("-1")) 44 | { 45 | variable -= 1; 46 | } 47 | 48 | EditorGUI.EndDisabledGroup(); 49 | variable = EditorGUILayout.FloatField("", variable); 50 | 51 | EditorGUI.BeginDisabledGroup(variable >= maxLimit); 52 | //EditorGUILayout.LabelField(selectedTileMapIndex.ToString(), style); 53 | if (GUILayout.Button("+1")) 54 | { 55 | variable += 1; 56 | } 57 | 58 | EditorGUI.EndDisabledGroup(); 59 | GUILayout.EndHorizontal(); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Editor/scripts/GUIElements/GUIField.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 411e268f850c4aa3b7d76e37472e4708 3 | timeCreated: 1648325884 -------------------------------------------------------------------------------- /Editor/scripts/GizmoDrawer.cs: -------------------------------------------------------------------------------- 1 | using Editor.MonoBehaviour; 2 | using Editor.scripts.MouseStates; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | namespace Editor.scripts 7 | { 8 | public static class GizmoDrawer 9 | { 10 | public static MouseStateContext mouseStateContext = null; 11 | 12 | [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected)] 13 | private static void DrawGizmoForTileMapHolder(TileMapHolder tileMapHolder, GizmoType gizmoType) 14 | { 15 | // if there is mouse state context instance (editor window is open) 16 | //subscribe to draw gizmo 17 | if (mouseStateContext == null) 18 | { 19 | return; 20 | } 21 | 22 | mouseStateContext.OnDrawGizmos(); 23 | } 24 | 25 | [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected)] 26 | private static void DrawGridGizmo(TileMap tileMap, GizmoType gizmoType) 27 | { 28 | //Draw a line of width 29 | 30 | for (var i = 0; i <= tileMap._gridWidth; i++) 31 | 32 | { 33 | var position = tileMap.transform.position; 34 | var startingPoint = new Vector3(0, 0, i * tileMap.gridSize) + position; 35 | var endingPoint = new Vector3(tileMap._gridLength * tileMap.gridSize, 0, i * tileMap.gridSize) + 36 | position; 37 | Gizmos.DrawLine(startingPoint, endingPoint); 38 | } 39 | 40 | 41 | //Draw the length of the line 42 | 43 | for (var i = 0; i <= tileMap._gridLength; i++) 44 | 45 | { 46 | var position = tileMap.transform.position; 47 | var startingPoint = new Vector3(i * tileMap.gridSize, 0, 0) + position; 48 | var endingPoint = new Vector3(i * tileMap.gridSize, 0, tileMap._gridWidth * tileMap.gridSize) + 49 | position; 50 | Gizmos.DrawLine(startingPoint, endingPoint); 51 | } 52 | 53 | 54 | HandleUtility.Repaint(); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /Editor/scripts/GizmoDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8716b6aa3d7e7e542a226fdf3068ce81 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/scripts/MouseStates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 068a4ec37250458f83764b11035b762b 3 | timeCreated: 1647097242 -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/MouseState.cs: -------------------------------------------------------------------------------- 1 | namespace Editor.scripts.MouseStates 2 | { 3 | public abstract class MouseState 4 | { 5 | protected readonly TileMap3d tileMap3D; 6 | 7 | protected MouseState(TileMap3d tile) 8 | { 9 | tileMap3D = tile; 10 | } 11 | 12 | public abstract void onMouseClick(); 13 | public abstract void OnDrawGizmos(); 14 | public abstract void onFieldsUpdate(); 15 | public abstract void onDestroy(); 16 | } 17 | } -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/MouseState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7462f671e46542d46ac02617b910dacc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/MouseStateContext.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Editor.scripts.MouseStates 4 | { 5 | public class MouseStateContext 6 | { 7 | MouseState _state; 8 | 9 | 10 | public MouseStateContext(MouseState _state) 11 | { 12 | this._state = _state; 13 | } 14 | 15 | public MouseState state 16 | { 17 | get { return _state; } 18 | set 19 | { 20 | //if there is mouse state call on destroy 21 | _state?.onDestroy(); 22 | _state = value; 23 | Debug.Log("Changing Mouse Stat to: " + _state.GetType().Name); 24 | } 25 | } 26 | 27 | public void onMouseClick() 28 | { 29 | _state?.onMouseClick(); 30 | } 31 | 32 | public void OnDrawGizmos() 33 | { 34 | _state?.OnDrawGizmos(); 35 | } 36 | 37 | public void onDestroy() 38 | { 39 | _state?.onDestroy(); 40 | } 41 | 42 | public void onFieldsUpdate() 43 | { 44 | _state?.onFieldsUpdate(); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/MouseStateContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0add1131a04d4d46b0913688b462d42 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/States.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b64e7f9360d44ae2966ac3d08a9c3a21 3 | timeCreated: 1647097289 -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/States/MouseStateDefault.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Editor.scripts.MouseStates.States 4 | { 5 | public class MouseStateDefault : MouseState 6 | { 7 | public MouseStateDefault(TileMap3d tile) : base(tile) 8 | { 9 | } 10 | 11 | public override void onMouseClick() 12 | { 13 | Debug.Log("default Click"); 14 | } 15 | 16 | public override void OnDrawGizmos() 17 | { 18 | } 19 | 20 | public override void onFieldsUpdate() 21 | { 22 | } 23 | 24 | public override void onDestroy() 25 | { 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/States/MouseStateDefault.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2254fb69c8e6409598c04699762130aa 3 | timeCreated: 1647097319 -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/States/MouseStatePaint.cs: -------------------------------------------------------------------------------- 1 | using Editor.MonoBehaviour; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace Editor.scripts.MouseStates.States 6 | { 7 | public class MouseStatePaint : MouseState 8 | { 9 | private static readonly object _lockOnmouseClick = new object(); 10 | private GameObject currentCell; 11 | 12 | public MouseStatePaint(TileMap3d tile) : base(tile) 13 | { 14 | spawnGhostCell(); 15 | } 16 | 17 | public override void onMouseClick() 18 | { 19 | //prevent object selection in scene view 20 | //stop event from propagation 21 | var controlId = GUIUtility.GetControlID(FocusType.Passive); 22 | GUIUtility.hotControl = controlId; 23 | Event.current.Use(); 24 | 25 | 26 | //if there is not a tile selected 27 | if (currentCell == null) 28 | { 29 | Debug.Log("there's no tile selected"); 30 | return; 31 | } 32 | 33 | // get position on scene view 34 | var ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition); 35 | var layerMask = LayerMask.GetMask("Ignore Raycast"); 36 | //casting ray to check for colliding on the tilemap 37 | if (Physics.Raycast(ray.origin, ray.direction, out var hit, 1000, ~layerMask)) 38 | { 39 | var tilemap = hit.collider.GetComponent(); 40 | //if ray hit tilemap 41 | if (tilemap != null && tilemap.itsClearCell(currentCell.GetComponent())) 42 | { 43 | // init node and spawn it 44 | spawnNode(tilemap, tileMap3D.selectedTile, currentCell.transform.position, 45 | currentCell.transform.rotation); 46 | } 47 | } 48 | 49 | HandleUtility.Repaint(); 50 | } 51 | 52 | public override void OnDrawGizmos() 53 | { 54 | //there is no ghost cell to manipulate 55 | if (currentCell == null) return; 56 | // getting mouse position on scene view 57 | var ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition); 58 | 59 | //casting ray to check for colliding on the tilemap 60 | if (Physics.Raycast(ray.origin, ray.direction, out var hit, 1000)) 61 | { 62 | var tilemap = hit.collider.GetComponent(); 63 | //if ray hit tilemap 64 | if (tilemap != null) 65 | { 66 | var tilemapPosition = tilemap.transform.position; 67 | //get the middle of the hit cell 68 | //Vector3.one * 0.5f * tilemap.gridSize 69 | var cell = 70 | (hit.point - tilemapPosition).Truncate(Vector3.zero); 71 | cell.x -= cell.x % tilemap.gridSize; 72 | //cell.y -= cell.y % tilemap.gridSize; 73 | cell.z -= cell.z % tilemap.gridSize; 74 | cell += tilemapPosition + new Vector3(1, 1, 1) * 0.5f * tilemap.gridSize; 75 | //check if still on the same cell 76 | //TODO: check node if its occupied 77 | if (!cell.Equals(currentCell.transform.position)) 78 | { 79 | currentCell.transform.position = cell; 80 | currentCell.GetComponent().updateCoordination(); 81 | } 82 | } 83 | } 84 | 85 | HandleUtility.Repaint(); 86 | } 87 | 88 | public override void onFieldsUpdate() 89 | { 90 | spawnGhostCell(); 91 | } 92 | 93 | private void spawnGhostCell() 94 | { 95 | //destroy previous cell if it exist 96 | if (currentCell != null) 97 | { 98 | GameObject.DestroyImmediate(currentCell); 99 | } 100 | 101 | //check if there is selected tile 102 | if (tileMap3D.selectedTile == null) 103 | { 104 | return; 105 | } 106 | 107 | //spawn the ghost cell 108 | var tileMap = tileMap3D.getSelectedTileMap(); 109 | currentCell = tileMap3D.controllersFacade.createNode(tileMap, tileMap3D.selectedTile, Vector3.zero, 110 | tileMap.transform.rotation); 111 | currentCell.name = "Ghost Cell"; 112 | currentCell.layer = LayerMask.NameToLayer("Ignore Raycast"); 113 | } 114 | 115 | private void spawnNode(TileMap tileMap, GameObject selectedTile, Vector3 position, Quaternion rotation) 116 | { 117 | //spawn cell and attach it to its tilemap 118 | tileMap3D.controllersFacade.copyNode(tileMap, currentCell, position, rotation); 119 | } 120 | 121 | public override void onDestroy() 122 | { 123 | GameObject.DestroyImmediate(currentCell); 124 | } 125 | } 126 | } -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/States/MouseStatePaint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d06e250617114fe7be283d17714df3bb 3 | timeCreated: 1647097447 -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/States/MouseStateRemove.cs: -------------------------------------------------------------------------------- 1 | using Editor.MonoBehaviour; 2 | using UnityEngine; 3 | using UnityEditor; 4 | 5 | namespace Editor.scripts.MouseStates.States 6 | { 7 | public class MouseStateRemove : MouseState 8 | { 9 | public MouseStateRemove(TileMap3d tile) : base(tile) 10 | { 11 | } 12 | 13 | public override void onMouseClick() 14 | { 15 | //prevent object selection in scene view 16 | //stop event from propagation 17 | var controlId = GUIUtility.GetControlID(FocusType.Passive); 18 | GUIUtility.hotControl = controlId; 19 | Event.current.Use(); 20 | 21 | var ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition); 22 | if (Physics.Raycast(ray.origin, ray.direction, out var hit, 1000)) 23 | { 24 | var node = hit.collider.GetComponent(); 25 | //if Node is in selected TileMap Delete 26 | if (node != null && node.tileMap == tileMap3D.getSelectedTileMap()) 27 | { 28 | Debug.Log("deleting"); 29 | //then remove node 30 | tileMap3D.controllersFacade.destroyNode(node); 31 | } 32 | } 33 | } 34 | 35 | public override void OnDrawGizmos() 36 | { 37 | } 38 | 39 | public override void onFieldsUpdate() 40 | { 41 | } 42 | 43 | public override void onDestroy() 44 | { 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Editor/scripts/MouseStates/States/MouseStateRemove.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eab1e86372454a79930134f95bc748f4 3 | timeCreated: 1647638344 -------------------------------------------------------------------------------- /Editor/scripts/TileMap3d.cs: -------------------------------------------------------------------------------- 1 | using Editor.MonoBehaviour; 2 | using Editor.scripts.Controllers; 3 | using Editor.scripts.GUIElements; 4 | using Editor.scripts.MouseStates; 5 | using Editor.scripts.MouseStates.States; 6 | using UnityEditor; 7 | using UnityEngine; 8 | 9 | namespace Editor.scripts 10 | { 11 | public class TileMap3d : EditorWindow 12 | { 13 | //TODO:implement selection of the current tilemap 14 | private int selectedTileMapIndex = 0; 15 | private int prevSelectedTileMapIndex = 0; 16 | 17 | //Grid attribute 18 | 19 | //grid scale 20 | private float _gridSize = 1; 21 | 22 | public float gridSize 23 | { 24 | get { return _gridSize; } 25 | set { _gridSize = value; } 26 | } 27 | 28 | // grid width 29 | private int _gridWidth = 5; 30 | 31 | public int gridWidth 32 | { 33 | get { return _gridWidth; } 34 | set { _gridWidth = value; } 35 | } 36 | 37 | //grid length 38 | private int _gridLength = 5; 39 | 40 | public int gridLength 41 | { 42 | get { return _gridLength; } 43 | set { _gridLength = value; } 44 | } 45 | //how many floor there is 46 | 47 | private int _floors = 1; 48 | 49 | public int floors 50 | { 51 | get { return _floors; } 52 | set { _floors = value; } 53 | } 54 | 55 | 56 | //selected tile 57 | //might be prefab or a normal game object 58 | private GameObject _selectedTile; 59 | 60 | public GameObject selectedTile 61 | { 62 | get { return _selectedTile; } 63 | set 64 | { 65 | _selectedTile = value; 66 | Debug.Log("selected new Game object as Tile"); 67 | } 68 | } 69 | 70 | 71 | // mouse Context 72 | // handle mouse presses with state design pattern 73 | private MouseStateContext mouseStateContext; 74 | 75 | 76 | // editor mode 77 | private bool inEditorMode = false; 78 | 79 | // remove mode 80 | private enum RemoveMode 81 | { 82 | BY_INDEX, 83 | LAST 84 | } 85 | 86 | private RemoveMode removeMode = RemoveMode.LAST; 87 | 88 | // controller facade 89 | internal ControllersFacade controllersFacade; 90 | 91 | //open tilemap window editor 92 | [MenuItem("Tools/Tile Mapper")] 93 | public static void showWindow() 94 | { 95 | // open tilemap window 96 | var window = (TileMap3d) GetWindow(typeof(TileMap3d)); 97 | 98 | //init window field 99 | window.start(); 100 | } 101 | 102 | private void start() 103 | { 104 | // init controller facade 105 | controllersFacade = new ControllersFacade(); 106 | 107 | 108 | //init mouse events 109 | mouseStateContext = new MouseStateContext(new MouseStateDefault(this)); 110 | 111 | 112 | //init Gizmo Drawer 113 | GizmoDrawer.mouseStateContext = mouseStateContext; 114 | 115 | 116 | //subscribe to SceneView events 117 | SceneView.duringSceneGui -= OnScene; 118 | SceneView.duringSceneGui += OnScene; 119 | 120 | initFields(); 121 | } 122 | 123 | private void initFields() 124 | { 125 | // get total of floors 126 | floors = controllersFacade.getTileMapsCount(); 127 | //get tilemap params 128 | updateFieldsFromTileMap(); 129 | } 130 | 131 | private void updateFieldsFromTileMap() 132 | { 133 | var tilemap = getSelectedTileMap(); 134 | controllersFacade.updateFieldFromTileMap(tilemap, ref _gridLength, ref _gridWidth, ref _gridSize); 135 | } 136 | 137 | //handle mouse events when mouse cursor positioned in the scene view 138 | private void OnScene(SceneView scene) 139 | { 140 | var e = Event.current; 141 | 142 | if (e.type == EventType.MouseDown && e.button == 0) 143 | { 144 | mouseStateContext.onMouseClick(); 145 | return; 146 | } 147 | 148 | if (e.type == EventType.MouseDrag && e.button == 0) 149 | { 150 | mouseStateContext.onMouseClick(); 151 | return; 152 | } 153 | } 154 | 155 | private void OnGUI() 156 | { 157 | //styles 158 | var style = new GUIStyle(GUI.skin.label) {alignment = TextAnchor.MiddleCenter}; 159 | 160 | 161 | if (GUILayout.Button("Enter/Exit Editor Mode")) 162 | { 163 | inEditorMode = !inEditorMode; 164 | //disable previous brush 165 | mouseStateContext.state = new MouseStateDefault(this); 166 | 167 | if (inEditorMode) 168 | { 169 | //update visibility of floors correspondingly 170 | controllersFacade.hideTileMapsByIndex(selectedTileMapIndex); 171 | } 172 | else 173 | { 174 | controllersFacade.showAllTileMaps(); 175 | } 176 | } 177 | 178 | 179 | EditorGUI.BeginDisabledGroup(inEditorMode); 180 | GUILayout.Label("Grid attributes", EditorStyles.boldLabel); 181 | GUIField.showField(ref _gridSize, "Grid Size", 1, 100); 182 | GUIField.showField(ref _gridWidth, "Grid Width", 1, 999); 183 | GUIField.showField(ref _gridLength, "Grid Length", 1, 999); 184 | // tilemap index 185 | GUIField.showField(ref selectedTileMapIndex, "Tilemap index", 0, controllersFacade.getTileMapsCount() - 1); 186 | //floor controls buttons 187 | GUIField.showField(ref _floors, "Floors", 1, 999); 188 | 189 | removeMode = (RemoveMode) EditorGUILayout.EnumPopup("tilemap removing mode", removeMode); 190 | EditorGUI.EndDisabledGroup(); 191 | 192 | EditorGUI.BeginDisabledGroup(!inEditorMode); 193 | GUILayout.Label("Edit Mode", EditorStyles.boldLabel); 194 | _selectedTile = 195 | (GameObject) EditorGUILayout.ObjectField("Selected Tile", _selectedTile, typeof(GameObject), false); 196 | //brushes area 197 | //TODO: make different types of brushes 198 | GUILayout.BeginHorizontal(); 199 | if (GUILayout.Button("default brush")) 200 | { 201 | mouseStateContext.state = new MouseStateDefault(this); 202 | } 203 | 204 | if (GUILayout.Button("paint brush")) 205 | { 206 | mouseStateContext.state = new MouseStatePaint(this); 207 | } 208 | 209 | if (GUILayout.Button("delete brush")) 210 | { 211 | mouseStateContext.state = new MouseStateRemove(this); 212 | } 213 | 214 | GUILayout.EndHorizontal(); 215 | EditorGUI.EndDisabledGroup(); 216 | 217 | 218 | if (GUI.changed) 219 | { 220 | //one of the fields changed 221 | onFieldChange(); 222 | } 223 | 224 | GUIUtility.ExitGUI(); 225 | EditorGUILayout.EndToggleGroup(); 226 | } 227 | 228 | 229 | private void addNewTileMap() 230 | { 231 | controllersFacade.createNewTileMap(_gridLength, _gridWidth, _gridSize); 232 | } 233 | 234 | 235 | private void removeTileMap() 236 | { 237 | if (removeMode == RemoveMode.LAST) 238 | { 239 | if (selectedTileMapIndex == controllersFacade.getTileMapsCount() - 1) selectedTileMapIndex--; 240 | controllersFacade.removeTileMap(); 241 | return; 242 | } 243 | 244 | if (removeMode == RemoveMode.BY_INDEX) 245 | { 246 | controllersFacade.removeTileMap(selectedTileMapIndex--); 247 | } 248 | } 249 | 250 | private void onFieldChange() 251 | { 252 | //important: 253 | //use private field to prevent recursion 254 | 255 | try 256 | { 257 | if (selectedTileMapIndex < 0 || selectedTileMapIndex >= controllersFacade.getTileMapsCount()) 258 | { 259 | Debug.LogError("please verify the number of floors"); 260 | Debug.LogError("or enter a valid floor index"); 261 | 262 | return; 263 | } 264 | 265 | if (_floors <= 0) 266 | { 267 | Debug.LogError("Invalid floor number !"); 268 | return; 269 | } 270 | 271 | if (_gridSize <= 0) 272 | { 273 | Debug.LogError("Invalid grid size value !"); 274 | return; 275 | } 276 | 277 | if (_gridWidth <= 0) 278 | { 279 | Debug.LogError("Invalid grid width value !"); 280 | return; 281 | } 282 | 283 | if (_gridLength <= 0) 284 | { 285 | Debug.LogError("Invalid grid Length value !"); 286 | return; 287 | } 288 | 289 | // if all fields are valid 290 | FieldChanged(); 291 | } 292 | catch (System.Exception e) 293 | { 294 | Debug.LogError(e.StackTrace); 295 | //skip due to invalid input 296 | Debug.LogError(e.Message); 297 | } 298 | } 299 | 300 | private void FieldChanged() 301 | { 302 | //TODO:check if index changed 303 | // update the current tile map 304 | if (prevSelectedTileMapIndex == selectedTileMapIndex) 305 | { 306 | updateTheCurrentTileMap(); 307 | } 308 | else 309 | { 310 | prevSelectedTileMapIndex = selectedTileMapIndex; 311 | updateFieldsFromTileMap(); 312 | } 313 | 314 | //update floor 315 | updateFloors(); 316 | 317 | //tell mouse stat about the change 318 | if (mouseStateContext != null) 319 | { 320 | mouseStateContext.onFieldsUpdate(); 321 | } 322 | } 323 | 324 | private void updateFloors() 325 | { 326 | var diff = _floors - controllersFacade.getTileMapsCount(); 327 | 328 | //add tilemap 329 | //add at the end 330 | if (diff > 0) 331 | { 332 | addNewTileMap(); 333 | return; 334 | } 335 | 336 | //remove tilemap 337 | //remove current or remove the last 338 | if (diff < 0) 339 | { 340 | removeTileMap(); 341 | } 342 | } 343 | 344 | private void updateTheCurrentTileMap() 345 | { 346 | var tilemap = getSelectedTileMap(); 347 | controllersFacade.updateTileMap(tilemap, _gridLength, _gridWidth, _gridSize); 348 | } 349 | 350 | public void OnDisable() 351 | { 352 | Debug.Log("tilemap tool closed !"); 353 | 354 | if (mouseStateContext != null) mouseStateContext.onDestroy(); 355 | GizmoDrawer.mouseStateContext = null; 356 | //enable all hidden tilemaps 357 | controllersFacade.showAllTileMaps(); 358 | 359 | //unsubscribe to mouse events 360 | SceneView.duringSceneGui -= OnScene; 361 | } 362 | 363 | public TileMap getSelectedTileMap() 364 | { 365 | return controllersFacade.getTileMapHolder().tilemaps[selectedTileMapIndex]; 366 | } 367 | } 368 | } -------------------------------------------------------------------------------- /Editor/scripts/TileMap3d.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f30bab46138e4540a9e309a6a7b8fca2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Mohamed Bashar Touil 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 | -------------------------------------------------------------------------------- /LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38472169743c9f34b9c66dfb76126d8e 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |

3D tilemap Editor

6 | 7 |

8 | A Simple and easy to use 3d tilemap editor for unity 9 |
10 | Explore the docs » 11 |
12 |
13 | View Demo 14 | · 15 | Report Bug 16 | · 17 | Request Feature 18 |

19 |
20 | 21 | 22 | 23 | 24 |
25 | Table of Contents 26 |
    27 |
  1. 28 | About The Project 29 | 32 |
  2. 33 |
  3. Getting Started
  4. 34 |
  5. TODO / Planned Features
  6. 35 |
  7. Contributing
  8. 36 |
  9. License
  10. 37 |
  11. Contact
  12. 38 | 39 | 40 |
41 |
42 | 43 | 44 | 45 | 46 | 47 | ## About The Project 48 | 49 | ### A little Demo 50 | 51 | [![Watch the video](https://img.youtube.com/vi/ub6cY8s6PK0/maxresdefault.jpg)](https://youtu.be/ub6cY8s6PK0) 52 | 53 | A 3D Tile map Package helps developers create levels easily in 3d projects. Allowing developers to place objects or " 54 | Tiles" in scene view just by clicking, introducing fully 3d tile map support from gizmo visualization to multiple floor 55 | support. 56 | 57 | Here's why: 58 | 59 | * unfortunately unity doesn't support tile mapping for 3D projects yet 60 | * it's really hard for developers to make level prototype contain game-play that can be immediately tested 61 | * helping developers to focus more on game-play and game's content instead of wasting time organizing thousand of pieces 62 | to create levels . 63 | 64 |

(back to top)

65 | 66 | ### Built With 67 | 68 | * [UnityEditor API](https://docs.unity3d.com/ScriptReference/) 69 | 70 | 71 | 72 | ## Getting Started 73 | 74 | To Get Started follow steps provided in [unity docs](https://docs.unity3d.com/Manual/upm-ui-giturl.html). 75 | 76 | * use this git url 77 | ```sh 78 | https://github.com/somebodyawesome-dev/3d-tilemap-editor-unity.git 79 | ``` 80 | 81 | ## TODO / Planned Features 82 | 83 | - [x] Add multiple floor support 84 | - [x] Fix scaling bug when a project is reopened in unity 85 | - [ ] Upgrade UI 86 | - [ ] Add Short key support 87 | - [ ] Cleaning and refactoring 88 | 89 | See the [open issues](https://github.com/somebodyawesome-dev/3d-tilemap-editor-unity/issues) for a full list of proposed 90 | features ( 91 | and known issues). 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | ## Contributing 100 | 101 | Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any 102 | contributions you make are **greatly appreciated**. 103 | 104 | If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also 105 | simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again! 106 | 107 | 1. Fork the Project 108 | 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) 109 | 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) 110 | 4. Push to the Branch (`git push origin feature/AmazingFeature`) 111 | 5. Open a Pull Request 112 | 113 | 114 | 115 | ## License 116 | 117 | Distributed under the MIT License. See `LICENSE.txt` for more information. 118 | 119 | 120 | 121 | 122 | 123 | 124 | ## Contact 125 | 126 | toul mohamed bachar - [@bsh.twl](https://www.instagram.com/bsh.twl/) - luckynoob2011830@gmail.com 127 | 128 | Project 129 | Link: [https://github.com/somebodyawesome-dev/3d-tilemap-editor-unity](https://github.com/somebodyawesome-dev/3d-tilemap-editor-unity) 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a6924bd7f08a9644a99570c5015c8a7 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Screenshot 2022-04-11 231835.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somebodyawesome-dev/3d-tilemap-editor-unity/9b913c39acd591b9e627a41e6ef9a6bcdd5ab81b/Screenshot 2022-04-11 231835.jpg -------------------------------------------------------------------------------- /Screenshot 2022-04-11 231835.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6122707ec753f6a488d3d041cad7523d 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: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 0 39 | wrapV: 0 40 | wrapW: 0 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 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | spriteSheet: 79 | serializedVersion: 2 80 | sprites: [] 81 | outline: [] 82 | physicsShape: [] 83 | bones: [] 84 | spriteID: 85 | internalID: 0 86 | vertices: [] 87 | indices: 88 | edges: [] 89 | weights: [] 90 | secondaryTextures: [] 91 | spritePackingTag: 92 | pSDRemoveMatte: 0 93 | pSDShowRemoveMatteOption: 0 94 | userData: 95 | assetBundleName: 96 | assetBundleVariant: 97 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.somebodyawesome.3dtilemapeditor", 3 | "version": "1.0.0", 4 | "displayName": "3D Tilemap Editor", 5 | "description": "Tilemap editor that support 3d tilemaps", 6 | "unity": "2019.1", 7 | "unityRelease": "0b5", 8 | "documentationUrl": "https://example.com/", 9 | "changelogUrl": "https://example.com/changelog.html", 10 | "licensesUrl": "https://example.com/licensing.html", 11 | "dependencies": {}, 12 | "keywords": [ 13 | "tilemap", 14 | "unity", 15 | "3d" 16 | ], 17 | "author": { 18 | "name": "Somebodyawesome", 19 | "email": "luckynoob2011830@gmail.com", 20 | "url": "https://github.com/somebodyawesome-dev" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec367e7290efdc24e8337eb10c164654 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /samples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afe52e06594850147a1f4271aaae6393 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /samples/Scene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f5643dc4de26f542ab41c3fc5d7f83c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /samples/prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed553d9fc1244c643b86072d15217825 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | --------------------------------------------------------------------------------