Move Files, remove 2D world gen
This commit is contained in:
1 parent
55cea836ed
commit
9675b7b31d
121 files changed
+77
-6922
No files matched your search
@@ -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: []
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f4446a72229fc343a954821a70fefac
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
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
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4716897eb71185742ad590f2a59df8e3
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5203f967846df5f43baaa0a3ba2e2d5b
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 981858f28439459429fa291e1f6cb935
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0cac3da4969c2f94985de9f5fb30a682
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9da608950686fb345b172db0a56bced5
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 811ff92b4e36193499cad8631c9443a7
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56e0b6ddd79410b40bdda73c4e20515d
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62cd563780165844caddc098f92ff23f
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,218 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 10
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 3
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 13
|
||||
m_BakeOnSceneLoad: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 0
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 2
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 1
|
||||
m_PVRFilteringGaussRadiusAO: 1
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 3
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &344668594
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 344668597}
|
||||
- component: {fileID: 344668596}
|
||||
- component: {fileID: 344668595}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &344668595
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 344668594}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &344668596
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 344668594}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_Iso: 200
|
||||
m_ShutterSpeed: 0.005
|
||||
m_Aperture: 16
|
||||
m_FocusDistance: 10
|
||||
m_FocalLength: 50
|
||||
m_BladeCount: 5
|
||||
m_Curvature: {x: 2, y: 11}
|
||||
m_BarrelClipping: 0.25
|
||||
m_Anamorphism: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &344668597
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 344668594}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 344668597}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59087e33113ec8341b84efbb7d9d7f55
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,603 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 10
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 3
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 13
|
||||
m_BakeOnSceneLoad: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 0
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 3
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &519420028
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 519420032}
|
||||
- component: {fileID: 519420031}
|
||||
- component: {fileID: 519420029}
|
||||
- component: {fileID: 519420030}
|
||||
- component: {fileID: 519420033}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &519420029
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
--- !u!114 &519420030
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_RenderShadows: 1
|
||||
m_RequiresDepthTextureOption: 2
|
||||
m_RequiresOpaqueTextureOption: 2
|
||||
m_CameraType: 0
|
||||
m_Cameras: []
|
||||
m_RendererIndex: -1
|
||||
m_VolumeLayerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1
|
||||
m_VolumeTrigger: {fileID: 0}
|
||||
m_VolumeFrameworkUpdateModeOption: 2
|
||||
m_RenderPostProcessing: 0
|
||||
m_Antialiasing: 0
|
||||
m_AntialiasingQuality: 2
|
||||
m_StopNaN: 0
|
||||
m_Dithering: 0
|
||||
m_ClearDepth: 1
|
||||
m_AllowXRRendering: 1
|
||||
m_AllowHDROutput: 1
|
||||
m_UseScreenCoordOverride: 0
|
||||
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_RequiresDepthTexture: 0
|
||||
m_RequiresColorTexture: 0
|
||||
m_TaaSettings:
|
||||
m_Quality: 3
|
||||
m_FrameInfluence: 0.1
|
||||
m_JitterScale: 1
|
||||
m_MipBias: 0
|
||||
m_VarianceClampScale: 0.9
|
||||
m_ContrastAdaptiveSharpening: 0
|
||||
m_Version: 2
|
||||
--- !u!20 &519420031
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_Iso: 200
|
||||
m_ShutterSpeed: 0.005
|
||||
m_Aperture: 16
|
||||
m_FocusDistance: 10
|
||||
m_FocalLength: 50
|
||||
m_BladeCount: 5
|
||||
m_Curvature: {x: 2, y: 11}
|
||||
m_BarrelClipping: 0.25
|
||||
m_Anamorphism: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 34
|
||||
orthographic: 1
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 0
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 0
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &519420032
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &519420033
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 98ee4fb5b3ebf80478e6e25afa8fd337, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::InfiniteWorld.CameraFollow2D
|
||||
target: {fileID: 0}
|
||||
smoothTime: 0.18
|
||||
offset: {x: 0, y: 0, z: -10}
|
||||
--- !u!1 &619394800
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 619394802}
|
||||
- component: {fileID: 619394801}
|
||||
m_Layer: 0
|
||||
m_Name: Global Light 2D
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &619394801
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 619394800}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_ComponentVersion: 2
|
||||
m_LightType: 4
|
||||
m_BlendStyleIndex: 0
|
||||
m_FalloffIntensity: 0.5
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Intensity: 1
|
||||
m_LightVolumeIntensity: 1
|
||||
m_LightVolumeEnabled: 0
|
||||
m_ApplyToSortingLayers: 00000000
|
||||
m_LightCookieSprite: {fileID: 0}
|
||||
m_DeprecatedPointLightCookieSprite: {fileID: 0}
|
||||
m_LightOrder: 0
|
||||
m_AlphaBlendOnOverlap: 0
|
||||
m_OverlapOperation: 0
|
||||
m_NormalMapDistance: 3
|
||||
m_NormalMapQuality: 2
|
||||
m_UseNormalMap: 0
|
||||
m_ShadowsEnabled: 0
|
||||
m_ShadowIntensity: 0.75
|
||||
m_ShadowSoftness: 0
|
||||
m_ShadowSoftnessFalloffIntensity: 0.5
|
||||
m_ShadowVolumeIntensityEnabled: 0
|
||||
m_ShadowVolumeIntensity: 0.75
|
||||
m_LocalBounds:
|
||||
m_Center: {x: 0, y: -0.00000011920929, z: 0}
|
||||
m_Extent: {x: 0.9985302, y: 0.99853027, z: 0}
|
||||
m_PointLightInnerAngle: 360
|
||||
m_PointLightOuterAngle: 360
|
||||
m_PointLightInnerRadius: 0
|
||||
m_PointLightOuterRadius: 1
|
||||
m_ShapeLightParametricSides: 5
|
||||
m_ShapeLightParametricAngleOffset: 0
|
||||
m_ShapeLightParametricRadius: 1
|
||||
m_ShapeLightFalloffSize: 0.5
|
||||
m_ShapeLightFalloffOffset: {x: 0, y: 0}
|
||||
m_ShapePath:
|
||||
- {x: -0.5, y: -0.5, z: 0}
|
||||
- {x: 0.5, y: -0.5, z: 0}
|
||||
- {x: 0.5, y: 0.5, z: 0}
|
||||
- {x: -0.5, y: 0.5, z: 0}
|
||||
--- !u!4 &619394802
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 619394800}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &669282973
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 669282975}
|
||||
- component: {fileID: 669282974}
|
||||
- component: {fileID: 669282978}
|
||||
- component: {fileID: 669282977}
|
||||
- component: {fileID: 669282976}
|
||||
m_Layer: 0
|
||||
m_Name: Player
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &669282974
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 669282973}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c9187e81c6ec8da4599e04a1694ec18b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::InfiniteWorld.SimplePlayerInputMover
|
||||
moveSpeed: 5
|
||||
--- !u!4 &669282975
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 669282973}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!70 &669282976
|
||||
CapsuleCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 669282973}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Size: {x: 0.5, y: 1}
|
||||
m_Direction: 0
|
||||
--- !u!212 &669282977
|
||||
SpriteRenderer:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 669282973}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_MaskInteraction: 0
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!50 &669282978
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 669282973}
|
||||
m_BodyType: 0
|
||||
m_Simulated: 1
|
||||
m_UseFullKinematicContacts: 0
|
||||
m_UseAutoMass: 0
|
||||
m_Mass: 1
|
||||
m_LinearDamping: 0
|
||||
m_AngularDamping: 0.05
|
||||
m_GravityScale: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_Interpolate: 0
|
||||
m_SleepingMode: 1
|
||||
m_CollisionDetection: 0
|
||||
m_Constraints: 0
|
||||
--- !u!1 &947604398
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 947604400}
|
||||
- component: {fileID: 947604399}
|
||||
m_Layer: 0
|
||||
m_Name: World
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &947604399
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 947604398}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6bacd3a0ac13e6f4a94548426dd89ebb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::InfiniteWorld.InfiniteWorldGenerator
|
||||
player: {fileID: 0}
|
||||
profile: {fileID: 11400000, guid: 0f4446a72229fc343a954821a70fefac, type: 2}
|
||||
chunkSize: 16
|
||||
generationRadius: 2
|
||||
seed: 12345
|
||||
macroNoiseScale: 0.05
|
||||
detailNoiseScale: 0.12
|
||||
ridgeNoiseScale: 0.18
|
||||
wallThreshold: 0.6
|
||||
rockBias: 0.04
|
||||
smoothingPasses: 2
|
||||
passNoiseScale: 0.018
|
||||
passDetailScale: 0.041
|
||||
passThreshold: 0.22
|
||||
passFeather: 0.12
|
||||
environmentNoiseScale: 0.19
|
||||
environmentThreshold: 0.7
|
||||
randomPrefabChance: 0.06
|
||||
randomPrefabZOffset: -0.1
|
||||
maxAsyncChunkJobs: 2
|
||||
maxChunkRendersPerFrame: 1
|
||||
blockingGenerationRadius: 0
|
||||
--- !u!4 &947604400
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 947604398}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 519420032}
|
||||
- {fileID: 619394802}
|
||||
- {fileID: 947604400}
|
||||
- {fileID: 669282975}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c9cfa26abfee488c85f1582747f6a02
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff30f393052d2674e94fd1d887712090
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,31 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace InfiniteWorld
|
||||
{
|
||||
public class CameraFollow2D : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Transform target;
|
||||
[SerializeField] private float smoothTime = 0.18f;
|
||||
[SerializeField] private Vector3 offset = new Vector3(0f, 0f, -10f);
|
||||
|
||||
private Vector3 velocity;
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (target == null)
|
||||
{
|
||||
SimplePlayerInputMover player = FindFirstObjectByType<SimplePlayerInputMover>();
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
target = player.transform;
|
||||
}
|
||||
|
||||
Vector3 desiredPosition = target.position + offset;
|
||||
desiredPosition.z = offset.z;
|
||||
transform.position = Vector3.SmoothDamp(transform.position, desiredPosition, ref velocity, smoothTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98ee4fb5b3ebf80478e6e25afa8fd337
|
||||
@@ -1,109 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace InfiniteWorld
|
||||
{
|
||||
public class SimplePlayerInputMover : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private float moveSpeed = 5f;
|
||||
|
||||
private InputAction moveAction;
|
||||
private Rigidbody2D rb;
|
||||
private Vector2 moveInput;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
rb = GetComponent<Rigidbody2D>();
|
||||
if (rb == null)
|
||||
{
|
||||
rb = gameObject.AddComponent<Rigidbody2D>();
|
||||
}
|
||||
|
||||
ConfigurePhysics();
|
||||
EnsureVisual();
|
||||
|
||||
moveAction = new InputAction("Move", InputActionType.Value);
|
||||
moveAction.AddCompositeBinding("2DVector")
|
||||
.With("Up", "<Keyboard>/w")
|
||||
.With("Down", "<Keyboard>/s")
|
||||
.With("Left", "<Keyboard>/a")
|
||||
.With("Right", "<Keyboard>/d");
|
||||
moveAction.AddCompositeBinding("2DVector")
|
||||
.With("Up", "<Keyboard>/upArrow")
|
||||
.With("Down", "<Keyboard>/downArrow")
|
||||
.With("Left", "<Keyboard>/leftArrow")
|
||||
.With("Right", "<Keyboard>/rightArrow");
|
||||
moveAction.AddBinding("<Gamepad>/leftStick");
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
moveAction?.Enable();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
moveAction?.Disable();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
moveAction?.Dispose();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (moveAction == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
moveInput = moveAction.ReadValue<Vector2>().normalized;
|
||||
if (moveInput.x != 0f)
|
||||
{
|
||||
Vector3 scale = transform.localScale;
|
||||
scale.x = Mathf.Abs(scale.x) * Mathf.Sign(moveInput.x);
|
||||
transform.localScale = scale;
|
||||
}
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (rb == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Vector2 target = rb.position + moveInput * (moveSpeed * Time.fixedDeltaTime);
|
||||
rb.MovePosition(target);
|
||||
}
|
||||
|
||||
private void ConfigurePhysics()
|
||||
{
|
||||
rb.gravityScale = 0f;
|
||||
rb.freezeRotation = true;
|
||||
rb.interpolation = RigidbodyInterpolation2D.Interpolate;
|
||||
rb.collisionDetectionMode = CollisionDetectionMode2D.Continuous;
|
||||
|
||||
CapsuleCollider2D collider = GetComponent<CapsuleCollider2D>();
|
||||
if (collider == null)
|
||||
{
|
||||
collider = gameObject.AddComponent<CapsuleCollider2D>();
|
||||
}
|
||||
collider.direction = CapsuleDirection2D.Vertical;
|
||||
collider.size = new Vector2(0.55f, 0.8f);
|
||||
collider.offset = new Vector2(0f, -0.05f);
|
||||
}
|
||||
|
||||
private void EnsureVisual()
|
||||
{
|
||||
SpriteRenderer renderer = GetComponent<SpriteRenderer>();
|
||||
if (renderer == null)
|
||||
{
|
||||
renderer = gameObject.AddComponent<SpriteRenderer>();
|
||||
}
|
||||
renderer.sprite = ProceduralWorldArt.CreatePlayerSprite();
|
||||
renderer.sortingOrder = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9187e81c6ec8da4599e04a1694ec18b
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 981858f28439459429fa291e1f6cb935
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0cac3da4969c2f94985de9f5fb30a682
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9da608950686fb345b172db0a56bced5
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 811ff92b4e36193499cad8631c9443a7
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56e0b6ddd79410b40bdda73c4e20515d
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62cd563780165844caddc098f92ff23f
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96adefd3df6641c40b9624eb12185ea4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,232 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace InfiniteWorld
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Infinite World/Chunk Template", fileName = "ChunkTemplate")]
|
||||
public class ChunkTemplate : ScriptableObject
|
||||
{
|
||||
[Min(4)] public int width = 16;
|
||||
[Min(4)] public int height = 16;
|
||||
|
||||
[Header("Exits")]
|
||||
public bool exitTop = true;
|
||||
public bool exitRight = true;
|
||||
public bool exitBottom = true;
|
||||
public bool exitLeft = true;
|
||||
|
||||
[SerializeField] private List<ChunkCellData> cells = new List<ChunkCellData>();
|
||||
|
||||
public int CellCount => width * height;
|
||||
|
||||
public void EnsureCellData()
|
||||
{
|
||||
int target = Mathf.Max(1, width * height);
|
||||
while (cells.Count < target)
|
||||
{
|
||||
cells.Add(new ChunkCellData());
|
||||
}
|
||||
|
||||
while (cells.Count > target)
|
||||
{
|
||||
cells.RemoveAt(cells.Count - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void Resize(int newWidth, int newHeight)
|
||||
{
|
||||
newWidth = Mathf.Max(4, newWidth);
|
||||
newHeight = Mathf.Max(4, newHeight);
|
||||
|
||||
List<ChunkCellData> oldCells = new List<ChunkCellData>(cells);
|
||||
int oldWidth = width;
|
||||
int oldHeight = height;
|
||||
|
||||
width = newWidth;
|
||||
height = newHeight;
|
||||
cells = new List<ChunkCellData>(newWidth * newHeight);
|
||||
|
||||
for (int i = 0; i < newWidth * newHeight; i++)
|
||||
{
|
||||
cells.Add(new ChunkCellData());
|
||||
}
|
||||
|
||||
for (int y = 0; y < Mathf.Min(oldHeight, newHeight); y++)
|
||||
{
|
||||
for (int x = 0; x < Mathf.Min(oldWidth, newWidth); x++)
|
||||
{
|
||||
int oldIndex = y * oldWidth + x;
|
||||
if (oldIndex < oldCells.Count)
|
||||
{
|
||||
cells[Index(x, y)] = oldCells[oldIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
EnsureCellData();
|
||||
for (int i = 0; i < cells.Count; i++)
|
||||
{
|
||||
cells[i] = new ChunkCellData();
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetWall(int x, int y)
|
||||
{
|
||||
return IsInBounds(x, y) && cells[Index(x, y)].wall;
|
||||
}
|
||||
|
||||
public bool GetEnvironment(int x, int y)
|
||||
{
|
||||
return IsInBounds(x, y) && cells[Index(x, y)].environment;
|
||||
}
|
||||
|
||||
public void SetWall(int x, int y, bool value)
|
||||
{
|
||||
if (!IsInBounds(x, y))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EnsureCellData();
|
||||
ChunkCellData data = cells[Index(x, y)];
|
||||
data.wall = value;
|
||||
if (value)
|
||||
{
|
||||
data.environment = false;
|
||||
}
|
||||
cells[Index(x, y)] = data;
|
||||
}
|
||||
|
||||
public void SetEnvironment(int x, int y, bool value)
|
||||
{
|
||||
if (!IsInBounds(x, y))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EnsureCellData();
|
||||
ChunkCellData data = cells[Index(x, y)];
|
||||
data.environment = value;
|
||||
if (value)
|
||||
{
|
||||
data.wall = false;
|
||||
}
|
||||
cells[Index(x, y)] = data;
|
||||
}
|
||||
|
||||
public bool GetExit(ChunkExit exit)
|
||||
{
|
||||
return exit switch
|
||||
{
|
||||
ChunkExit.Top => exitTop,
|
||||
ChunkExit.Right => exitRight,
|
||||
ChunkExit.Bottom => exitBottom,
|
||||
ChunkExit.Left => exitLeft,
|
||||
_ => false
|
||||
};
|
||||
}
|
||||
|
||||
public int ExitCount()
|
||||
{
|
||||
int count = 0;
|
||||
count += exitTop ? 1 : 0;
|
||||
count += exitRight ? 1 : 0;
|
||||
count += exitBottom ? 1 : 0;
|
||||
count += exitLeft ? 1 : 0;
|
||||
return count;
|
||||
}
|
||||
|
||||
public void ApplyBorderWallsFromExits(int openingWidth = 3)
|
||||
{
|
||||
EnsureCellData();
|
||||
Clear();
|
||||
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
SetWall(x, 0, true);
|
||||
SetWall(x, height - 1, true);
|
||||
}
|
||||
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
SetWall(0, y, true);
|
||||
SetWall(width - 1, y, true);
|
||||
}
|
||||
|
||||
CarveExit(ChunkExit.Top, openingWidth);
|
||||
CarveExit(ChunkExit.Right, openingWidth);
|
||||
CarveExit(ChunkExit.Bottom, openingWidth);
|
||||
CarveExit(ChunkExit.Left, openingWidth);
|
||||
}
|
||||
|
||||
public void CarveExit(ChunkExit exit, int openingWidth = 3)
|
||||
{
|
||||
if (!GetExit(exit))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int half = Mathf.Max(1, openingWidth) / 2;
|
||||
switch (exit)
|
||||
{
|
||||
case ChunkExit.Top:
|
||||
for (int x = width / 2 - half; x <= width / 2 + half; x++)
|
||||
{
|
||||
SetWall(x, height - 1, false);
|
||||
SetWall(x, height - 2, false);
|
||||
}
|
||||
break;
|
||||
case ChunkExit.Right:
|
||||
for (int y = height / 2 - half; y <= height / 2 + half; y++)
|
||||
{
|
||||
SetWall(width - 1, y, false);
|
||||
SetWall(width - 2, y, false);
|
||||
}
|
||||
break;
|
||||
case ChunkExit.Bottom:
|
||||
for (int x = width / 2 - half; x <= width / 2 + half; x++)
|
||||
{
|
||||
SetWall(x, 0, false);
|
||||
SetWall(x, 1, false);
|
||||
}
|
||||
break;
|
||||
case ChunkExit.Left:
|
||||
for (int y = height / 2 - half; y <= height / 2 + half; y++)
|
||||
{
|
||||
SetWall(0, y, false);
|
||||
SetWall(1, y, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private int Index(int x, int y)
|
||||
{
|
||||
return y * width + x;
|
||||
}
|
||||
|
||||
private bool IsInBounds(int x, int y)
|
||||
{
|
||||
return x >= 0 && y >= 0 && x < width && y < height;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ChunkExit
|
||||
{
|
||||
Top,
|
||||
Right,
|
||||
Bottom,
|
||||
Left
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct ChunkCellData
|
||||
{
|
||||
public bool wall;
|
||||
public bool environment;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bae8eeae2da7d3f4396883671b297a47
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6bacd3a0ac13e6f4a94548426dd89ebb
|
||||
@@ -1,350 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Tilemaps;
|
||||
|
||||
namespace InfiniteWorld
|
||||
{
|
||||
public static class ProceduralWorldArt
|
||||
{
|
||||
private const int TextureSize = 32;
|
||||
private static readonly Dictionary<string, Sprite> SpriteCache = new Dictionary<string, Sprite>();
|
||||
private static readonly Dictionary<string, Tile> TileCache = new Dictionary<string, Tile>();
|
||||
|
||||
public static Sprite CreatePlayerSprite()
|
||||
{
|
||||
const string key = "player_sprite";
|
||||
if (SpriteCache.TryGetValue(key, out Sprite cached))
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
Color transparent = new Color(0f, 0f, 0f, 0f);
|
||||
Texture2D texture = CreateTexture(key, transparent);
|
||||
Color cloak = new Color(0.13f, 0.33f, 0.79f, 1f);
|
||||
Color trim = new Color(0.85f, 0.92f, 1f, 1f);
|
||||
Color face = new Color(0.99f, 0.89f, 0.72f, 1f);
|
||||
|
||||
FillRect(texture, 10, 4, 12, 16, cloak);
|
||||
FillRect(texture, 9, 18, 14, 7, cloak);
|
||||
FillRect(texture, 12, 24, 8, 5, face);
|
||||
FillRect(texture, 11, 23, 10, 1, trim);
|
||||
FillRect(texture, 8, 12, 3, 10, trim);
|
||||
FillRect(texture, 21, 12, 3, 10, trim);
|
||||
FillRect(texture, 12, 0, 3, 4, cloak);
|
||||
FillRect(texture, 17, 0, 3, 4, cloak);
|
||||
texture.Apply();
|
||||
|
||||
Sprite sprite = CreateSprite(texture);
|
||||
SpriteCache[key] = sprite;
|
||||
return sprite;
|
||||
}
|
||||
|
||||
public static TileBase CreateSolidTile(string key, Color color, float noiseStrength = 0.04f)
|
||||
{
|
||||
if (TileCache.TryGetValue(key, out Tile cached))
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
Texture2D texture = CreateTexture(key, color);
|
||||
ApplyNoise(texture, noiseStrength, 31);
|
||||
texture.Apply();
|
||||
Tile tile = CreateTile(texture, key);
|
||||
TileCache[key] = tile;
|
||||
return tile;
|
||||
}
|
||||
|
||||
public static TileBase CreateFeatureTile(string key, Color fill, Color border, bool top, bool right, bool bottom, bool left, InnerCornerMask innerCornerMask = InnerCornerMask.None, bool solidCollider = false)
|
||||
{
|
||||
if (TileCache.TryGetValue(key, out Tile cached))
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
Texture2D texture = CreateTexture(key, fill);
|
||||
ApplyNoise(texture, 0.05f, 71);
|
||||
DrawBorder(texture, top, right, bottom, left, border, 4);
|
||||
CarveInnerCorner(texture, innerCornerMask);
|
||||
texture.Apply();
|
||||
|
||||
Tile tile = CreateTile(texture, key);
|
||||
if (solidCollider)
|
||||
{
|
||||
tile.colliderType = Tile.ColliderType.Grid;
|
||||
}
|
||||
TileCache[key] = tile;
|
||||
return tile;
|
||||
}
|
||||
|
||||
public static TileBase CreateDecorationTile(string key, Color baseColor, Color accentColor, DecorationPattern pattern)
|
||||
{
|
||||
if (TileCache.TryGetValue(key, out Tile cached))
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
Color transparent = new Color(0f, 0f, 0f, 0f);
|
||||
Texture2D texture = CreateTexture(key, transparent);
|
||||
|
||||
switch (pattern)
|
||||
{
|
||||
case DecorationPattern.Bush:
|
||||
DrawDisc(texture, 16, 15, 8, baseColor);
|
||||
DrawDisc(texture, 10, 13, 6, baseColor);
|
||||
DrawDisc(texture, 22, 13, 6, baseColor);
|
||||
DrawDisc(texture, 14, 17, 3, accentColor);
|
||||
DrawDisc(texture, 21, 17, 3, accentColor);
|
||||
break;
|
||||
case DecorationPattern.Flower:
|
||||
DrawDisc(texture, 16, 12, 2, baseColor);
|
||||
DrawDisc(texture, 12, 16, 2, baseColor);
|
||||
DrawDisc(texture, 20, 16, 2, baseColor);
|
||||
DrawDisc(texture, 16, 20, 2, baseColor);
|
||||
DrawDisc(texture, 16, 16, 2, accentColor);
|
||||
DrawLine(texture, 16, 0, 16, 12, new Color(0.2f, 0.5f, 0.2f, 1f));
|
||||
break;
|
||||
default:
|
||||
DrawDisc(texture, 12, 12, 4, baseColor);
|
||||
DrawDisc(texture, 20, 18, 3, accentColor);
|
||||
DrawDisc(texture, 9, 20, 2, accentColor);
|
||||
break;
|
||||
}
|
||||
|
||||
texture.Apply();
|
||||
Tile tile = CreateTile(texture, key);
|
||||
TileCache[key] = tile;
|
||||
return tile;
|
||||
}
|
||||
|
||||
private static Texture2D CreateTexture(string key, Color fillColor)
|
||||
{
|
||||
Texture2D texture = new Texture2D(TextureSize, TextureSize, TextureFormat.RGBA32, false)
|
||||
{
|
||||
filterMode = FilterMode.Point,
|
||||
wrapMode = TextureWrapMode.Clamp,
|
||||
name = key
|
||||
};
|
||||
|
||||
Color[] pixels = new Color[TextureSize * TextureSize];
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
{
|
||||
pixels[i] = fillColor;
|
||||
}
|
||||
|
||||
texture.SetPixels(pixels);
|
||||
return texture;
|
||||
}
|
||||
|
||||
private static Tile CreateTile(Texture2D texture, string key)
|
||||
{
|
||||
Sprite sprite = CreateSprite(texture);
|
||||
Tile tile = ScriptableObject.CreateInstance<Tile>();
|
||||
tile.sprite = sprite;
|
||||
tile.name = key;
|
||||
tile.hideFlags = HideFlags.HideAndDontSave;
|
||||
return tile;
|
||||
}
|
||||
|
||||
private static Sprite CreateSprite(Texture2D texture)
|
||||
{
|
||||
Sprite sprite = Sprite.Create(texture, new Rect(0f, 0f, texture.width, texture.height), new Vector2(0.5f, 0.5f), TextureSize);
|
||||
sprite.name = texture.name;
|
||||
return sprite;
|
||||
}
|
||||
|
||||
private static void ApplyNoise(Texture2D texture, float strength, int offset)
|
||||
{
|
||||
if (strength <= 0f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int y = 0; y < texture.height; y++)
|
||||
{
|
||||
for (int x = 0; x < texture.width; x++)
|
||||
{
|
||||
Color pixel = texture.GetPixel(x, y);
|
||||
if (pixel.a <= 0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float noise = Mathf.PerlinNoise((x + offset) * 0.21f, (y + offset) * 0.21f) - 0.5f;
|
||||
texture.SetPixel(x, y, pixel * (1f + noise * strength * 2f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawBorder(Texture2D texture, bool top, bool right, bool bottom, bool left, Color color, int thickness)
|
||||
{
|
||||
if (top)
|
||||
{
|
||||
FillRect(texture, 0, TextureSize - thickness, TextureSize, thickness, color);
|
||||
}
|
||||
|
||||
if (bottom)
|
||||
{
|
||||
FillRect(texture, 0, 0, TextureSize, thickness, color);
|
||||
}
|
||||
|
||||
if (left)
|
||||
{
|
||||
FillRect(texture, 0, 0, thickness, TextureSize, color);
|
||||
}
|
||||
|
||||
if (right)
|
||||
{
|
||||
FillRect(texture, TextureSize - thickness, 0, thickness, TextureSize, color);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CarveInnerCorner(Texture2D texture, InnerCornerMask innerCornerMask)
|
||||
{
|
||||
if (innerCornerMask == InnerCornerMask.None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Color transparent = new Color(0f, 0f, 0f, 0f);
|
||||
const int radius = 8;
|
||||
|
||||
if ((innerCornerMask & InnerCornerMask.TopLeft) != 0)
|
||||
{
|
||||
CutCorner(texture, 0, TextureSize - 1, radius, transparent, 1, -1);
|
||||
}
|
||||
|
||||
if ((innerCornerMask & InnerCornerMask.TopRight) != 0)
|
||||
{
|
||||
CutCorner(texture, TextureSize - 1, TextureSize - 1, radius, transparent, -1, -1);
|
||||
}
|
||||
|
||||
if ((innerCornerMask & InnerCornerMask.BottomRight) != 0)
|
||||
{
|
||||
CutCorner(texture, TextureSize - 1, 0, radius, transparent, -1, 1);
|
||||
}
|
||||
|
||||
if ((innerCornerMask & InnerCornerMask.BottomLeft) != 0)
|
||||
{
|
||||
CutCorner(texture, 0, 0, radius, transparent, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CutCorner(Texture2D texture, int originX, int originY, int radius, Color transparent, int dirX, int dirY)
|
||||
{
|
||||
for (int x = 0; x < radius; x++)
|
||||
{
|
||||
for (int y = 0; y < radius; y++)
|
||||
{
|
||||
float dx = x / (float)radius;
|
||||
float dy = y / (float)radius;
|
||||
if (dx * dx + dy * dy > 1f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int px = originX + x * dirX;
|
||||
int py = originY + y * dirY;
|
||||
if (px >= 0 && px < TextureSize && py >= 0 && py < TextureSize)
|
||||
{
|
||||
texture.SetPixel(px, py, transparent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawDisc(Texture2D texture, int centerX, int centerY, int radius, Color color)
|
||||
{
|
||||
int sqrRadius = radius * radius;
|
||||
for (int y = -radius; y <= radius; y++)
|
||||
{
|
||||
for (int x = -radius; x <= radius; x++)
|
||||
{
|
||||
if (x * x + y * y > sqrRadius)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int px = centerX + x;
|
||||
int py = centerY + y;
|
||||
if (px >= 0 && px < TextureSize && py >= 0 && py < TextureSize)
|
||||
{
|
||||
texture.SetPixel(px, py, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawLine(Texture2D texture, int x0, int y0, int x1, int y1, Color color)
|
||||
{
|
||||
int dx = Mathf.Abs(x1 - x0);
|
||||
int sx = x0 < x1 ? 1 : -1;
|
||||
int dy = -Mathf.Abs(y1 - y0);
|
||||
int sy = y0 < y1 ? 1 : -1;
|
||||
int error = dx + dy;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (x0 >= 0 && x0 < TextureSize && y0 >= 0 && y0 < TextureSize)
|
||||
{
|
||||
texture.SetPixel(x0, y0, color);
|
||||
}
|
||||
|
||||
if (x0 == x1 && y0 == y1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
int twiceError = 2 * error;
|
||||
if (twiceError >= dy)
|
||||
{
|
||||
error += dy;
|
||||
x0 += sx;
|
||||
}
|
||||
|
||||
if (twiceError <= dx)
|
||||
{
|
||||
error += dx;
|
||||
y0 += sy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void FillRect(Texture2D texture, int x, int y, int width, int height, Color color)
|
||||
{
|
||||
for (int py = y; py < y + height; py++)
|
||||
{
|
||||
if (py < 0 || py >= TextureSize)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int px = x; px < x + width; px++)
|
||||
{
|
||||
if (px < 0 || px >= TextureSize)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
texture.SetPixel(px, py, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum DecorationPattern
|
||||
{
|
||||
Bush,
|
||||
Flower,
|
||||
Rocks
|
||||
}
|
||||
|
||||
[System.Flags]
|
||||
public enum InnerCornerMask
|
||||
{
|
||||
None = 0,
|
||||
TopLeft = 1,
|
||||
TopRight = 2,
|
||||
BottomRight = 4,
|
||||
BottomLeft = 8
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc8c4a69ee2e7a046adf658709613591
|
||||
@@ -1,237 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace InfiniteWorld
|
||||
{
|
||||
public static class RuntimeWorldProfileFactory
|
||||
{
|
||||
public static WorldAutotileProfile CreateFallbackProfile()
|
||||
{
|
||||
WorldAutotileProfile profile = ScriptableObject.CreateInstance<WorldAutotileProfile>();
|
||||
profile.name = "RuntimeFallbackWorldProfile";
|
||||
|
||||
Color grass = new Color(0.35f, 0.62f, 0.26f, 1f);
|
||||
Color wallFill = new Color(0.48f, 0.37f, 0.22f, 1f);
|
||||
Color wallBorder = new Color(0.29f, 0.21f, 0.12f, 1f);
|
||||
|
||||
profile.baseGroundTile = ProceduralWorldArt.CreateSolidTile("base_grass", grass, 0.06f);
|
||||
profile.wallTiles.center = ProceduralWorldArt.CreateFeatureTile("wall_center", wallFill, wallBorder, false, false, false, false, InnerCornerMask.None, true);
|
||||
profile.wallTiles.top = ProceduralWorldArt.CreateFeatureTile("wall_top", wallFill, wallBorder, true, false, false, false, InnerCornerMask.None, true);
|
||||
profile.wallTiles.right = ProceduralWorldArt.CreateFeatureTile("wall_right", wallFill, wallBorder, false, true, false, false, InnerCornerMask.None, true);
|
||||
profile.wallTiles.bottom = ProceduralWorldArt.CreateFeatureTile("wall_bottom", wallFill, wallBorder, false, false, true, false, InnerCornerMask.None, true);
|
||||
profile.wallTiles.left = ProceduralWorldArt.CreateFeatureTile("wall_left", wallFill, wallBorder, false, false, false, true, InnerCornerMask.None, true);
|
||||
profile.wallTiles.outerTopLeft = ProceduralWorldArt.CreateFeatureTile("wall_outer_tl", wallFill, wallBorder, true, false, false, true, InnerCornerMask.None, true);
|
||||
profile.wallTiles.outerTopRight = ProceduralWorldArt.CreateFeatureTile("wall_outer_tr", wallFill, wallBorder, true, true, false, false, InnerCornerMask.None, true);
|
||||
profile.wallTiles.outerBottomRight = ProceduralWorldArt.CreateFeatureTile("wall_outer_br", wallFill, wallBorder, false, true, true, false, InnerCornerMask.None, true);
|
||||
profile.wallTiles.outerBottomLeft = ProceduralWorldArt.CreateFeatureTile("wall_outer_bl", wallFill, wallBorder, false, false, true, true, InnerCornerMask.None, true);
|
||||
profile.wallTiles.innerTopLeft = ProceduralWorldArt.CreateFeatureTile("wall_inner_tl", wallFill, wallBorder, false, false, false, false, InnerCornerMask.TopLeft, true);
|
||||
profile.wallTiles.innerTopRight = ProceduralWorldArt.CreateFeatureTile("wall_inner_tr", wallFill, wallBorder, false, false, false, false, InnerCornerMask.TopRight, true);
|
||||
profile.wallTiles.innerBottomRight = ProceduralWorldArt.CreateFeatureTile("wall_inner_br", wallFill, wallBorder, false, false, false, false, InnerCornerMask.BottomRight, true);
|
||||
profile.wallTiles.innerBottomLeft = ProceduralWorldArt.CreateFeatureTile("wall_inner_bl", wallFill, wallBorder, false, false, false, false, InnerCornerMask.BottomLeft, true);
|
||||
|
||||
profile.environmentTiles.Add(new EnvironmentTileEntry
|
||||
{
|
||||
id = "Bush",
|
||||
tile = ProceduralWorldArt.CreateDecorationTile("env_bush", new Color(0.15f, 0.45f, 0.18f, 1f), new Color(0.23f, 0.58f, 0.25f, 1f), DecorationPattern.Bush),
|
||||
weight = 1.4f
|
||||
});
|
||||
profile.environmentTiles.Add(new EnvironmentTileEntry
|
||||
{
|
||||
id = "FlowerBlue",
|
||||
tile = ProceduralWorldArt.CreateDecorationTile("env_flower_blue", new Color(0.44f, 0.62f, 0.96f, 1f), new Color(0.98f, 0.91f, 0.52f, 1f), DecorationPattern.Flower),
|
||||
weight = 0.75f
|
||||
});
|
||||
profile.environmentTiles.Add(new EnvironmentTileEntry
|
||||
{
|
||||
id = "Rock",
|
||||
tile = ProceduralWorldArt.CreateDecorationTile("env_rock", new Color(0.48f, 0.48f, 0.52f, 1f), new Color(0.69f, 0.69f, 0.74f, 1f), DecorationPattern.Rocks),
|
||||
weight = 0.9f
|
||||
});
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
public static List<ChunkTemplate> CreateFallbackTemplates(int size)
|
||||
{
|
||||
List<ChunkTemplate> templates = new List<ChunkTemplate>
|
||||
{
|
||||
CreateCross(size),
|
||||
CreateStraightHorizontal(size),
|
||||
CreateStraightVertical(size),
|
||||
CreateCorner(size, true, true, false, false),
|
||||
CreateCorner(size, false, true, true, false),
|
||||
CreateCorner(size, false, false, true, true),
|
||||
CreateCorner(size, true, false, false, true),
|
||||
CreateTJunction(size, true, true, true, false),
|
||||
CreateTJunction(size, false, true, true, true),
|
||||
CreateTJunction(size, true, false, true, true),
|
||||
CreateTJunction(size, true, true, false, true)
|
||||
};
|
||||
|
||||
return templates;
|
||||
}
|
||||
|
||||
private static ChunkTemplate CreateCross(int size)
|
||||
{
|
||||
ChunkTemplate template = CreateTemplate("Runtime_Cross", size, size, true, true, true, true);
|
||||
DrawRoom(template, 3, 3, size - 6, size - 6);
|
||||
DrawPillar(template, 4, 4);
|
||||
DrawPillar(template, size - 5, 4);
|
||||
DrawPillar(template, 4, size - 5);
|
||||
DrawPillar(template, size - 5, size - 5);
|
||||
ScatterEnvironment(template, 3);
|
||||
return template;
|
||||
}
|
||||
|
||||
private static ChunkTemplate CreateStraightHorizontal(int size)
|
||||
{
|
||||
ChunkTemplate template = CreateTemplate("Runtime_Straight_H", size, size, false, true, false, true);
|
||||
DrawRoom(template, 2, 4, size - 4, size - 8);
|
||||
DrawSideAlcoves(template, horizontal: true);
|
||||
ScatterEnvironment(template, 2);
|
||||
return template;
|
||||
}
|
||||
|
||||
private static ChunkTemplate CreateStraightVertical(int size)
|
||||
{
|
||||
ChunkTemplate template = CreateTemplate("Runtime_Straight_V", size, size, true, false, true, false);
|
||||
DrawRoom(template, 4, 2, size - 8, size - 4);
|
||||
DrawSideAlcoves(template, horizontal: false);
|
||||
ScatterEnvironment(template, 2);
|
||||
return template;
|
||||
}
|
||||
|
||||
private static ChunkTemplate CreateCorner(int size, bool top, bool right, bool bottom, bool left)
|
||||
{
|
||||
ChunkTemplate template = CreateTemplate($"Runtime_Corner_{top}_{right}_{bottom}_{left}", size, size, top, right, bottom, left);
|
||||
DrawRoom(template, 3, 3, size - 6, size - 6);
|
||||
if (!top)
|
||||
{
|
||||
DrawWallLine(template, 5, size - 5, size - 6, size - 5);
|
||||
}
|
||||
if (!right)
|
||||
{
|
||||
DrawWallLine(template, size - 5, 5, size - 5, size - 6);
|
||||
}
|
||||
if (!bottom)
|
||||
{
|
||||
DrawWallLine(template, 5, 4, size - 6, 4);
|
||||
}
|
||||
if (!left)
|
||||
{
|
||||
DrawWallLine(template, 4, 5, 4, size - 6);
|
||||
}
|
||||
ScatterEnvironment(template, 2);
|
||||
return template;
|
||||
}
|
||||
|
||||
private static ChunkTemplate CreateTJunction(int size, bool top, bool right, bool bottom, bool left)
|
||||
{
|
||||
ChunkTemplate template = CreateTemplate($"Runtime_T_{top}_{right}_{bottom}_{left}", size, size, top, right, bottom, left);
|
||||
DrawRoom(template, 2, 2, size - 4, size - 4);
|
||||
DrawPillar(template, size / 2, size / 2);
|
||||
ScatterEnvironment(template, 3);
|
||||
return template;
|
||||
}
|
||||
|
||||
private static ChunkTemplate CreateTemplate(string name, int width, int height, bool top, bool right, bool bottom, bool left)
|
||||
{
|
||||
ChunkTemplate template = ScriptableObject.CreateInstance<ChunkTemplate>();
|
||||
template.name = name;
|
||||
template.Resize(width, height);
|
||||
template.exitTop = top;
|
||||
template.exitRight = right;
|
||||
template.exitBottom = bottom;
|
||||
template.exitLeft = left;
|
||||
template.ApplyBorderWallsFromExits(3);
|
||||
return template;
|
||||
}
|
||||
|
||||
private static void DrawRoom(ChunkTemplate template, int xMin, int yMin, int width, int height)
|
||||
{
|
||||
for (int x = xMin; x < xMin + width; x++)
|
||||
{
|
||||
template.SetWall(x, yMin, true);
|
||||
template.SetWall(x, yMin + height - 1, true);
|
||||
}
|
||||
|
||||
for (int y = yMin; y < yMin + height; y++)
|
||||
{
|
||||
template.SetWall(xMin, y, true);
|
||||
template.SetWall(xMin + width - 1, y, true);
|
||||
}
|
||||
|
||||
template.CarveExit(ChunkExit.Top, 3);
|
||||
template.CarveExit(ChunkExit.Right, 3);
|
||||
template.CarveExit(ChunkExit.Bottom, 3);
|
||||
template.CarveExit(ChunkExit.Left, 3);
|
||||
}
|
||||
|
||||
private static void DrawPillar(ChunkTemplate template, int x, int y)
|
||||
{
|
||||
for (int py = -1; py <= 1; py++)
|
||||
{
|
||||
for (int px = -1; px <= 1; px++)
|
||||
{
|
||||
template.SetWall(x + px, y + py, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawSideAlcoves(ChunkTemplate template, bool horizontal)
|
||||
{
|
||||
if (horizontal)
|
||||
{
|
||||
DrawWallLine(template, template.width / 2 - 1, 5, template.width / 2 - 1, 7);
|
||||
DrawWallLine(template, template.width / 2 + 1, template.height - 8, template.width / 2 + 1, template.height - 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawWallLine(template, 5, template.height / 2 - 1, 7, template.height / 2 - 1);
|
||||
DrawWallLine(template, template.width - 8, template.height / 2 + 1, template.width - 6, template.height / 2 + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawWallLine(ChunkTemplate template, int x0, int y0, int x1, int y1)
|
||||
{
|
||||
int dx = Math.Sign(x1 - x0);
|
||||
int dy = Math.Sign(y1 - y0);
|
||||
int x = x0;
|
||||
int y = y0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
template.SetWall(x, y, true);
|
||||
if (x == x1 && y == y1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (x != x1)
|
||||
{
|
||||
x += dx;
|
||||
}
|
||||
|
||||
if (y != y1)
|
||||
{
|
||||
y += dy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ScatterEnvironment(ChunkTemplate template, int spacing)
|
||||
{
|
||||
for (int y = 2; y < template.height - 2; y += spacing + 2)
|
||||
{
|
||||
for (int x = 2; x < template.width - 2; x += spacing + 3)
|
||||
{
|
||||
if (!template.GetWall(x, y))
|
||||
{
|
||||
template.SetEnvironment(x, y, ((x + y) & 1) == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5b485257bdc222448c314a7cd173845
|
||||
@@ -1,10 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace InfiniteWorld
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class WorldAutotileAuthoringRoot : MonoBehaviour
|
||||
{
|
||||
public WorldAutotileProfile profile;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbd0bbbd74f81084bb8661f761798856
|
||||
@@ -1,18 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace InfiniteWorld
|
||||
{
|
||||
public enum WorldAutotileAuthoringSectionType
|
||||
{
|
||||
WallShapes,
|
||||
BackgroundSample,
|
||||
EnvironmentPalette
|
||||
}
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class WorldAutotileAuthoringSection : MonoBehaviour
|
||||
{
|
||||
public WorldAutotileAuthoringSectionType sectionType;
|
||||
public Vector2Int size = Vector2Int.one;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fbfe986c83f0c96419c804643d142e37
|
||||
@@ -1,161 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Tilemaps;
|
||||
|
||||
namespace InfiniteWorld
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Infinite World/World Autotile Profile", fileName = "WorldAutotileProfile")]
|
||||
public class WorldAutotileProfile : ScriptableObject
|
||||
{
|
||||
public bool autoUpdatePaletteLayout = true;
|
||||
public bool autoRefreshGeneratedWorld = true;
|
||||
public TileBase baseGroundTile;
|
||||
public AutoTileDefinition wallTiles = new AutoTileDefinition();
|
||||
public List<EnvironmentTileEntry> environmentTiles = new List<EnvironmentTileEntry>();
|
||||
public List<RandomPrefabEntry> randomPrefabs = new List<RandomPrefabEntry>();
|
||||
|
||||
public TileBase GetWallTile(AutoTileShape shape)
|
||||
{
|
||||
return wallTiles != null ? wallTiles.GetTile(shape) : null;
|
||||
}
|
||||
|
||||
public bool HasAnyAssignedTiles()
|
||||
{
|
||||
if (baseGroundTile != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (wallTiles != null && wallTiles.HasAnyAssignedTiles())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (environmentTiles != null)
|
||||
{
|
||||
for (int i = 0; i < environmentTiles.Count; i++)
|
||||
{
|
||||
if (environmentTiles[i] != null && environmentTiles[i].tile != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public enum AutoTileShape
|
||||
{
|
||||
Center,
|
||||
Top,
|
||||
Right,
|
||||
Bottom,
|
||||
Left,
|
||||
OuterTopLeft,
|
||||
OuterTopRight,
|
||||
OuterBottomRight,
|
||||
OuterBottomLeft,
|
||||
InnerTopLeft,
|
||||
InnerTopRight,
|
||||
InnerBottomRight,
|
||||
InnerBottomLeft
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class AutoTileDefinition
|
||||
{
|
||||
public TileBase center;
|
||||
public TileBase top;
|
||||
public TileBase right;
|
||||
public TileBase bottom;
|
||||
public TileBase left;
|
||||
public TileBase outerTopLeft;
|
||||
public TileBase outerTopRight;
|
||||
public TileBase outerBottomRight;
|
||||
public TileBase outerBottomLeft;
|
||||
public TileBase innerTopLeft;
|
||||
public TileBase innerTopRight;
|
||||
public TileBase innerBottomRight;
|
||||
public TileBase innerBottomLeft;
|
||||
|
||||
public TileBase GetTile(AutoTileShape shape)
|
||||
{
|
||||
TileBase tile = shape switch
|
||||
{
|
||||
AutoTileShape.Center => center,
|
||||
AutoTileShape.Top => top,
|
||||
AutoTileShape.Right => right,
|
||||
AutoTileShape.Bottom => bottom,
|
||||
AutoTileShape.Left => left,
|
||||
AutoTileShape.OuterTopLeft => outerTopLeft,
|
||||
AutoTileShape.OuterTopRight => outerTopRight,
|
||||
AutoTileShape.OuterBottomRight => outerBottomRight,
|
||||
AutoTileShape.OuterBottomLeft => outerBottomLeft,
|
||||
AutoTileShape.InnerTopLeft => innerTopLeft,
|
||||
AutoTileShape.InnerTopRight => innerTopRight,
|
||||
AutoTileShape.InnerBottomRight => innerBottomRight,
|
||||
AutoTileShape.InnerBottomLeft => innerBottomLeft,
|
||||
_ => center
|
||||
};
|
||||
|
||||
return tile ?? center;
|
||||
}
|
||||
|
||||
public TileBase GetAssignedTile(AutoTileShape shape)
|
||||
{
|
||||
return shape switch
|
||||
{
|
||||
AutoTileShape.Center => center,
|
||||
AutoTileShape.Top => top,
|
||||
AutoTileShape.Right => right,
|
||||
AutoTileShape.Bottom => bottom,
|
||||
AutoTileShape.Left => left,
|
||||
AutoTileShape.OuterTopLeft => outerTopLeft,
|
||||
AutoTileShape.OuterTopRight => outerTopRight,
|
||||
AutoTileShape.OuterBottomRight => outerBottomRight,
|
||||
AutoTileShape.OuterBottomLeft => outerBottomLeft,
|
||||
AutoTileShape.InnerTopLeft => innerTopLeft,
|
||||
AutoTileShape.InnerTopRight => innerTopRight,
|
||||
AutoTileShape.InnerBottomRight => innerBottomRight,
|
||||
AutoTileShape.InnerBottomLeft => innerBottomLeft,
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
public bool HasAnyAssignedTiles()
|
||||
{
|
||||
return center != null ||
|
||||
top != null ||
|
||||
right != null ||
|
||||
bottom != null ||
|
||||
left != null ||
|
||||
outerTopLeft != null ||
|
||||
outerTopRight != null ||
|
||||
outerBottomRight != null ||
|
||||
outerBottomLeft != null ||
|
||||
innerTopLeft != null ||
|
||||
innerTopRight != null ||
|
||||
innerBottomRight != null ||
|
||||
innerBottomLeft != null;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class EnvironmentTileEntry
|
||||
{
|
||||
public string id = "Environment";
|
||||
public TileBase tile;
|
||||
[Min(0f)] public float weight = 1f;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class RandomPrefabEntry
|
||||
{
|
||||
public string id = "RandomPrefab";
|
||||
public GameObject prefab;
|
||||
[Min(0f)] public float weight = 1f;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e36b055e81273a54c8e736e2ef74fa50
|
||||
Reference in new issue
Block a user