Skip to content

Commit

Permalink
Refactor the tilemap menu (#1355)
Browse files Browse the repository at this point in the history
* Little cleanup

* Split Place() into two with input acitons

* Place action is performed on release

* Rewrite tile construction menu script

* Implement dragging

* Implement correct placing

* Implement deleting

* Fix stuff, implement square form

* Rearrange stuff

* Fix everything, rearrenge methods into regions, rename GhostManager to BuildGhost

* Add comments, resize menu

* Add comment

* Move methods into helpers

* Reimplement restrained rotations

* Remove redundant dependencies

* make it work

* activate ghosts

* add material database

* renaming

* set rotation correctly

* add last registered direction

* fix merge errors

* fix broken body parts

* big refactor

* another bunch of refactoring

* some encapsulation

* more splitting

* some doc and renaming

* some more refactoring

* doc and clean up

* doc

* clean up, doc and renaming

* set up missing value

* fix hand bugging due to bad merge

* refresh hologram after adding them

* move handle load and handle save to tilemapmenusaveandloadtabs

* Rename stuff, beutify code, move handlers

* Move input logic

---------

Co-authored-by: Mechar418 <[email protected]>
  • Loading branch information
stilnat and iamteapot422 authored Nov 30, 2023
1 parent ad4e1ea commit 63eeeab
Show file tree
Hide file tree
Showing 39 changed files with 1,248 additions and 892 deletions.
1 change: 1 addition & 0 deletions Assets/Content/Addressables/AddressableAssetSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: dd394b793b56e43418a2c11a61130663, type: 2}
- {fileID: 11400000, guid: d640c8e212e7a5349999a9ddd6ffb5b5, type: 2}
- {fileID: 11400000, guid: d700978032e12a647b8734863a0bf7c2, type: 2}
- {fileID: 11400000, guid: 2caa591261a883b4183d04829ce705fd, type: 2}
m_BuildSettings:
m_CompileScriptsInVirtualMode: 0
m_CleanupStreamingAssetsAfterBuilds: 1
Expand Down
8 changes: 4 additions & 4 deletions Assets/Content/Addressables/AssetGroups/BodyParts.asset
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ MonoBehaviour:
m_Address: Assets/Content/WorldObjects/Entities/Humanoids/Human/HumanOrgans/HumanLiver.prefab
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: ea5b9b571f8df3948b52b7023aa66c99
m_Address: Assets/Content/WorldObjects/Entities/Humanoids/Human/HumanOrgans/HumanHeart.prefab
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: 1e304f9a331c2ba419514ef8afb8a13c
m_Address: Assets/Content/WorldObjects/Entities/Humanoids/Human/HumanOrgans/HumanIntestineLarge.prefab
m_ReadOnly: 0
Expand All @@ -97,6 +93,10 @@ MonoBehaviour:
m_Address: Assets/Content/WorldObjects/Entities/Humanoids/Human/HumanOrgans/HumanBrain.prefab
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: fccdc78a6cf916047ba52f2877f755e5
m_Address: Assets/Content/WorldObjects/Entities/Humanoids/Human/HumanOrgans/HumanHeart.prefab
m_ReadOnly: 0
m_SerializedLabels: []
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: ddc57d0f5f9fb874e8a26db0c5b215e0, type: 2}
m_SchemaSet:
Expand Down
37 changes: 37 additions & 0 deletions Assets/Content/Addressables/AssetGroups/Materials.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
m_Name: Materials
m_EditorClassIdentifier:
m_GroupName: Materials
m_Data:
m_SerializedData: []
m_GUID: ca573a7d9c8fb1044a5ceb85f048f213
m_SerializeEntries:
- m_GUID: ed5a1263eb564c94abc6407ac0919ea7
m_Address: Assets/Content/WorldObjects/World/VFX/Construction/DeleteConstruction.mat
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: e9b99cfb2e59ffa40a062c2f4b88b729
m_Address: Assets/Content/WorldObjects/World/VFX/Construction/InvalidConstruction.mat
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: 6d2a18aa72cbaf94694dce9f8451160b
m_Address: Assets/Content/WorldObjects/World/VFX/Construction/ValidConstruction.mat
m_ReadOnly: 0
m_SerializedLabels: []
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: ddc57d0f5f9fb874e8a26db0c5b215e0, type: 2}
m_SchemaSet:
m_Schemas:
- {fileID: 11400000, guid: 84c038900429ad74e9cf6f6d27f33ade, type: 2}
- {fileID: 11400000, guid: b22abbf9f6bc06c4491b5c4a8258a702, type: 2}
14 changes: 14 additions & 0 deletions Assets/Content/Addressables/AssetGroups/Materials.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
m_Name: Materials_BundledAssetGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: 2caa591261a883b4183d04829ce705fd, type: 2}
m_InternalBundleIdMode: 1
m_Compression: 1
m_IncludeAddressInCatalog: 1
m_IncludeGUIDInCatalog: 1
m_IncludeLabelsInCatalog: 1
m_InternalIdNamingMode: 0
m_CacheClearBehavior: 0
m_IncludeInBuild: 1
m_BundledAssetProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
m_ForceUniqueProvider: 0
m_UseAssetBundleCache: 1
m_UseAssetBundleCrc: 1
m_UseAssetBundleCrcForCachedBundles: 1
m_UseUWRForLocalBundles: 0
m_Timeout: 0
m_ChunkedTransfer: 0
m_RedirectLimit: -1
m_RetryCount: 0
m_BuildPath:
m_Id: 56790a984472fbe4a809c1ab1b0e4c79
m_LoadPath:
m_Id: 8abc09617b79e8b4994b07cc672cbbe5
m_BundleMode: 0
m_AssetBundleProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
m_BundleNaming: 0
m_AssetLoadMode: 0

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
m_Name: Materials_ContentUpdateGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: 2caa591261a883b4183d04829ce705fd, type: 2}
m_StaticContent: 0

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/Content/Data/BodyParts.asset
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ MonoBehaviour:
- {fileID: 1705603677127675533, guid: a019475d05ec8824494b0fa88e2282d8, type: 3}
- {fileID: 5774385816057912484, guid: 2bc6f6a968d5ba04c919ba56d0ccdab4, type: 3}
- {fileID: 5774385816057912484, guid: d75ff9a3ac207a84487ec1ee73a676fc, type: 3}
- {fileID: 2302397424301738637, guid: ea5b9b571f8df3948b52b7023aa66c99, type: 3}
- {fileID: 5774385816057912484, guid: 1e304f9a331c2ba419514ef8afb8a13c, type: 3}
- {fileID: 5774385816057912484, guid: 071581df025e1ba49a8a75eb39611ff6, type: 3}
- {fileID: 5774385816057912484, guid: 7579883b8dd8801448a176adace4860b, type: 3}
- {fileID: 2302397424301738637, guid: fccdc78a6cf916047ba52f2877f755e5, type: 3}
14 changes: 0 additions & 14 deletions Assets/Content/Data/Items.asset
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,3 @@ MonoBehaviour:
- {fileID: 726792282085660869, guid: 4635651592391df41b6b2413afdb76c3, type: 3}
- {fileID: 7723921361698481624, guid: f549f4153ef612c4586c46ea280e0e94, type: 3}
- {fileID: 8712940276313799639, guid: 1a2f912be4bc1b948a2b22ffde517cdc, type: 3}
- {fileID: 5774385816057912484, guid: 7579883b8dd8801448a176adace4860b, type: 3}
- {fileID: 6632297082311541152, guid: e60ba1e09be8316448e419ecbdfb64a6, type: 3}
- {fileID: 6958959792659314810, guid: 94aaf82bb6ab002418e01d9cc7c6eaaa, type: 3}
- {fileID: 5562010227207703736, guid: 4a9d34a6cf84ef045a740513d8ae30b1, type: 3}
- {fileID: 2207730063960764759, guid: 35dfc7c3f708a5b48a206b4a44e7ab49, type: 3}
- {fileID: 7546631754298856378, guid: 7f5954f009d06b2439ca637b43920440, type: 3}
- {fileID: 3470038122221450171, guid: ecaf79b0a74bdb443a350e88daa94a66, type: 3}
- {fileID: 8256619991674398311, guid: 242a937784a622f4f8a6e6d097e0737c, type: 3}
- {fileID: 1888615333292121711, guid: 06b6be83779804245b7f6411fe07b851, type: 3}
- {fileID: 832941577213411195, guid: 432a4ad70e41e5c4f8f913f76fe0e66c, type: 3}
- {fileID: 8006468508714419156, guid: cc54bc74b2f4c2349b1f84b501b0a091, type: 3}
- {fileID: 1705603677127675533, guid: a019475d05ec8824494b0fa88e2282d8, type: 3}
- {fileID: 8304480218026041231, guid: a8b265034e3f79344a6067b406e1bff6, type: 3}
- {fileID: 2302397424301738637, guid: ea5b9b571f8df3948b52b7023aa66c99, type: 3}
21 changes: 21 additions & 0 deletions Assets/Content/Data/Materials.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3c9b6c8ad6324c838c1743c2a2e2abc4, type: 3}
m_Name: Materials
m_EditorClassIdentifier:
EnumNamespaceName: SS3D.Data.Enums
EnumName: MaterialsIds
AssetGroup: {fileID: 11400000, guid: 2caa591261a883b4183d04829ce705fd, type: 2}
Assets:
- {fileID: 2100000, guid: ed5a1263eb564c94abc6407ac0919ea7, type: 2}
- {fileID: 2100000, guid: e9b99cfb2e59ffa40a062c2f4b88b729, type: 2}
- {fileID: 2100000, guid: 6d2a18aa72cbaf94694dce9f8451160b, type: 2}
8 changes: 8 additions & 0 deletions Assets/Content/Data/Materials.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 63eeeab

Please sign in to comment.