Merge pull request 'Навел порядок в проекте, сделал переход на 3D' (#1) from feature/fixProject into master
Reviewed-on: #1 Reviewed-by: abysscion <borisov.av.dev@yandex.ru>
This commit was merged in pull request #1.
This commit is contained in:
@@ -1,533 +0,0 @@
|
||||
%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: bae8eeae2da7d3f4396883671b297a47, type: 3}
|
||||
m_Name: ChunkTemplate
|
||||
m_EditorClassIdentifier: Assembly-CSharp::InfiniteWorld.ChunkTemplate
|
||||
width: 16
|
||||
height: 16
|
||||
exitTop: 1
|
||||
exitRight: 1
|
||||
exitBottom: 1
|
||||
exitLeft: 1
|
||||
cells:
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 1
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 0
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 1
|
||||
- wall: 0
|
||||
environment: 0
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b81ed0cda0a7d4468d5d9eba5be92dd
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,27 +0,0 @@
|
||||
%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: 3ad70174b079c2f4ebc7931d3dd1af6f, type: 3}
|
||||
m_Name: DefaultPrefabObjects
|
||||
m_EditorClassIdentifier: FishNet.Runtime::FishNet.Managing.Object.DefaultPrefabObjects
|
||||
_prefabs:
|
||||
- {fileID: 4512293259955182956, guid: fe2b65b02f0484b41aa8cfa9fbbb0e1d, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: 35639798ad77fc145871588b25d66259, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: 0d6d0f48b03b17f49a6340103cd9b9d0, type: 3}
|
||||
- {fileID: 8475222101369129519, guid: 8cf33e8e99a9b0c4c8f29ff725650de6, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: dafef736ca1ae384e9a19eb672843563, type: 3}
|
||||
- {fileID: 201277550, guid: 5b712878ecece354ba4ffb026c0a221c, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: b8017cef39731ba439c70fecc09488e3, type: 3}
|
||||
- {fileID: 201277550, guid: 26a567abbe21227428f5c3d309d1d73c, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: 44611030e61220d42ab7c37ba3c0ea92, type: 3}
|
||||
- {fileID: 8192566354860284824, guid: 6331b3542e64a564c81bc39cedf70c8d, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: f32d4c19de900e64cb73cedcb8ba6f70, type: 3}
|
||||
- {fileID: 611616139817875448, guid: bf5f023b4017a5e41a9815ec5745df3d, type: 3}
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84148460c5f94a24282a444e7d59caa0
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,33 +0,0 @@
|
||||
%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: e36b055e81273a54c8e736e2ef74fa50, type: 3}
|
||||
m_Name: WorldAutotileProfile
|
||||
m_EditorClassIdentifier: Assembly-CSharp::InfiniteWorld.WorldAutotileProfile
|
||||
autoUpdatePaletteLayout: 1
|
||||
autoRefreshGeneratedWorld: 1
|
||||
baseGroundTile: {fileID: 11400000, guid: 1b38591c96c9fe1438fea88645b98a41, type: 2}
|
||||
wallTiles:
|
||||
center: {fileID: 11400000, guid: 713ec8ff4a309784eba7ea88b7457669, type: 2}
|
||||
top: {fileID: 11400000, guid: b5cfb771eb6101240b093999b99fc473, type: 2}
|
||||
right: {fileID: 11400000, guid: 29b9363549c8cc4429d9fbb7213b8563, type: 2}
|
||||
bottom: {fileID: 11400000, guid: b9f53c50a59c33f4fa7bab1a3920344b, type: 2}
|
||||
left: {fileID: 11400000, guid: 4863e6e00f95f73488ef648695bd5e75, type: 2}
|
||||
outerTopLeft: {fileID: 11400000, guid: a5a2cf14bb9c7f34caf4da6c64d63518, type: 2}
|
||||
outerTopRight: {fileID: 11400000, guid: beb1a6a9bd16d164687f4385d17bfb40, type: 2}
|
||||
outerBottomRight: {fileID: 11400000, guid: 9439ca77b1904fd4aa4db0998ae75789, type: 2}
|
||||
outerBottomLeft: {fileID: 11400000, guid: e0f8319bee70c66408939faa15001dce, type: 2}
|
||||
innerTopLeft: {fileID: 11400000, guid: 700ff9913ced0d44398098338434403d, type: 2}
|
||||
innerTopRight: {fileID: 11400000, guid: 6012404f47cddfe4b8e59eb8e40cf637, type: 2}
|
||||
innerBottomRight: {fileID: 11400000, guid: 6e660d46a0c887242a9a90495a954311, type: 2}
|
||||
innerBottomLeft: {fileID: 11400000, guid: 96184d199569aea46bdb6e3d5a7fa1f6, type: 2}
|
||||
environmentTiles: []
|
||||
randomPrefabs: []
|
||||
@@ -15,12 +15,12 @@ MonoBehaviour:
|
||||
_prefabs:
|
||||
- {fileID: 4512293259955182956, guid: fe2b65b02f0484b41aa8cfa9fbbb0e1d, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: 35639798ad77fc145871588b25d66259, type: 3}
|
||||
- {fileID: 201277550, guid: 26a567abbe21227428f5c3d309d1d73c, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: 0d6d0f48b03b17f49a6340103cd9b9d0, type: 3}
|
||||
- {fileID: 8475222101369129519, guid: 8cf33e8e99a9b0c4c8f29ff725650de6, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: dafef736ca1ae384e9a19eb672843563, type: 3}
|
||||
- {fileID: 201277550, guid: 5b712878ecece354ba4ffb026c0a221c, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: b8017cef39731ba439c70fecc09488e3, type: 3}
|
||||
- {fileID: 201277550, guid: 26a567abbe21227428f5c3d309d1d73c, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: 44611030e61220d42ab7c37ba3c0ea92, type: 3}
|
||||
- {fileID: 8192566354860284824, guid: 6331b3542e64a564c81bc39cedf70c8d, type: 3}
|
||||
- {fileID: 4512293259955182956, guid: f32d4c19de900e64cb73cedcb8ba6f70, type: 3}
|
||||
|
||||
@@ -322,6 +322,9 @@ MonoBehaviour:
|
||||
highQualityFiltering:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
filter:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
downscale:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6bd4ec969add5234a9d986e113201909
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3285be480b55bcc41af2063e1d870bc1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36891dc9b6bef9042abe878169ca7447
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45690ad9e15981946be65f9548d8dd09
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 603ed2849a33ba0458483c701165b144
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff34b50cc44bc6543b46be01a211d5b7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 361df54f72bfa4c45afb507271efc82c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e71e3609ff417784b81b4f5ae74064bd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 196c5002b4773e943baf0f897f1ca573
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aed2145cbbd99134c9f1556356440612
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56fd714f9ff70974b953ab8b676bd2ad
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36d3f51da8e6a734797f93d32dd6a32a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1fadae35d0dcad7478e9716ea65762b4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
-1967
File diff suppressed because it is too large
Load Diff
-7
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41de4e97ebade7a4a8e018f68bde560e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4716897eb71185742ad590f2a59df8e3
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acfa62607cc78b8499e371559154647f
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da90adbe6fa0acb429453d3550e18961
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5203f967846df5f43baaa0a3ba2e2d5b
|
||||
@@ -1,75 +0,0 @@
|
||||
namespace InfiniteWorld.Editor
|
||||
{
|
||||
internal static class WorldAutotileEditorLabels
|
||||
{
|
||||
public static string GetShapeLabel(AutoTileShape shape)
|
||||
{
|
||||
switch (shape)
|
||||
{
|
||||
case AutoTileShape.Center:
|
||||
return "Center";
|
||||
case AutoTileShape.Top:
|
||||
return "Top";
|
||||
case AutoTileShape.Right:
|
||||
return "Right";
|
||||
case AutoTileShape.Bottom:
|
||||
return "Bottom";
|
||||
case AutoTileShape.Left:
|
||||
return "Left";
|
||||
case AutoTileShape.OuterTopLeft:
|
||||
return "Outer Top Left";
|
||||
case AutoTileShape.OuterTopRight:
|
||||
return "Outer Top Right";
|
||||
case AutoTileShape.OuterBottomRight:
|
||||
return "Outer Bottom Right";
|
||||
case AutoTileShape.OuterBottomLeft:
|
||||
return "Outer Bottom Left";
|
||||
case AutoTileShape.InnerTopLeft:
|
||||
return "Inner Top Left";
|
||||
case AutoTileShape.InnerTopRight:
|
||||
return "Inner Top Right";
|
||||
case AutoTileShape.InnerBottomRight:
|
||||
return "Inner Bottom Right";
|
||||
case AutoTileShape.InnerBottomLeft:
|
||||
return "Inner Bottom Left";
|
||||
default:
|
||||
return shape.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetPropertyName(AutoTileShape shape)
|
||||
{
|
||||
switch (shape)
|
||||
{
|
||||
case AutoTileShape.Center:
|
||||
return "center";
|
||||
case AutoTileShape.Top:
|
||||
return "top";
|
||||
case AutoTileShape.Right:
|
||||
return "right";
|
||||
case AutoTileShape.Bottom:
|
||||
return "bottom";
|
||||
case AutoTileShape.Left:
|
||||
return "left";
|
||||
case AutoTileShape.OuterTopLeft:
|
||||
return "outerTopLeft";
|
||||
case AutoTileShape.OuterTopRight:
|
||||
return "outerTopRight";
|
||||
case AutoTileShape.OuterBottomRight:
|
||||
return "outerBottomRight";
|
||||
case AutoTileShape.OuterBottomLeft:
|
||||
return "outerBottomLeft";
|
||||
case AutoTileShape.InnerTopLeft:
|
||||
return "innerTopLeft";
|
||||
case AutoTileShape.InnerTopRight:
|
||||
return "innerTopRight";
|
||||
case AutoTileShape.InnerBottomRight:
|
||||
return "innerBottomRight";
|
||||
case AutoTileShape.InnerBottomLeft:
|
||||
return "innerBottomLeft";
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f9b9a3347cfc82428971840cb651f99
|
||||
@@ -1,642 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Tilemaps;
|
||||
|
||||
namespace InfiniteWorld.Editor
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public static class WorldAutotileProfilePipeline
|
||||
{
|
||||
private const string AuthoringLayoutFolder = "Assets/Editor/Generated/WorldAutotileAuthoring";
|
||||
|
||||
private static readonly AutoTileShape[] WallShapeOrder =
|
||||
{
|
||||
AutoTileShape.OuterTopLeft,
|
||||
AutoTileShape.Top,
|
||||
AutoTileShape.OuterTopRight,
|
||||
AutoTileShape.Left,
|
||||
AutoTileShape.Center,
|
||||
AutoTileShape.Right,
|
||||
AutoTileShape.OuterBottomLeft,
|
||||
AutoTileShape.Bottom,
|
||||
AutoTileShape.OuterBottomRight,
|
||||
AutoTileShape.InnerTopLeft,
|
||||
AutoTileShape.InnerTopRight,
|
||||
AutoTileShape.InnerBottomLeft,
|
||||
AutoTileShape.InnerBottomRight
|
||||
};
|
||||
|
||||
private static readonly Vector3Int[] WallShapePositions =
|
||||
{
|
||||
new Vector3Int(0, 4, 0),
|
||||
new Vector3Int(1, 4, 0),
|
||||
new Vector3Int(2, 4, 0),
|
||||
new Vector3Int(0, 3, 0),
|
||||
new Vector3Int(1, 3, 0),
|
||||
new Vector3Int(2, 3, 0),
|
||||
new Vector3Int(0, 2, 0),
|
||||
new Vector3Int(1, 2, 0),
|
||||
new Vector3Int(2, 2, 0),
|
||||
new Vector3Int(0, 1, 0),
|
||||
new Vector3Int(2, 1, 0),
|
||||
new Vector3Int(0, 0, 0),
|
||||
new Vector3Int(2, 0, 0)
|
||||
};
|
||||
|
||||
private static readonly HashSet<string> PendingProfilePaths = new HashSet<string>();
|
||||
private static readonly MethodInfo SetIconForObjectMethod = typeof(EditorGUIUtility).GetMethod("SetIconForObject", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);
|
||||
private static bool refreshQueued;
|
||||
|
||||
static WorldAutotileProfilePipeline()
|
||||
{
|
||||
AssemblyReloadEvents.beforeAssemblyReload += ClearQueue;
|
||||
EditorApplication.projectChanged += QueueAllProfilesRefresh;
|
||||
}
|
||||
|
||||
public static void QueueProfileRefresh(WorldAutotileProfile profile)
|
||||
{
|
||||
if (profile == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string path = AssetDatabase.GetAssetPath(profile);
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
PendingProfilePaths.Add(path);
|
||||
if (refreshQueued)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
refreshQueued = true;
|
||||
EditorApplication.delayCall += ProcessPendingProfiles;
|
||||
}
|
||||
|
||||
public static string GetAuthoringLayoutPath(WorldAutotileProfile profile)
|
||||
{
|
||||
return AuthoringLayoutFolder + "/" + profile.name + "_AuthoringLayout.prefab";
|
||||
}
|
||||
|
||||
public static GameObject LoadAuthoringLayoutAsset(WorldAutotileProfile profile)
|
||||
{
|
||||
if (profile == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return AssetDatabase.LoadAssetAtPath<GameObject>(GetAuthoringLayoutPath(profile));
|
||||
}
|
||||
|
||||
public static void GenerateAuthoringLayout(WorldAutotileProfile profile, bool pingAsset = true)
|
||||
{
|
||||
if (profile == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EnsureFolderExists(AuthoringLayoutFolder);
|
||||
string path = GetAuthoringLayoutPath(profile);
|
||||
DeleteExistingAuthoringLayout(path);
|
||||
|
||||
GameObject root = BuildAuthoringLayoutRoot(profile);
|
||||
PrefabUtility.SaveAsPrefabAsset(root, path);
|
||||
Object.DestroyImmediate(root);
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
if (!pingAsset)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject layout = AssetDatabase.LoadAssetAtPath<GameObject>(path);
|
||||
if (layout != null)
|
||||
{
|
||||
EditorGUIUtility.PingObject(layout);
|
||||
Selection.activeObject = layout;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool BuildProfileFromAuthoringLayout(WorldAutotileProfile profile, bool pingProfile = true)
|
||||
{
|
||||
if (profile == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
string path = GetAuthoringLayoutPath(profile);
|
||||
if (!System.IO.File.Exists(path))
|
||||
{
|
||||
Debug.LogWarning($"Authoring layout was not found for profile '{profile.name}' at '{path}'.");
|
||||
return false;
|
||||
}
|
||||
|
||||
GameObject prefabRoot = PrefabUtility.LoadPrefabContents(path);
|
||||
try
|
||||
{
|
||||
Undo.RecordObject(profile, "Build World Autotile Profile From Layout");
|
||||
if (!TryBuildProfileFromLayout(prefabRoot, profile, out string error))
|
||||
{
|
||||
Debug.LogError(error);
|
||||
return false;
|
||||
}
|
||||
|
||||
EditorUtility.SetDirty(profile);
|
||||
AssetDatabase.SaveAssets();
|
||||
|
||||
if (pingProfile)
|
||||
{
|
||||
EditorGUIUtility.PingObject(profile);
|
||||
Selection.activeObject = profile;
|
||||
}
|
||||
|
||||
if (profile.autoRefreshGeneratedWorld && Application.isPlaying)
|
||||
{
|
||||
RefreshActiveGenerators(profile);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
PrefabUtility.UnloadPrefabContents(prefabRoot);
|
||||
}
|
||||
}
|
||||
|
||||
private static void ProcessPendingProfiles()
|
||||
{
|
||||
refreshQueued = false;
|
||||
if (EditorApplication.isCompiling || EditorApplication.isUpdating)
|
||||
{
|
||||
if (PendingProfilePaths.Count > 0)
|
||||
{
|
||||
refreshQueued = true;
|
||||
EditorApplication.delayCall += ProcessPendingProfiles;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
string[] paths = new string[PendingProfilePaths.Count];
|
||||
PendingProfilePaths.CopyTo(paths);
|
||||
PendingProfilePaths.Clear();
|
||||
|
||||
for (int i = 0; i < paths.Length; i++)
|
||||
{
|
||||
WorldAutotileProfile profile = AssetDatabase.LoadAssetAtPath<WorldAutotileProfile>(paths[i]);
|
||||
if (profile == null || !profile.autoUpdatePaletteLayout)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (LoadAuthoringLayoutAsset(profile) == null)
|
||||
{
|
||||
GenerateAuthoringLayout(profile, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static GameObject BuildAuthoringLayoutRoot(WorldAutotileProfile profile)
|
||||
{
|
||||
GameObject root = new GameObject(profile.name + "_AuthoringLayout", typeof(Grid), typeof(WorldAutotileAuthoringRoot));
|
||||
WorldAutotileAuthoringRoot rootMarker = root.GetComponent<WorldAutotileAuthoringRoot>();
|
||||
rootMarker.profile = profile;
|
||||
|
||||
Transform guidesRoot = new GameObject("Guides").transform;
|
||||
guidesRoot.SetParent(root.transform, false);
|
||||
CreateGuideLabel(guidesRoot, "Workflow Label", new Vector3(5f, 6.6f, 0f), "sv_label_0");
|
||||
|
||||
Transform wallSection = CreateSection(root.transform, "WallShapes", WorldAutotileAuthoringSectionType.WallShapes, new Vector3(0f, 0f, 0f), new Vector2Int(3, 5));
|
||||
Tilemap wallBackground = CreateTilemap(wallSection, "Background", 0);
|
||||
Tilemap wallTiles = CreateTilemap(wallSection, "Walls", 1);
|
||||
PopulateWallSection(profile, wallBackground, wallTiles);
|
||||
CreateGuideLabel(guidesRoot, "Wall Shapes Label", wallSection.localPosition + new Vector3(1f, 5.6f, 0f), "sv_label_3");
|
||||
CreateWallShapeLabels(guidesRoot, wallSection.localPosition, "sv_label_6");
|
||||
|
||||
Transform backgroundSection = CreateSection(root.transform, "BackgroundSample", WorldAutotileAuthoringSectionType.BackgroundSample, new Vector3(5f, 0f, 0f), new Vector2Int(5, 3));
|
||||
Tilemap backgroundTilemap = CreateTilemap(backgroundSection, "Background", 0);
|
||||
PopulateBackgroundSection(profile, backgroundTilemap);
|
||||
CreateGuideLabel(guidesRoot, "Background Sample Label", backgroundSection.localPosition + new Vector3(2f, 3.6f, 0f), "sv_label_4");
|
||||
|
||||
int environmentWidth = Mathf.Max(1, CountAssignedEnvironmentTiles(profile));
|
||||
Transform environmentSection = CreateSection(root.transform, "EnvironmentPalette", WorldAutotileAuthoringSectionType.EnvironmentPalette, new Vector3(0f, -3f, 0f), new Vector2Int(environmentWidth, 1));
|
||||
Tilemap environmentBackground = CreateTilemap(environmentSection, "Background", 0);
|
||||
Tilemap environmentTilemap = CreateTilemap(environmentSection, "Environment", 1);
|
||||
PopulateEnvironmentSection(profile, environmentBackground, environmentTilemap);
|
||||
float environmentCenterX = Mathf.Max(0f, (environmentWidth - 1) * 0.5f);
|
||||
CreateGuideLabel(guidesRoot, "Environment Palette Label", environmentSection.localPosition + new Vector3(environmentCenterX, 1.6f, 0f), "sv_label_2");
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private static Transform CreateSection(Transform parent, string name, WorldAutotileAuthoringSectionType sectionType, Vector3 localPosition, Vector2Int size)
|
||||
{
|
||||
GameObject section = new GameObject(name, typeof(WorldAutotileAuthoringSection));
|
||||
section.transform.SetParent(parent, false);
|
||||
section.transform.localPosition = localPosition;
|
||||
|
||||
WorldAutotileAuthoringSection marker = section.GetComponent<WorldAutotileAuthoringSection>();
|
||||
marker.sectionType = sectionType;
|
||||
marker.size = size;
|
||||
return section.transform;
|
||||
}
|
||||
|
||||
private static void CreateGuideLabel(Transform parent, string labelName, Vector3 position, string iconName)
|
||||
{
|
||||
GameObject label = new GameObject(labelName);
|
||||
label.transform.SetParent(parent, false);
|
||||
label.transform.localPosition = position;
|
||||
SetIconForObject(label, iconName);
|
||||
}
|
||||
|
||||
private static void CreateWallShapeLabels(Transform parent, Vector3 sectionPosition, string iconName)
|
||||
{
|
||||
for (int i = 0; i < WallShapeOrder.Length; i++)
|
||||
{
|
||||
Vector3Int cell = WallShapePositions[i];
|
||||
string label = WorldAutotileEditorLabels.GetShapeLabel(WallShapeOrder[i]) + " Label";
|
||||
Vector3 position = sectionPosition + new Vector3(cell.x + 0.5f, cell.y + 0.5f, 0f);
|
||||
CreateGuideLabel(parent, label, position, iconName);
|
||||
}
|
||||
}
|
||||
|
||||
private static void PopulateWallSection(WorldAutotileProfile profile, Tilemap backgroundTilemap, Tilemap wallsTilemap)
|
||||
{
|
||||
TileBase background = profile.baseGroundTile;
|
||||
for (int i = 0; i < WallShapeOrder.Length; i++)
|
||||
{
|
||||
Vector3Int position = WallShapePositions[i];
|
||||
if (background != null)
|
||||
{
|
||||
backgroundTilemap.SetTile(position, background);
|
||||
}
|
||||
|
||||
TileBase wallTile = profile.wallTiles != null ? profile.wallTiles.GetAssignedTile(WallShapeOrder[i]) : null;
|
||||
if (wallTile != null)
|
||||
{
|
||||
wallsTilemap.SetTile(position, wallTile);
|
||||
}
|
||||
}
|
||||
|
||||
if (background != null)
|
||||
{
|
||||
backgroundTilemap.SetTile(new Vector3Int(1, 1, 0), background);
|
||||
backgroundTilemap.SetTile(new Vector3Int(1, 0, 0), background);
|
||||
}
|
||||
}
|
||||
|
||||
private static void PopulateBackgroundSection(WorldAutotileProfile profile, Tilemap backgroundTilemap)
|
||||
{
|
||||
if (profile.baseGroundTile == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int x = 0; x < 5; x++)
|
||||
{
|
||||
for (int y = 0; y < 3; y++)
|
||||
{
|
||||
backgroundTilemap.SetTile(new Vector3Int(x, y, 0), profile.baseGroundTile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void PopulateEnvironmentSection(WorldAutotileProfile profile, Tilemap backgroundTilemap, Tilemap environmentTilemap)
|
||||
{
|
||||
if (profile.environmentTiles == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int x = 0;
|
||||
for (int i = 0; i < profile.environmentTiles.Count; i++)
|
||||
{
|
||||
EnvironmentTileEntry entry = profile.environmentTiles[i];
|
||||
if (entry == null || entry.tile == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Vector3Int position = new Vector3Int(x, 0, 0);
|
||||
if (profile.baseGroundTile != null)
|
||||
{
|
||||
backgroundTilemap.SetTile(position, profile.baseGroundTile);
|
||||
}
|
||||
|
||||
environmentTilemap.SetTile(position, entry.tile);
|
||||
x++;
|
||||
}
|
||||
}
|
||||
|
||||
private static Tilemap CreateTilemap(Transform parent, string name, int sortingOrder)
|
||||
{
|
||||
GameObject child = new GameObject(name, typeof(Tilemap), typeof(TilemapRenderer));
|
||||
child.transform.SetParent(parent, false);
|
||||
TilemapRenderer renderer = child.GetComponent<TilemapRenderer>();
|
||||
renderer.sortingOrder = sortingOrder;
|
||||
return child.GetComponent<Tilemap>();
|
||||
}
|
||||
|
||||
private static bool TryBuildProfileFromLayout(GameObject prefabRoot, WorldAutotileProfile profile, out string error)
|
||||
{
|
||||
error = null;
|
||||
|
||||
if (prefabRoot == null)
|
||||
{
|
||||
error = "Could not load authoring layout prefab contents.";
|
||||
return false;
|
||||
}
|
||||
|
||||
WorldAutotileAuthoringRoot rootMarker = prefabRoot.GetComponent<WorldAutotileAuthoringRoot>();
|
||||
if (rootMarker == null)
|
||||
{
|
||||
error = $"Authoring layout '{prefabRoot.name}' is missing {nameof(WorldAutotileAuthoringRoot)}.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rootMarker.profile != null && rootMarker.profile != profile)
|
||||
{
|
||||
error = $"Authoring layout '{prefabRoot.name}' is linked to profile '{rootMarker.profile.name}', not '{profile.name}'.";
|
||||
return false;
|
||||
}
|
||||
|
||||
WorldAutotileAuthoringSection wallSection = FindSection(prefabRoot, WorldAutotileAuthoringSectionType.WallShapes);
|
||||
WorldAutotileAuthoringSection backgroundSection = FindSection(prefabRoot, WorldAutotileAuthoringSectionType.BackgroundSample);
|
||||
WorldAutotileAuthoringSection environmentSection = FindSection(prefabRoot, WorldAutotileAuthoringSectionType.EnvironmentPalette);
|
||||
|
||||
if (wallSection == null || backgroundSection == null || environmentSection == null)
|
||||
{
|
||||
error = $"Authoring layout '{prefabRoot.name}' is missing one or more required section markers.";
|
||||
return false;
|
||||
}
|
||||
|
||||
Tilemap wallTilemap = FindTilemap(wallSection.transform, "Walls");
|
||||
Tilemap backgroundTilemap = FindTilemap(backgroundSection.transform, "Background");
|
||||
Tilemap environmentTilemap = FindTilemap(environmentSection.transform, "Environment");
|
||||
|
||||
if (wallTilemap == null || backgroundTilemap == null || environmentTilemap == null)
|
||||
{
|
||||
error = $"Authoring layout '{prefabRoot.name}' is missing one or more required tilemaps.";
|
||||
return false;
|
||||
}
|
||||
|
||||
profile.baseGroundTile = FindFirstTile(backgroundTilemap, backgroundSection.size);
|
||||
profile.wallTiles = ExtractWallTiles(wallTilemap);
|
||||
profile.environmentTiles = ExtractEnvironmentTiles(environmentTilemap, environmentSection.size, profile.environmentTiles);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static WorldAutotileAuthoringSection FindSection(GameObject root, WorldAutotileAuthoringSectionType sectionType)
|
||||
{
|
||||
WorldAutotileAuthoringSection[] sections = root.GetComponentsInChildren<WorldAutotileAuthoringSection>(true);
|
||||
for (int i = 0; i < sections.Length; i++)
|
||||
{
|
||||
if (sections[i].sectionType == sectionType)
|
||||
{
|
||||
return sections[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Tilemap FindTilemap(Transform root, string name)
|
||||
{
|
||||
Transform child = root.Find(name);
|
||||
return child != null ? child.GetComponent<Tilemap>() : null;
|
||||
}
|
||||
|
||||
private static TileBase FindFirstTile(Tilemap tilemap, Vector2Int size)
|
||||
{
|
||||
for (int y = 0; y < Mathf.Max(1, size.y); y++)
|
||||
{
|
||||
for (int x = 0; x < Mathf.Max(1, size.x); x++)
|
||||
{
|
||||
TileBase tile = tilemap.GetTile(new Vector3Int(x, y, 0));
|
||||
if (tile != null)
|
||||
{
|
||||
return tile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static AutoTileDefinition ExtractWallTiles(Tilemap wallTilemap)
|
||||
{
|
||||
AutoTileDefinition definition = new AutoTileDefinition();
|
||||
for (int i = 0; i < WallShapeOrder.Length; i++)
|
||||
{
|
||||
AssignWallTile(definition, WallShapeOrder[i], wallTilemap.GetTile(WallShapePositions[i]));
|
||||
}
|
||||
|
||||
return definition;
|
||||
}
|
||||
|
||||
private static void AssignWallTile(AutoTileDefinition definition, AutoTileShape shape, TileBase tile)
|
||||
{
|
||||
switch (shape)
|
||||
{
|
||||
case AutoTileShape.Center:
|
||||
definition.center = tile;
|
||||
break;
|
||||
case AutoTileShape.Top:
|
||||
definition.top = tile;
|
||||
break;
|
||||
case AutoTileShape.Right:
|
||||
definition.right = tile;
|
||||
break;
|
||||
case AutoTileShape.Bottom:
|
||||
definition.bottom = tile;
|
||||
break;
|
||||
case AutoTileShape.Left:
|
||||
definition.left = tile;
|
||||
break;
|
||||
case AutoTileShape.OuterTopLeft:
|
||||
definition.outerTopLeft = tile;
|
||||
break;
|
||||
case AutoTileShape.OuterTopRight:
|
||||
definition.outerTopRight = tile;
|
||||
break;
|
||||
case AutoTileShape.OuterBottomRight:
|
||||
definition.outerBottomRight = tile;
|
||||
break;
|
||||
case AutoTileShape.OuterBottomLeft:
|
||||
definition.outerBottomLeft = tile;
|
||||
break;
|
||||
case AutoTileShape.InnerTopLeft:
|
||||
definition.innerTopLeft = tile;
|
||||
break;
|
||||
case AutoTileShape.InnerTopRight:
|
||||
definition.innerTopRight = tile;
|
||||
break;
|
||||
case AutoTileShape.InnerBottomRight:
|
||||
definition.innerBottomRight = tile;
|
||||
break;
|
||||
case AutoTileShape.InnerBottomLeft:
|
||||
definition.innerBottomLeft = tile;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static List<EnvironmentTileEntry> ExtractEnvironmentTiles(Tilemap tilemap, Vector2Int size, List<EnvironmentTileEntry> previousEntries)
|
||||
{
|
||||
List<EnvironmentTileEntry> entries = new List<EnvironmentTileEntry>();
|
||||
for (int y = 0; y < Mathf.Max(1, size.y); y++)
|
||||
{
|
||||
for (int x = 0; x < Mathf.Max(1, size.x); x++)
|
||||
{
|
||||
TileBase tile = tilemap.GetTile(new Vector3Int(x, y, 0));
|
||||
if (tile == null || ContainsEnvironmentTile(entries, tile))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
EnvironmentTileEntry existing = FindEnvironmentEntry(previousEntries, tile);
|
||||
entries.Add(new EnvironmentTileEntry
|
||||
{
|
||||
id = existing != null && !string.IsNullOrWhiteSpace(existing.id) ? existing.id : tile.name,
|
||||
tile = tile,
|
||||
weight = existing != null ? existing.weight : 1f
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return entries;
|
||||
}
|
||||
|
||||
private static bool ContainsEnvironmentTile(List<EnvironmentTileEntry> entries, TileBase tile)
|
||||
{
|
||||
for (int i = 0; i < entries.Count; i++)
|
||||
{
|
||||
if (entries[i] != null && entries[i].tile == tile)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static EnvironmentTileEntry FindEnvironmentEntry(List<EnvironmentTileEntry> entries, TileBase tile)
|
||||
{
|
||||
if (entries == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < entries.Count; i++)
|
||||
{
|
||||
if (entries[i] != null && entries[i].tile == tile)
|
||||
{
|
||||
return entries[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static int CountAssignedEnvironmentTiles(WorldAutotileProfile profile)
|
||||
{
|
||||
if (profile.environmentTiles == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < profile.environmentTiles.Count; i++)
|
||||
{
|
||||
if (profile.environmentTiles[i] != null && profile.environmentTiles[i].tile != null)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
private static void DeleteExistingAuthoringLayout(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AssetDatabase.DeleteAsset(path);
|
||||
}
|
||||
|
||||
private static void SetIconForObject(GameObject gameObject, string iconName)
|
||||
{
|
||||
if (gameObject == null || SetIconForObjectMethod == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Texture2D icon = EditorGUIUtility.IconContent(iconName).image as Texture2D;
|
||||
if (icon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetIconForObjectMethod.Invoke(null, new object[] { gameObject, icon });
|
||||
}
|
||||
|
||||
private static void RefreshActiveGenerators(WorldAutotileProfile profile)
|
||||
{
|
||||
InfiniteWorldGenerator[] generators = Object.FindObjectsByType<InfiniteWorldGenerator>(FindObjectsSortMode.None);
|
||||
for (int i = 0; i < generators.Length; i++)
|
||||
{
|
||||
InfiniteWorldGenerator generator = generators[i];
|
||||
if (generator != null && generator.UsesProfile(profile))
|
||||
{
|
||||
generator.EditorRefreshFromProfile();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnsureFolderExists(string assetFolder)
|
||||
{
|
||||
string[] parts = assetFolder.Split('/');
|
||||
string current = parts[0];
|
||||
for (int i = 1; i < parts.Length; i++)
|
||||
{
|
||||
string next = current + "/" + parts[i];
|
||||
if (!AssetDatabase.IsValidFolder(next))
|
||||
{
|
||||
AssetDatabase.CreateFolder(current, parts[i]);
|
||||
}
|
||||
|
||||
current = next;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ClearQueue()
|
||||
{
|
||||
PendingProfilePaths.Clear();
|
||||
refreshQueued = false;
|
||||
}
|
||||
|
||||
private static void QueueAllProfilesRefresh()
|
||||
{
|
||||
string[] guids = AssetDatabase.FindAssets("t:WorldAutotileProfile");
|
||||
for (int i = 0; i < guids.Length; i++)
|
||||
{
|
||||
string path = AssetDatabase.GUIDToAssetPath(guids[i]);
|
||||
WorldAutotileProfile profile = AssetDatabase.LoadAssetAtPath<WorldAutotileProfile>(path);
|
||||
if (profile != null)
|
||||
{
|
||||
QueueProfileRefresh(profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24d3fe24380362140ab8b0a89ecb61e4
|
||||
@@ -1,281 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace InfiniteWorld.Editor
|
||||
{
|
||||
public class WorldGeneratorEditorWindow : EditorWindow
|
||||
{
|
||||
private static readonly AutoTileShape[] WallShapeOrder =
|
||||
{
|
||||
AutoTileShape.OuterTopLeft,
|
||||
AutoTileShape.Top,
|
||||
AutoTileShape.OuterTopRight,
|
||||
AutoTileShape.Left,
|
||||
AutoTileShape.Center,
|
||||
AutoTileShape.Right,
|
||||
AutoTileShape.OuterBottomLeft,
|
||||
AutoTileShape.Bottom,
|
||||
AutoTileShape.OuterBottomRight,
|
||||
AutoTileShape.InnerTopLeft,
|
||||
AutoTileShape.InnerTopRight,
|
||||
AutoTileShape.InnerBottomLeft,
|
||||
AutoTileShape.InnerBottomRight
|
||||
};
|
||||
|
||||
private WorldAutotileProfile profile;
|
||||
private SerializedObject serializedProfile;
|
||||
private Vector2 scroll;
|
||||
|
||||
[MenuItem("Tools/Infinite World/World Builder")]
|
||||
public static void Open()
|
||||
{
|
||||
GetWindow<WorldGeneratorEditorWindow>("World Builder");
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
DrawToolbar();
|
||||
EditorGUILayout.Space(6f);
|
||||
|
||||
if (profile == null)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Assign or create a WorldAutotileProfile. The workflow is: create the authoring layout prefab, edit tiles inside that grid, then build the final profile back from the layout.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
if (serializedProfile == null || serializedProfile.targetObject != profile)
|
||||
{
|
||||
serializedProfile = new SerializedObject(profile);
|
||||
}
|
||||
|
||||
serializedProfile.Update();
|
||||
scroll = EditorGUILayout.BeginScrollView(scroll);
|
||||
|
||||
DrawPaletteTools();
|
||||
EditorGUILayout.Space(8f);
|
||||
DrawValidation();
|
||||
EditorGUILayout.Space(8f);
|
||||
DrawProfileFields();
|
||||
|
||||
EditorGUILayout.EndScrollView();
|
||||
serializedProfile.ApplyModifiedProperties();
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
EditorUtility.SetDirty(profile);
|
||||
WorldAutotileProfilePipeline.QueueProfileRefresh(profile);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawToolbar()
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
|
||||
profile = (WorldAutotileProfile)EditorGUILayout.ObjectField(profile, typeof(WorldAutotileProfile), false, GUILayout.Width(position.width * 0.55f));
|
||||
|
||||
if (GUILayout.Button("New Profile", EditorStyles.toolbarButton, GUILayout.Width(90f)))
|
||||
{
|
||||
CreateProfileAsset();
|
||||
}
|
||||
|
||||
using (new EditorGUI.DisabledScope(profile == null))
|
||||
{
|
||||
if (GUILayout.Button("Create Authoring Layout", EditorStyles.toolbarButton, GUILayout.Width(155f)))
|
||||
{
|
||||
WorldAutotileProfilePipeline.GenerateAuthoringLayout(profile);
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void DrawPaletteTools()
|
||||
{
|
||||
EditorGUILayout.LabelField("Palette Tools", EditorStyles.boldLabel);
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
EditorGUILayout.HelpBox("Create Authoring Layout builds a temporary editor-only prefab with marked grid sections. Edit tiles there, then use Build Profile From Layout to write the final WorldAutotileProfile.", MessageType.None);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedProfile.FindProperty("autoUpdatePaletteLayout"), new GUIContent("Auto Update Authoring Layout"));
|
||||
EditorGUILayout.PropertyField(serializedProfile.FindProperty("autoRefreshGeneratedWorld"), new GUIContent("Auto Refresh Generated World"));
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("Create / Update Layout"))
|
||||
{
|
||||
WorldAutotileProfilePipeline.GenerateAuthoringLayout(profile);
|
||||
}
|
||||
|
||||
using (new EditorGUI.DisabledScope(WorldAutotileProfilePipeline.LoadAuthoringLayoutAsset(profile) == null))
|
||||
{
|
||||
if (GUILayout.Button("Build Profile From Layout"))
|
||||
{
|
||||
WorldAutotileProfilePipeline.BuildProfileFromAuthoringLayout(profile);
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Open Layout Prefab"))
|
||||
{
|
||||
GameObject layout = WorldAutotileProfilePipeline.LoadAuthoringLayoutAsset(profile);
|
||||
if (layout != null)
|
||||
{
|
||||
AssetDatabase.OpenAsset(layout);
|
||||
}
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
using (new EditorGUI.DisabledScope(WorldAutotileProfilePipeline.LoadAuthoringLayoutAsset(profile) == null))
|
||||
{
|
||||
if (GUILayout.Button("Ping Layout Prefab"))
|
||||
{
|
||||
GameObject layout = WorldAutotileProfilePipeline.LoadAuthoringLayoutAsset(profile);
|
||||
if (layout != null)
|
||||
{
|
||||
EditorGUIUtility.PingObject(layout);
|
||||
Selection.activeObject = layout;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.LabelField("Layout Path", WorldAutotileProfilePipeline.GetAuthoringLayoutPath(profile));
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
private void DrawValidation()
|
||||
{
|
||||
EditorGUILayout.LabelField("Profile Check", EditorStyles.boldLabel);
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
List<string> missingShapes = GetMissingWallShapes();
|
||||
if (missingShapes.Count == 0)
|
||||
{
|
||||
EditorGUILayout.HelpBox("All wall variants are assigned. The generated palette layout will include every corner, side, and center tile.", MessageType.Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox("Missing wall variants: " + string.Join(", ", missingShapes), MessageType.Warning);
|
||||
}
|
||||
|
||||
int environmentCount = CountAssignedEnvironmentTiles();
|
||||
int prefabCount = CountAssignedRandomPrefabs();
|
||||
EditorGUILayout.LabelField("Background", profile.baseGroundTile != null ? profile.baseGroundTile.name : "Not assigned");
|
||||
EditorGUILayout.LabelField("Environment Tiles", environmentCount.ToString());
|
||||
EditorGUILayout.LabelField("Random Prefabs", prefabCount.ToString());
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
private void DrawProfileFields()
|
||||
{
|
||||
EditorGUILayout.LabelField("Profile Assets", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(serializedProfile.FindProperty("baseGroundTile"), new GUIContent("Background Tile"));
|
||||
|
||||
EditorGUILayout.Space(6f);
|
||||
EditorGUILayout.LabelField("Wall Variants", EditorStyles.miniBoldLabel);
|
||||
SerializedProperty walls = serializedProfile.FindProperty("wallTiles");
|
||||
DrawWallGrid(walls);
|
||||
|
||||
EditorGUILayout.Space(6f);
|
||||
EditorGUILayout.PropertyField(serializedProfile.FindProperty("environmentTiles"), true);
|
||||
|
||||
EditorGUILayout.Space(6f);
|
||||
EditorGUILayout.PropertyField(serializedProfile.FindProperty("randomPrefabs"), true);
|
||||
}
|
||||
|
||||
private void DrawWallGrid(SerializedProperty walls)
|
||||
{
|
||||
DrawLabeledRow(walls, AutoTileShape.OuterTopLeft, AutoTileShape.Top, AutoTileShape.OuterTopRight);
|
||||
DrawLabeledRow(walls, AutoTileShape.Left, AutoTileShape.Center, AutoTileShape.Right);
|
||||
DrawLabeledRow(walls, AutoTileShape.OuterBottomLeft, AutoTileShape.Bottom, AutoTileShape.OuterBottomRight);
|
||||
DrawLabeledRow(walls, AutoTileShape.InnerTopLeft, AutoTileShape.InnerTopRight);
|
||||
DrawLabeledRow(walls, AutoTileShape.InnerBottomLeft, AutoTileShape.InnerBottomRight);
|
||||
}
|
||||
|
||||
private static void DrawLabeledRow(SerializedProperty root, params AutoTileShape[] shapes)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
for (int i = 0; i < shapes.Length; i++)
|
||||
{
|
||||
DrawLabeledCell(root, shapes[i]);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private static void DrawLabeledCell(SerializedProperty root, AutoTileShape shape)
|
||||
{
|
||||
SerializedProperty property = root.FindPropertyRelative(WorldAutotileEditorLabels.GetPropertyName(shape));
|
||||
EditorGUILayout.BeginVertical(GUILayout.MaxWidth(150f));
|
||||
EditorGUILayout.LabelField(WorldAutotileEditorLabels.GetShapeLabel(shape), EditorStyles.miniLabel);
|
||||
EditorGUILayout.PropertyField(property, GUIContent.none);
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
private List<string> GetMissingWallShapes()
|
||||
{
|
||||
List<string> missing = new List<string>();
|
||||
for (int i = 0; i < WallShapeOrder.Length; i++)
|
||||
{
|
||||
AutoTileShape shape = WallShapeOrder[i];
|
||||
if (profile.wallTiles == null || profile.wallTiles.GetAssignedTile(shape) == null)
|
||||
{
|
||||
missing.Add(shape.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
return missing;
|
||||
}
|
||||
|
||||
private int CountAssignedEnvironmentTiles()
|
||||
{
|
||||
if (profile.environmentTiles == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < profile.environmentTiles.Count; i++)
|
||||
{
|
||||
if (profile.environmentTiles[i] != null && profile.environmentTiles[i].tile != null)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
private int CountAssignedRandomPrefabs()
|
||||
{
|
||||
if (profile.randomPrefabs == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < profile.randomPrefabs.Count; i++)
|
||||
{
|
||||
if (profile.randomPrefabs[i] != null && profile.randomPrefabs[i].prefab != null)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
private void CreateProfileAsset()
|
||||
{
|
||||
string path = EditorUtility.SaveFilePanelInProject("Create World Profile", "WorldAutotileProfile", "asset", "Choose where to save the tile profile.");
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
WorldAutotileProfile asset = CreateInstance<WorldAutotileProfile>();
|
||||
AssetDatabase.CreateAsset(asset, path);
|
||||
AssetDatabase.SaveAssets();
|
||||
profile = asset;
|
||||
serializedProfile = new SerializedObject(profile);
|
||||
Selection.activeObject = asset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff365d4e73b85cc4987c7984d5f8c7cb
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4716897eb71185742ad590f2a59df8e3
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acfa62607cc78b8499e371559154647f
|
||||
+1
-1
@@ -118,7 +118,7 @@ namespace Project.Tasks.Editor
|
||||
data.ProjectRoot = GetProjectRoot();
|
||||
data.TasksDirectory = NormalizePath(Path.Combine(data.ProjectRoot, "docs", "tasks"));
|
||||
data.IndexPath = NormalizePath(Path.Combine(data.TasksDirectory, "Index.md"));
|
||||
data.OwnersConfigPath = "Assets/Editor/Tasks/TaskBoardOwners.asset";
|
||||
data.OwnersConfigPath = "Assets/Features/Tasks/Editor/TaskBoardOwners.asset";
|
||||
LoadOwnerPresets(data);
|
||||
|
||||
if (!Directory.Exists(data.TasksDirectory))
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da90adbe6fa0acb429453d3550e18961
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5203f967846df5f43baaa0a3ba2e2d5b
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 981858f28439459429fa291e1f6cb935
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0cac3da4969c2f94985de9f5fb30a682
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9da608950686fb345b172db0a56bced5
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 811ff92b4e36193499cad8631c9443a7
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56e0b6ddd79410b40bdda73c4e20515d
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62cd563780165844caddc098f92ff23f
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Extension/FieldDefinitionExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Extension/FieldReferenceExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Extension/ILProcessorExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -111,18 +111,9 @@ namespace FishNet.CodeGenerating.Extension
|
||||
|
||||
foreach (ParameterDefinition pd in otherMd.Parameters)
|
||||
{
|
||||
session.ImportReference(pd.ParameterType.CachedResolve(session));
|
||||
int currentCount = thisMd.Parameters.Count;
|
||||
string name = pd.Name + currentCount;
|
||||
ParameterDefinition parameterDef = new(name, pd.Attributes, pd.ParameterType);
|
||||
// Set any default values.
|
||||
parameterDef.Constant = pd.Constant;
|
||||
parameterDef.IsReturnValue = pd.IsReturnValue;
|
||||
parameterDef.IsOut = pd.IsOut;
|
||||
foreach (CustomAttribute item in pd.CustomAttributes)
|
||||
parameterDef.CustomAttributes.Add(item);
|
||||
parameterDef.HasConstant = pd.HasConstant;
|
||||
parameterDef.HasDefault = pd.HasDefault;
|
||||
ParameterDefinition parameterDef = pd.CloneImported(session, thisMd, name);
|
||||
|
||||
if (parameterDef == null || thisMd.Parameters == null)
|
||||
{
|
||||
@@ -156,17 +147,14 @@ namespace FishNet.CodeGenerating.Extension
|
||||
DeclaringType = git,
|
||||
CallingConvention = md.CallingConvention
|
||||
};
|
||||
|
||||
foreach (ParameterDefinition pd in md.Parameters)
|
||||
{
|
||||
session.ImportReference(pd.ParameterType);
|
||||
result.Parameters.Add(pd);
|
||||
}
|
||||
result.Parameters.Add(pd.CloneImported(session, result));
|
||||
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return methodRef;
|
||||
}
|
||||
|
||||
return methodRef;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -206,13 +194,13 @@ namespace FishNet.CodeGenerating.Extension
|
||||
|
||||
public static MethodDefinition CreateCopy(this MethodDefinition copiedMd, CodegenSession session, string nameOverride = null, MethodAttributes? attributesOverride = null)
|
||||
{
|
||||
session.ImportReference(copiedMd.ReturnType);
|
||||
TypeReference returnType = session.ImportReference(copiedMd.ReturnType);
|
||||
|
||||
MethodAttributes attr = attributesOverride.HasValue ? attributesOverride.Value : copiedMd.Attributes;
|
||||
string name = nameOverride == null ? copiedMd.Name : nameOverride;
|
||||
MethodDefinition result = new(name, attr, copiedMd.ReturnType);
|
||||
MethodDefinition result = new(name, attr, returnType);
|
||||
foreach (GenericParameter item in copiedMd.GenericParameters)
|
||||
result.GenericParameters.Add(item);
|
||||
result.GenericParameters.Add(new(item.Name, result) { Attributes = item.Attributes });
|
||||
|
||||
result.CreateParameters(session, copiedMd);
|
||||
return result;
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Extension/MethodDefinitionExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -51,10 +51,7 @@ namespace FishNet.CodeGenerating.Extension
|
||||
ExplicitThis = baseMd.ExplicitThis
|
||||
};
|
||||
foreach (ParameterDefinition pd in baseMd.Parameters)
|
||||
{
|
||||
session.ImportReference(pd.ParameterType);
|
||||
baseMr.Parameters.Add(pd);
|
||||
}
|
||||
baseMr.Parameters.Add(pd.CloneImported(session, baseMr));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -154,19 +151,15 @@ namespace FishNet.CodeGenerating.Extension
|
||||
};
|
||||
md.Body.InitLocals = methodTemplate.Body.InitLocals;
|
||||
|
||||
foreach (GenericParameter item in methodTemplate.GenericParameters)
|
||||
{
|
||||
md.GenericParameters.Add(new(item.Name, md) { Attributes = item.Attributes });
|
||||
}
|
||||
|
||||
if (copyParameters)
|
||||
{
|
||||
foreach (ParameterDefinition pd in methodTemplate.Parameters)
|
||||
{
|
||||
session.ImportReference(pd.ParameterType.CachedResolve(session));
|
||||
md.Parameters.Add(pd);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (GenericParameter item in methodTemplate.GenericParameters)
|
||||
{
|
||||
session.ImportReference(item);
|
||||
md.GenericParameters.Add(item);
|
||||
md.Parameters.Add(pd.CloneImported(session, md));
|
||||
}
|
||||
|
||||
td.Methods.Add(md);
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Extension/TypeDefinitionExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Extension/TypeReferenceExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -9,6 +9,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/FN_README.txt
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/AttributeHelper.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/CodegenSession.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/CreatedSyncVarGenerator.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -3,8 +3,67 @@ using System.Linq;
|
||||
|
||||
namespace FishNet.CodeGenerating.Helping.Extension
|
||||
{
|
||||
internal static class CustomAttributeExtensions
|
||||
internal static class CustomAttributeExtensions
|
||||
{
|
||||
private static IGenericParameterProvider GetSafeContext(CodegenSession session, IGenericParameterProvider context)
|
||||
{
|
||||
return (context != null && context.Module == session.Module) ? context : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clones an attribute into the current session module.
|
||||
/// </summary>
|
||||
internal static CustomAttribute CloneImported(this CustomAttribute customAttr, CodegenSession session, IGenericParameterProvider context = null)
|
||||
{
|
||||
IGenericParameterProvider safeContext = GetSafeContext(session, context);
|
||||
MethodReference ctor = (safeContext == null) ? session.ImportReference(customAttr.Constructor) : session.ImportReference(customAttr.Constructor, safeContext);
|
||||
CustomAttribute result = new(ctor);
|
||||
|
||||
foreach (CustomAttributeArgument item in customAttr.ConstructorArguments)
|
||||
result.ConstructorArguments.Add(item.CloneImported(session, safeContext));
|
||||
|
||||
foreach (CustomAttributeNamedArgument item in customAttr.Fields)
|
||||
result.Fields.Add(item.CloneImported(session, safeContext));
|
||||
|
||||
foreach (CustomAttributeNamedArgument item in customAttr.Properties)
|
||||
result.Properties.Add(item.CloneImported(session, safeContext));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clones an attribute argument into the current session module.
|
||||
/// </summary>
|
||||
internal static CustomAttributeArgument CloneImported(this CustomAttributeArgument customAttrArg, CodegenSession session, IGenericParameterProvider context = null)
|
||||
{
|
||||
IGenericParameterProvider safeContext = GetSafeContext(session, context);
|
||||
TypeReference typeRef = safeContext == null ? session.ImportReference(customAttrArg.Type) : session.ImportReference(customAttrArg.Type, safeContext);
|
||||
object value = customAttrArg.Value;
|
||||
|
||||
if (value is TypeReference tr)
|
||||
{
|
||||
value = (safeContext == null) ? session.ImportReference(tr) : session.ImportReference(tr, safeContext);
|
||||
}
|
||||
else if (value is CustomAttributeArgument[] arguments)
|
||||
{
|
||||
CustomAttributeArgument[] clonedArguments = new CustomAttributeArgument[arguments.Length];
|
||||
for (int i = 0; i < arguments.Length; i++)
|
||||
clonedArguments[i] = arguments[i].CloneImported(session, safeContext);
|
||||
|
||||
value = clonedArguments;
|
||||
}
|
||||
|
||||
return new(typeRef, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clones a named attribute argument into the current session module.
|
||||
/// </summary>
|
||||
internal static CustomAttributeNamedArgument CloneImported(this CustomAttributeNamedArgument customAttrNamedArg, CodegenSession session, IGenericParameterProvider context = null)
|
||||
{
|
||||
return new(customAttrNamedArg.Name, customAttrNamedArg.Argument.CloneImported(session, context));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds a field within an attribute.
|
||||
/// </summary>
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/CustomAttributeExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/Diagnostics.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/GetConstructor.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/ILProcessorExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/InstructionExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/MethodReferenceExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/ModuleDefinitionExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -5,6 +5,11 @@ namespace FishNet.CodeGenerating.Helping.Extension
|
||||
{
|
||||
internal static class ParameterDefinitionExtensions
|
||||
{
|
||||
private static IGenericParameterProvider GetSafeContext(CodegenSession session, IGenericParameterProvider context)
|
||||
{
|
||||
return context != null && context.Module == session.Module ? context : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns if parameterDef is Type.
|
||||
/// </summary>
|
||||
@@ -15,5 +20,34 @@ namespace FishNet.CodeGenerating.Helping.Extension
|
||||
{
|
||||
return parameterDef.ParameterType.FullName == type.FullName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clones a parameter into the current session module.
|
||||
/// </summary>
|
||||
public static ParameterDefinition CloneImported(this ParameterDefinition parameterDef, CodegenSession session, IGenericParameterProvider context = null, string nameOverride = null)
|
||||
{
|
||||
IGenericParameterProvider safeContext = GetSafeContext(session, context);
|
||||
TypeReference parameterTypeRef = safeContext == null ? session.ImportReference(parameterDef.ParameterType) : session.ImportReference(parameterDef.ParameterType, safeContext);
|
||||
ParameterDefinition result = new(nameOverride ?? parameterDef.Name, parameterDef.Attributes, parameterTypeRef)
|
||||
{
|
||||
Constant = parameterDef.Constant,
|
||||
IsReturnValue = parameterDef.IsReturnValue,
|
||||
IsOut = parameterDef.IsOut,
|
||||
IsIn = parameterDef.IsIn,
|
||||
IsLcid = parameterDef.IsLcid,
|
||||
IsOptional = parameterDef.IsOptional,
|
||||
HasConstant = parameterDef.HasConstant,
|
||||
HasDefault = parameterDef.HasDefault,
|
||||
HasFieldMarshal = parameterDef.HasFieldMarshal
|
||||
};
|
||||
|
||||
if (parameterDef.HasMarshalInfo)
|
||||
result.MarshalInfo = parameterDef.MarshalInfo;
|
||||
|
||||
foreach (CustomAttribute item in parameterDef.CustomAttributes)
|
||||
result.CustomAttributes.Add(item.CloneImported(session, safeContext));
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/ParameterDefinitionExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/TypeDefinitionExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
@@ -13,6 +13,6 @@ AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 207815
|
||||
packageName: 'FishNet: Networking Evolved'
|
||||
packageVersion: 4.6.22R
|
||||
packageVersion: 4.7.1R
|
||||
assetPath: Assets/FishNet/CodeGenerating/Helpers/Extension/TypeReferenceExtensions.cs
|
||||
uploadId: 866910
|
||||
uploadId: 892096
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user