From a1c2ca3f9905bd8ee8d002b7c2372314184eed5f Mon Sep 17 00:00:00 2001 From: Em3rgencyLT Date: Tue, 4 Jan 2022 20:41:58 +0200 Subject: [PATCH] add editor assembly definition, move all editor scripts to one location (#882) --- .../Editor.meta => Editor/Atmospherics.meta} | 2 +- .../Atmospherics}/AtmosDebug.cs | 7 ++--- .../Atmospherics}/AtmosDebug.cs.meta | 0 Assets/Editor/EditorDefinitions.asmdef | 18 +++++++++++++ Assets/Editor/EditorDefinitions.asmdef.meta | 7 +++++ .../Inventory/Editor.meta => Editor/FOV.meta} | 2 +- .../FOV}/FieldOfViewEditor.cs | 0 .../FOV}/FieldOfViewEditor.cs.meta | 0 .../Editor.meta => Editor/Inventory.meta} | 2 +- .../Inventory}/ContainerDescriptorEditor.cs | 0 .../ContainerDescriptorEditor.cs.meta | 0 Assets/Editor/TileMap.meta | 8 ++++++ .../TileMap}/AdjacencyEditor.cs | 7 ++--- .../TileMap}/AdjacencyEditor.cs.meta | 0 .../TileMap}/TileDragHandler.cs | 9 ++++--- .../TileMap}/TileDragHandler.cs.meta | 0 .../TileMap}/TileMapEditor.cs | 27 +++++++++---------- .../TileMap}/TileMapEditor.cs.meta | 0 .../TileMap}/TileObjectMigrator.cs | 6 ++--- .../TileMap}/TileObjectMigrator.cs.meta | 0 Assets/Engine/Atmospherics/Editor.meta | 12 --------- Assets/Engine/Debug/EasyButtons/Editor.meta | 11 +++----- .../EasyButtons/Editor/EasyButtons.asmref | 3 +++ .../Editor/EasyButtons.asmref.meta | 7 +++++ Assets/Engine/Tile/TileRework/TileManager.cs | 4 +-- 25 files changed, 77 insertions(+), 55 deletions(-) rename Assets/{Engine/FOV/Editor.meta => Editor/Atmospherics.meta} (77%) rename Assets/{Engine/Atmospherics/Editor => Editor/Atmospherics}/AtmosDebug.cs (99%) rename Assets/{Engine/Atmospherics/Editor => Editor/Atmospherics}/AtmosDebug.cs.meta (100%) create mode 100644 Assets/Editor/EditorDefinitions.asmdef create mode 100644 Assets/Editor/EditorDefinitions.asmdef.meta rename Assets/{Engine/Inventory/Editor.meta => Editor/FOV.meta} (77%) rename Assets/{Engine/FOV/Editor => Editor/FOV}/FieldOfViewEditor.cs (100%) rename Assets/{Engine/FOV/Editor => Editor/FOV}/FieldOfViewEditor.cs.meta (100%) rename Assets/{Engine/Tile/TileRework/Editor.meta => Editor/Inventory.meta} (77%) rename Assets/{Engine/Inventory/Editor => Editor/Inventory}/ContainerDescriptorEditor.cs (100%) rename Assets/{Engine/Inventory/Editor => Editor/Inventory}/ContainerDescriptorEditor.cs.meta (100%) create mode 100644 Assets/Editor/TileMap.meta rename Assets/{Engine/Tile/TileRework/Editor => Editor/TileMap}/AdjacencyEditor.cs (96%) rename Assets/{Engine/Tile/TileRework/Editor => Editor/TileMap}/AdjacencyEditor.cs.meta (100%) rename Assets/{Engine/Tile/TileRework/Editor => Editor/TileMap}/TileDragHandler.cs (96%) rename Assets/{Engine/Tile/TileRework/Editor => Editor/TileMap}/TileDragHandler.cs.meta (100%) rename Assets/{Engine/Tile/TileRework/Editor => Editor/TileMap}/TileMapEditor.cs (99%) rename Assets/{Engine/Tile/TileRework/Editor => Editor/TileMap}/TileMapEditor.cs.meta (100%) rename Assets/{Engine/Tile/TileRework/Editor => Editor/TileMap}/TileObjectMigrator.cs (86%) rename Assets/{Engine/Tile/TileRework/Editor => Editor/TileMap}/TileObjectMigrator.cs.meta (100%) delete mode 100644 Assets/Engine/Atmospherics/Editor.meta create mode 100644 Assets/Engine/Debug/EasyButtons/Editor/EasyButtons.asmref create mode 100644 Assets/Engine/Debug/EasyButtons/Editor/EasyButtons.asmref.meta diff --git a/Assets/Engine/FOV/Editor.meta b/Assets/Editor/Atmospherics.meta similarity index 77% rename from Assets/Engine/FOV/Editor.meta rename to Assets/Editor/Atmospherics.meta index 3deb064022..a2d59a750d 100644 --- a/Assets/Engine/FOV/Editor.meta +++ b/Assets/Editor/Atmospherics.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e1023e4e342a4d247a43239f791d5e7c +guid: bfe77e10555311045abbf97b014c04c4 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Engine/Atmospherics/Editor/AtmosDebug.cs b/Assets/Editor/Atmospherics/AtmosDebug.cs similarity index 99% rename from Assets/Engine/Atmospherics/Editor/AtmosDebug.cs rename to Assets/Editor/Atmospherics/AtmosDebug.cs index 712a4b3f7b..b32a524bbd 100644 --- a/Assets/Engine/Atmospherics/Editor/AtmosDebug.cs +++ b/Assets/Editor/Atmospherics/AtmosDebug.cs @@ -1,11 +1,8 @@ -using SS3D.Engine.Tiles; -using System; -using System.Collections; -using System.Collections.Generic; +using System; using UnityEditor; using UnityEngine; -namespace SS3D.Engine.Atmospherics +namespace SS3D.Editor.Atmospherics { // TODO, move to editors public class AtmosDebug : EditorWindow diff --git a/Assets/Engine/Atmospherics/Editor/AtmosDebug.cs.meta b/Assets/Editor/Atmospherics/AtmosDebug.cs.meta similarity index 100% rename from Assets/Engine/Atmospherics/Editor/AtmosDebug.cs.meta rename to Assets/Editor/Atmospherics/AtmosDebug.cs.meta diff --git a/Assets/Editor/EditorDefinitions.asmdef b/Assets/Editor/EditorDefinitions.asmdef new file mode 100644 index 0000000000..1284f526f4 --- /dev/null +++ b/Assets/Editor/EditorDefinitions.asmdef @@ -0,0 +1,18 @@ +{ + "name": "EditorDefinitions", + "references": [ + "GUID:2b0396ce7dd650b49913445322785073", + "GUID:30817c1a0e6d646d99c048fc403f5979" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Editor/EditorDefinitions.asmdef.meta b/Assets/Editor/EditorDefinitions.asmdef.meta new file mode 100644 index 0000000000..faed4ad0eb --- /dev/null +++ b/Assets/Editor/EditorDefinitions.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: adfd753e6e0bb234fb7143be344f1fa4 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Engine/Inventory/Editor.meta b/Assets/Editor/FOV.meta similarity index 77% rename from Assets/Engine/Inventory/Editor.meta rename to Assets/Editor/FOV.meta index ead5293ff2..c7edca69bb 100644 --- a/Assets/Engine/Inventory/Editor.meta +++ b/Assets/Editor/FOV.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 41856b99dd32d8840a3e598ab2fb51db +guid: 5e01aeab41fa4a94d9d3b34fc1e6820c folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Engine/FOV/Editor/FieldOfViewEditor.cs b/Assets/Editor/FOV/FieldOfViewEditor.cs similarity index 100% rename from Assets/Engine/FOV/Editor/FieldOfViewEditor.cs rename to Assets/Editor/FOV/FieldOfViewEditor.cs diff --git a/Assets/Engine/FOV/Editor/FieldOfViewEditor.cs.meta b/Assets/Editor/FOV/FieldOfViewEditor.cs.meta similarity index 100% rename from Assets/Engine/FOV/Editor/FieldOfViewEditor.cs.meta rename to Assets/Editor/FOV/FieldOfViewEditor.cs.meta diff --git a/Assets/Engine/Tile/TileRework/Editor.meta b/Assets/Editor/Inventory.meta similarity index 77% rename from Assets/Engine/Tile/TileRework/Editor.meta rename to Assets/Editor/Inventory.meta index c8a46da176..ea371cc62e 100644 --- a/Assets/Engine/Tile/TileRework/Editor.meta +++ b/Assets/Editor/Inventory.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 71660cef1c540784e9b8cfb18c6966af +guid: 4fbeea1b963ac50498bfc20d4ca45cdb folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Engine/Inventory/Editor/ContainerDescriptorEditor.cs b/Assets/Editor/Inventory/ContainerDescriptorEditor.cs similarity index 100% rename from Assets/Engine/Inventory/Editor/ContainerDescriptorEditor.cs rename to Assets/Editor/Inventory/ContainerDescriptorEditor.cs diff --git a/Assets/Engine/Inventory/Editor/ContainerDescriptorEditor.cs.meta b/Assets/Editor/Inventory/ContainerDescriptorEditor.cs.meta similarity index 100% rename from Assets/Engine/Inventory/Editor/ContainerDescriptorEditor.cs.meta rename to Assets/Editor/Inventory/ContainerDescriptorEditor.cs.meta diff --git a/Assets/Editor/TileMap.meta b/Assets/Editor/TileMap.meta new file mode 100644 index 0000000000..c7f35188f2 --- /dev/null +++ b/Assets/Editor/TileMap.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca9c1eb7d75aa774096c88fa727e1c1e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Engine/Tile/TileRework/Editor/AdjacencyEditor.cs b/Assets/Editor/TileMap/AdjacencyEditor.cs similarity index 96% rename from Assets/Engine/Tile/TileRework/Editor/AdjacencyEditor.cs rename to Assets/Editor/TileMap/AdjacencyEditor.cs index e3825e2f6c..d0f5ac2de3 100644 --- a/Assets/Engine/Tile/TileRework/Editor/AdjacencyEditor.cs +++ b/Assets/Editor/TileMap/AdjacencyEditor.cs @@ -1,10 +1,11 @@ -using SS3D.Engine.Tile.TileRework.Connections; +using SS3D.Engine.Tile.TileRework; +using SS3D.Engine.Tile.TileRework.Connections; using SS3D.Engine.Tile.TileRework.Connections.AdjacencyTypes; using SS3D.Engine.Tiles; using UnityEditor; using UnityEngine; -namespace SS3D.Engine.Tile.TileRework.Editor +namespace SS3D.Editor.TileMap { /// /// Custom editor used for setting blocked connections. @@ -70,7 +71,7 @@ public override void OnInspectorGUI() { // Get the PlacedTileObject and map var placedObject = connector.gameObject.GetComponent(); - TileMap map = connector.gameObject.GetComponentInParent(); + Engine.Tiles.TileMap map = connector.gameObject.GetComponentInParent(); // Get all neighbours var neighbourObjects = map.GetNeighbourObjects(placedObject.GetLayer(), 0, placedObject.transform.position); diff --git a/Assets/Engine/Tile/TileRework/Editor/AdjacencyEditor.cs.meta b/Assets/Editor/TileMap/AdjacencyEditor.cs.meta similarity index 100% rename from Assets/Engine/Tile/TileRework/Editor/AdjacencyEditor.cs.meta rename to Assets/Editor/TileMap/AdjacencyEditor.cs.meta diff --git a/Assets/Engine/Tile/TileRework/Editor/TileDragHandler.cs b/Assets/Editor/TileMap/TileDragHandler.cs similarity index 96% rename from Assets/Engine/Tile/TileRework/Editor/TileDragHandler.cs rename to Assets/Editor/TileMap/TileDragHandler.cs index e8c2e7c2fa..f28db86751 100644 --- a/Assets/Engine/Tile/TileRework/Editor/TileDragHandler.cs +++ b/Assets/Editor/TileMap/TileDragHandler.cs @@ -1,17 +1,18 @@ using System; using System.Collections.Generic; using SS3D.Engine.Tile.TileRework; +using SS3D.Engine.Tiles; using UnityEditor; using UnityEngine; -namespace SS3D.Engine.Tiles.Editor.TileMapEditor +namespace SS3D.Editor.TileMap { /** * Handles creating a dragging rect and converting that into real tiles in the scene. */ public class TileDragHandler { - public TileDragHandler(TileManager tileManager, TileMapEditor mapEditor, TileMap map, int subLayerIndex, TileObjectSo tileObjectSO, Direction selectedDir, Vector3Int snappedPosition) + public TileDragHandler(TileManager tileManager, TileMapEditor mapEditor, Engine.Tiles.TileMap map, int subLayerIndex, TileObjectSo tileObjectSO, Direction selectedDir, Vector3Int snappedPosition) { this.tileManager = tileManager; this.mapEditor = mapEditor; @@ -29,7 +30,7 @@ public TileDragHandler(TileManager tileManager, TileMapEditor mapEditor, TileMap private GameObject CreateGhost() { - GameObject ghostObject = EditorAndRuntime.InstantiatePrefab(tileObjectSO.prefab); + GameObject ghostObject = (GameObject)PrefabUtility.InstantiatePrefab(tileObjectSO.prefab); ghostObject.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity); ghostObject.name = "Ghost object"; ghostObject.tag = "EditorOnly"; @@ -226,7 +227,7 @@ private void ShowTiles() private readonly TileManager tileManager; private readonly TileMapEditor mapEditor; - private readonly TileMap map; + private readonly Engine.Tiles.TileMap map; private readonly int subLayerIndex; private readonly TileObjectSo tileObjectSO; private readonly Direction selectedDir; diff --git a/Assets/Engine/Tile/TileRework/Editor/TileDragHandler.cs.meta b/Assets/Editor/TileMap/TileDragHandler.cs.meta similarity index 100% rename from Assets/Engine/Tile/TileRework/Editor/TileDragHandler.cs.meta rename to Assets/Editor/TileMap/TileDragHandler.cs.meta diff --git a/Assets/Engine/Tile/TileRework/Editor/TileMapEditor.cs b/Assets/Editor/TileMap/TileMapEditor.cs similarity index 99% rename from Assets/Engine/Tile/TileRework/Editor/TileMapEditor.cs rename to Assets/Editor/TileMap/TileMapEditor.cs index e4869976d8..f41145584c 100644 --- a/Assets/Engine/Tile/TileRework/Editor/TileMapEditor.cs +++ b/Assets/Editor/TileMap/TileMapEditor.cs @@ -1,16 +1,15 @@ -using SS3D.Engine.Tiles; -using SS3D.Engine.Tiles.Connections; -using System; +using System; using System.Collections.Generic; -using System.Threading; using SS3D.Engine.Tile.TileRework; +using SS3D.Engine.Tiles; +using SS3D.Engine.Tiles.Connections; using UnityEditor; using UnityEngine; /// /// This is the main editor for changing the tilemap. /// -namespace SS3D.Engine.Tiles.Editor.TileMapEditor +namespace SS3D.Editor.TileMap { public class TileMapEditor : EditorWindow { @@ -263,7 +262,7 @@ public void OnGUI() /// private void ApplySettings() { - TileMap map = tileManager.GetTileMaps()[selectedTileMapIndex]; + Engine.Tiles.TileMap map = tileManager.GetTileMaps()[selectedTileMapIndex]; map.SetName(selectedName); map.IsMain = isMainMap; @@ -449,12 +448,12 @@ private void RefreshMapList() } } - private TileMap GetCurrentMap() + private Engine.Tiles.TileMap GetCurrentMap() { return tileManager.GetTileMaps()[selectedTileMapIndex]; } - private void FillGridOptions(TileMap map) + private void FillGridOptions(Engine.Tiles.TileMap map) { selectedName = map.GetName(); isMainMap = map.IsMain; @@ -497,7 +496,7 @@ private void DisplayVisualHelp(Vector3 cell) /// Draws the edges of chunks. /// /// Map to get chunks from - private void DisplayGrid(TileMap map) + private void DisplayGrid(Engine.Tiles.TileMap map) { Handles.color = Color.cyan; Vector3 offset = new Vector3(0.5f, 0, 0.5f); @@ -505,10 +504,10 @@ private void DisplayGrid(TileMap map) TileChunk[] chunks = map.GetChunks(); foreach (var chunk in chunks) { - Handles.DrawLine(chunk.GetOrigin() - offset, chunk.GetOrigin() + new Vector3(TileMap.CHUNK_SIZE, 0, 0) - offset); - Handles.DrawLine(chunk.GetOrigin() - offset, chunk.GetOrigin() + new Vector3(0, 0, TileMap.CHUNK_SIZE) - offset); - Handles.DrawLine(chunk.GetOrigin() - offset + new Vector3(TileMap.CHUNK_SIZE, 0, 0), chunk.GetOrigin() + new Vector3(TileMap.CHUNK_SIZE, 0, TileMap.CHUNK_SIZE) - offset); - Handles.DrawLine(chunk.GetOrigin() - offset + new Vector3(0, 0, TileMap.CHUNK_SIZE), chunk.GetOrigin() + new Vector3(TileMap.CHUNK_SIZE, 0, TileMap.CHUNK_SIZE) - offset); + Handles.DrawLine(chunk.GetOrigin() - offset, chunk.GetOrigin() + new Vector3(Engine.Tiles.TileMap.CHUNK_SIZE, 0, 0) - offset); + Handles.DrawLine(chunk.GetOrigin() - offset, chunk.GetOrigin() + new Vector3(0, 0, Engine.Tiles.TileMap.CHUNK_SIZE) - offset); + Handles.DrawLine(chunk.GetOrigin() - offset + new Vector3(Engine.Tiles.TileMap.CHUNK_SIZE, 0, 0), chunk.GetOrigin() + new Vector3(Engine.Tiles.TileMap.CHUNK_SIZE, 0, Engine.Tiles.TileMap.CHUNK_SIZE) - offset); + Handles.DrawLine(chunk.GetOrigin() - offset + new Vector3(0, 0, Engine.Tiles.TileMap.CHUNK_SIZE), chunk.GetOrigin() + new Vector3(Engine.Tiles.TileMap.CHUNK_SIZE, 0, Engine.Tiles.TileMap.CHUNK_SIZE) - offset); } } @@ -584,7 +583,7 @@ private void DestroyGhost() /// private void UpdateTileVisibility() { - TileMap map = GetCurrentMap(); + Engine.Tiles.TileMap map = GetCurrentMap(); foreach (TileLayer layer in TileHelper.GetTileLayers()) { bool visible = layerVisibilitySelection[(int)layer]; diff --git a/Assets/Engine/Tile/TileRework/Editor/TileMapEditor.cs.meta b/Assets/Editor/TileMap/TileMapEditor.cs.meta similarity index 100% rename from Assets/Engine/Tile/TileRework/Editor/TileMapEditor.cs.meta rename to Assets/Editor/TileMap/TileMapEditor.cs.meta diff --git a/Assets/Engine/Tile/TileRework/Editor/TileObjectMigrator.cs b/Assets/Editor/TileMap/TileObjectMigrator.cs similarity index 86% rename from Assets/Engine/Tile/TileRework/Editor/TileObjectMigrator.cs rename to Assets/Editor/TileMap/TileObjectMigrator.cs index 0e8b070ffd..be086db237 100644 --- a/Assets/Engine/Tile/TileRework/Editor/TileObjectMigrator.cs +++ b/Assets/Editor/TileMap/TileObjectMigrator.cs @@ -1,10 +1,8 @@ -using System.Collections; -using System.Collections.Generic; -using SS3D.Engine.Tile.TileRework; +using SS3D.Engine.Tile.TileRework; using UnityEditor; using UnityEngine; -namespace SS3D.Engine.Tiles.Editor.TileMapEditor +namespace SS3D.Editor.TileMap { public class TileObjectMigrator : MonoBehaviour { diff --git a/Assets/Engine/Tile/TileRework/Editor/TileObjectMigrator.cs.meta b/Assets/Editor/TileMap/TileObjectMigrator.cs.meta similarity index 100% rename from Assets/Engine/Tile/TileRework/Editor/TileObjectMigrator.cs.meta rename to Assets/Editor/TileMap/TileObjectMigrator.cs.meta diff --git a/Assets/Engine/Atmospherics/Editor.meta b/Assets/Engine/Atmospherics/Editor.meta deleted file mode 100644 index 91b7d0d9d4..0000000000 --- a/Assets/Engine/Atmospherics/Editor.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -<<<<<<< Updated upstream:Assets/Content/Furniture/Machines/Atmospherics/Canister.meta -guid: 12438234a7864ee4e9a7c4fae4949455 -======= -guid: 04c771012d81cd641a69e02f6ace072e ->>>>>>> Stashed changes:Assets/Engine/Atmospherics/Editor.meta -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Engine/Debug/EasyButtons/Editor.meta b/Assets/Engine/Debug/EasyButtons/Editor.meta index 627fe2d188..e592013e15 100644 --- a/Assets/Engine/Debug/EasyButtons/Editor.meta +++ b/Assets/Engine/Debug/EasyButtons/Editor.meta @@ -1,8 +1,3 @@ -fileFormatVersion: 2 -guid: a1d0732956bd8c545bfa3bc82289f4f9 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: fc7cddccfc8d4df981e373c980a34829 +timeCreated: 1641283253 \ No newline at end of file diff --git a/Assets/Engine/Debug/EasyButtons/Editor/EasyButtons.asmref b/Assets/Engine/Debug/EasyButtons/Editor/EasyButtons.asmref new file mode 100644 index 0000000000..e468db64da --- /dev/null +++ b/Assets/Engine/Debug/EasyButtons/Editor/EasyButtons.asmref @@ -0,0 +1,3 @@ +{ + "reference": "GUID:adfd753e6e0bb234fb7143be344f1fa4" +} \ No newline at end of file diff --git a/Assets/Engine/Debug/EasyButtons/Editor/EasyButtons.asmref.meta b/Assets/Engine/Debug/EasyButtons/Editor/EasyButtons.asmref.meta new file mode 100644 index 0000000000..3c83d6e982 --- /dev/null +++ b/Assets/Engine/Debug/EasyButtons/Editor/EasyButtons.asmref.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9f0771fe28cfd4a48aab911f4dba7d20 +AssemblyDefinitionReferenceImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Engine/Tile/TileRework/TileManager.cs b/Assets/Engine/Tile/TileRework/TileManager.cs index 34103dc804..54e4f6aa94 100644 --- a/Assets/Engine/Tile/TileRework/TileManager.cs +++ b/Assets/Engine/Tile/TileRework/TileManager.cs @@ -79,8 +79,8 @@ private void Init() } tileObjectSOs = listTileObjectSO.ToArray(); #else - Resources.LoadAll(""); - tileObjectSOs = Resources.FindObjectsOfTypeAll(); + Resources.LoadAll(""); + tileObjectSOs = Resources.FindObjectsOfTypeAll(); #endif LoadAll(true);