Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d9e1180fd | ||
|
|
04bb44a5c8 | ||
|
|
e065cdd988 | ||
|
|
5e816c08f0 | ||
|
|
dd3cb12698 | ||
|
|
967a194f16 | ||
|
|
afecf1f518 |
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
@@ -0,0 +1,108 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f57283d516574a1409455a2b33859cf0
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
@@ -0,0 +1,108 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9cc0e072410155649995525a7fde86f3
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -57,7 +57,7 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6443714940181712877}
|
||||
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: -0.132, z: 0.024}
|
||||
m_LocalPosition: {x: 0, y: -0.092, z: 0.024}
|
||||
m_LocalScale: {x: 0.24999988, y: 0.24999988, z: 0.25}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4093383343133656141}
|
||||
|
||||
@@ -750,14 +750,14 @@ RectTransform:
|
||||
m_GameObject: {fileID: 340442194}
|
||||
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_LocalScale: {x: 0.6, y: 0.6, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 622656468}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 3.45, y: 89}
|
||||
m_AnchoredPosition: {x: 1.7, y: 152.5}
|
||||
m_SizeDelta: {x: 406.8999, y: 91.724915}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &340442196
|
||||
@@ -1300,7 +1300,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 48.1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &622656469
|
||||
@@ -1381,7 +1381,7 @@ RectTransform:
|
||||
m_GameObject: {fileID: 691786769}
|
||||
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_LocalScale: {x: 0.6, y: 0.6, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 442107912}
|
||||
m_Father: {fileID: 1849105197}
|
||||
@@ -1389,7 +1389,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: -66}
|
||||
m_AnchoredPosition: {x: -1.7500033, y: -2.5000057}
|
||||
m_SizeDelta: {x: 400, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &691786771
|
||||
@@ -1610,7 +1610,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
material: {fileID: 2100000, guid: f4343d4c3fcbdb94b9db1c71ca64ba0a, type: 2}
|
||||
playerPrefab: {fileID: 4093383343133656139, guid: f648243c6b14d514d92cde4ec433276b, type: 3}
|
||||
worldSize: 0
|
||||
worldSize: 20
|
||||
player: {fileID: 1789911870}
|
||||
deadScreen: {fileID: 1849105196}
|
||||
pauseScreen: {fileID: 622656467}
|
||||
@@ -1640,11 +1640,17 @@ MonoBehaviour:
|
||||
textures: 050506060505
|
||||
transparent: 0
|
||||
- name: Planks
|
||||
textures: 050404040404
|
||||
textures: 040404040404
|
||||
transparent: 0
|
||||
- name: Glass
|
||||
textures: 030303030303
|
||||
transparent: 1
|
||||
- name: Brick
|
||||
textures: 0b0b0b0b0b0b
|
||||
transparent: 0
|
||||
- name: Cobblestone
|
||||
textures: 080808080808
|
||||
transparent: 0
|
||||
--- !u!1 &965289403
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1827,7 +1833,7 @@ RectTransform:
|
||||
m_GameObject: {fileID: 1067955952}
|
||||
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_LocalScale: {x: 0.6, y: 0.6, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1002513218}
|
||||
m_Father: {fileID: 622656468}
|
||||
@@ -1835,7 +1841,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 2.0000107, y: -71}
|
||||
m_AnchoredPosition: {x: 0.25000715, y: -7.5000057}
|
||||
m_SizeDelta: {x: 400, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1067955954
|
||||
@@ -2110,7 +2116,7 @@ RectTransform:
|
||||
m_GameObject: {fileID: 1137642685}
|
||||
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_LocalScale: {x: 0.6, y: 0.6, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 36275042}
|
||||
m_Father: {fileID: 622656468}
|
||||
@@ -2118,7 +2124,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 2, y: -137}
|
||||
m_AnchoredPosition: {x: 0.24999666, y: -73.50001}
|
||||
m_SizeDelta: {x: 400, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1137642687
|
||||
@@ -2791,14 +2797,14 @@ RectTransform:
|
||||
m_GameObject: {fileID: 1563028627}
|
||||
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_LocalScale: {x: 0.6, y: 0.6, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1849105197}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 3.45, y: 89}
|
||||
m_AnchoredPosition: {x: 1.6999965, y: 152.5}
|
||||
m_SizeDelta: {x: 406.8999, y: 91.724915}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1563028629
|
||||
@@ -2975,7 +2981,7 @@ RectTransform:
|
||||
m_GameObject: {fileID: 1575613138}
|
||||
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_LocalScale: {x: 0.6, y: 0.6, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1353507539}
|
||||
m_Father: {fileID: 1849105197}
|
||||
@@ -2983,7 +2989,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: -1.7500033, y: 63.499992}
|
||||
m_SizeDelta: {x: 400, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1575613140
|
||||
@@ -3485,7 +3491,7 @@ RectTransform:
|
||||
m_GameObject: {fileID: 2041321709}
|
||||
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_LocalScale: {x: 0.6, y: 0.6, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 789667300}
|
||||
m_Father: {fileID: 622656468}
|
||||
@@ -3493,7 +3499,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: -1.7500033, y: 63.499992}
|
||||
m_SizeDelta: {x: 400, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2041321711
|
||||
@@ -3668,6 +3674,8 @@ MonoBehaviour:
|
||||
- {fileID: 21300000, guid: b72adb17f9f9dc849868363fd2fbe6ab, type: 3}
|
||||
- {fileID: 21300000, guid: 24951cc96c828c44c93a0c91b9687b11, type: 3}
|
||||
- {fileID: 21300000, guid: 9720360232ff9ee45b79475a071933b0, type: 3}
|
||||
- {fileID: 21300000, guid: f57283d516574a1409455a2b33859cf0, type: 3}
|
||||
- {fileID: 21300000, guid: 9cc0e072410155649995525a7fde86f3, type: 3}
|
||||
highlight: {fileID: 1538641651}
|
||||
--- !u!33 &2317136213949272296
|
||||
MeshFilter:
|
||||
|
||||
@@ -236,11 +236,11 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2033099004}
|
||||
m_RootOrder: 3
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -149.2, y: -78.60002}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 0, y: 0.5}
|
||||
m_AnchoredPosition: {x: 115.600006, y: -79.4}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &71764842
|
||||
@@ -315,7 +315,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2033099004}
|
||||
m_RootOrder: 1
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
@@ -476,11 +476,11 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2033099004}
|
||||
m_RootOrder: 4
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -149.19998, y: -124.000015}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 0, y: 0.5}
|
||||
m_AnchoredPosition: {x: 115.600006, y: -124.79999}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &854417905
|
||||
@@ -557,11 +557,11 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 1486495034}
|
||||
m_Father: {fileID: 2033099004}
|
||||
m_RootOrder: 6
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 105.799995, y: -78.60001}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 0, y: 0.5}
|
||||
m_AnchoredPosition: {x: 370.59998, y: -79.39999}
|
||||
m_SizeDelta: {x: 297.6238, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1047272871
|
||||
@@ -790,11 +790,11 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 1578575450}
|
||||
m_Father: {fileID: 2033099004}
|
||||
m_RootOrder: 5
|
||||
m_RootOrder: 6
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 105.80006, y: -33.200016}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 0, y: 0.5}
|
||||
m_AnchoredPosition: {x: 370.60004, y: -33.999992}
|
||||
m_SizeDelta: {x: 297.6238, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1174182476
|
||||
@@ -912,6 +912,81 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1174182474}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1245606520
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1245606521}
|
||||
- component: {fileID: 1245606523}
|
||||
- component: {fileID: 1245606522}
|
||||
m_Layer: 5
|
||||
m_Name: Background (1)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1245606521
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1245606520}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 2033099004}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 1.8013916, y: 0}
|
||||
m_SizeDelta: {x: 3.6027832, y: -0.54000854}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1245606522
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1245606520}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.15686275}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &1245606523
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1245606520}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1279274158
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -944,11 +1019,11 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 1747497270}
|
||||
m_Father: {fileID: 2033099004}
|
||||
m_RootOrder: 8
|
||||
m_RootOrder: 9
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: -105.899994, y: 43}
|
||||
m_AnchoredPosition: {x: -87.9, y: 31.533}
|
||||
m_SizeDelta: {x: 160, y: 45.3632}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1279274160
|
||||
@@ -1235,11 +1310,11 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 1055915759}
|
||||
m_Father: {fileID: 2033099004}
|
||||
m_RootOrder: 7
|
||||
m_RootOrder: 8
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 105.80001, y: -124}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 0, y: 0.5}
|
||||
m_AnchoredPosition: {x: 370.6, y: -124.79997}
|
||||
m_SizeDelta: {x: 297.6238, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1603203176
|
||||
@@ -1529,11 +1604,11 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2033099004}
|
||||
m_RootOrder: 2
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -149.19998, y: -33.200016}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 0, y: 0.5}
|
||||
m_AnchoredPosition: {x: 115.600006, y: -33.999992}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1783690559
|
||||
@@ -1670,6 +1745,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_Children:
|
||||
- {fileID: 1661573148}
|
||||
- {fileID: 1245606521}
|
||||
- {fileID: 557944438}
|
||||
- {fileID: 1783690558}
|
||||
- {fileID: 71764841}
|
||||
|
||||
@@ -9,6 +9,7 @@ public class Chunk
|
||||
private Material material;
|
||||
private ChunkCoord chunkPosition;
|
||||
private World world;
|
||||
public bool active = false;
|
||||
|
||||
//rendering
|
||||
public GameObject gameObject;
|
||||
@@ -87,14 +88,19 @@ public class Chunk
|
||||
y + Data.faceChecks[f].y,
|
||||
z + Data.faceChecks[f].z + chunkPosition.z * Data.chunkWidth))))
|
||||
{
|
||||
for (int v = 0; v < 6; v++)
|
||||
if(world.GetBlockID(new Vector3(x + chunkPosition.x * Data.chunkWidth,
|
||||
y,
|
||||
z + chunkPosition.z * Data.chunkWidth)) != 9)
|
||||
{
|
||||
vertices.Add(Data.vertices[Data.triangles[f, v]] + new Vector3(x, y, z));
|
||||
triangles.Add(triangleIndex);
|
||||
triangleIndex++;
|
||||
}
|
||||
for (int v = 0; v < 6; v++)
|
||||
{
|
||||
vertices.Add(Data.vertices[Data.triangles[f, v]] + new Vector3(x, y, z));
|
||||
triangles.Add(triangleIndex);
|
||||
triangleIndex++;
|
||||
}
|
||||
|
||||
AddUV(textures[f]);
|
||||
AddUV(textures[f]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,6 +137,17 @@ public class Chunk
|
||||
meshFilter.mesh = mesh;
|
||||
meshRenderer.material = material;
|
||||
collider.sharedMesh = mesh;
|
||||
active = true;
|
||||
}
|
||||
|
||||
public void DestroyMesh()
|
||||
{
|
||||
meshFilter.mesh = null;
|
||||
vertices.Clear();
|
||||
triangles.Clear();
|
||||
uv.Clear();
|
||||
collider.sharedMesh = null;
|
||||
active = false;
|
||||
}
|
||||
|
||||
public void Edit(byte x, byte y, byte z, byte blockID)
|
||||
|
||||
@@ -6,6 +6,7 @@ public class Data
|
||||
{
|
||||
public static int chunkWidth = 15, chunkHeight = 250;
|
||||
public static int textureAtlasSize = 16;
|
||||
public static int viewDistance = 9;
|
||||
|
||||
public static readonly Vector3[] vertices =
|
||||
{
|
||||
|
||||
@@ -14,11 +14,19 @@ public class Hotbar : MonoBehaviour
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//change later:
|
||||
hotBarItems[0] = 10;
|
||||
hotBarItems[1] = 11;
|
||||
hotBarItems[2] = 3;
|
||||
hotBarItems[3] = 4;
|
||||
hotBarItems[4] = 5;
|
||||
hotBarItems[5] = 2;
|
||||
hotBarItems[6] = 7;
|
||||
hotBarItems[7] = 8;
|
||||
hotBarItems[8] = 9;
|
||||
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
itemSlots[i].sprite = itemIcons[i];
|
||||
hotBarItems[i] = (byte)(i + 1);
|
||||
itemSlots[i].sprite = itemIcons[hotBarItems[i] - 1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@ public class Player : MonoBehaviour
|
||||
|
||||
int currentSlot = (int)hotbar.GetSelectedSlot();
|
||||
currentSlot += (int)(-Input.GetAxisRaw("Mouse ScrollWheel") * 10);
|
||||
|
||||
if (currentSlot > 8) currentSlot = 0;
|
||||
if (currentSlot < 0) currentSlot = 8;
|
||||
hotbar.SelectSlot((byte)currentSlot);
|
||||
@@ -276,10 +277,10 @@ public class Player : MonoBehaviour
|
||||
private float CheckUpSpeed(float upSpeed)
|
||||
{
|
||||
if (
|
||||
world.CheckBlock(new Vector3(transform.position.x - playerWidth, transform.position.y + upSpeed + 2f, transform.position.z - playerWidth)) ||
|
||||
world.CheckBlock(new Vector3(transform.position.x + playerWidth, transform.position.y + upSpeed + 2f, transform.position.z - playerWidth)) ||
|
||||
world.CheckBlock(new Vector3(transform.position.x + playerWidth, transform.position.y + upSpeed + 2f, transform.position.z + playerWidth)) ||
|
||||
world.CheckBlock(new Vector3(transform.position.x - playerWidth, transform.position.y + upSpeed + 2f, transform.position.z + playerWidth))
|
||||
world.CheckBlock(new Vector3(transform.position.x - playerWidth, transform.position.y + upSpeed + 1.9f, transform.position.z - playerWidth)) ||
|
||||
world.CheckBlock(new Vector3(transform.position.x + playerWidth, transform.position.y + upSpeed + 1.9f, transform.position.z - playerWidth)) ||
|
||||
world.CheckBlock(new Vector3(transform.position.x + playerWidth, transform.position.y + upSpeed + 1.9f, transform.position.z + playerWidth)) ||
|
||||
world.CheckBlock(new Vector3(transform.position.x - playerWidth, transform.position.y + upSpeed + 1.9f, transform.position.z + playerWidth))
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
@@ -386,8 +387,8 @@ public class Player : MonoBehaviour
|
||||
|
||||
public Vector3 GetDefaultPlayerPosition()
|
||||
{
|
||||
return new Vector3((byte)transform.position.x,
|
||||
world.GetHeight((byte)transform.position.x, (byte)transform.position.z) + 2, (byte)transform.position.z);
|
||||
return new Vector3(world.worldSize * Data.chunkWidth / 2,
|
||||
world.GetHeight((byte)transform.position.x, (byte)transform.position.z) + 2, world.worldSize * Data.chunkWidth / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,12 @@ public class World : MonoBehaviour
|
||||
[SerializeField] private Player player;
|
||||
[SerializeField] private GameObject deadScreen;
|
||||
[SerializeField] private GameObject pauseScreen;
|
||||
private ChunkCoord lastPlayerChunkCoord = new ChunkCoord(0, 0);
|
||||
|
||||
//chunks
|
||||
private Chunk[,] chunks;
|
||||
private Queue<ChunkCoord> chunksToUpdate = new Queue<ChunkCoord>();
|
||||
private List<Chunk> lastActiveChunks = new List<Chunk>();
|
||||
|
||||
//blocks
|
||||
[SerializeField] public BlockData[] blockData;
|
||||
@@ -54,6 +56,17 @@ public class World : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
ChunkCoord playerChunkCoord = new ChunkCoord((int)(player.transform.position.x / Data.chunkWidth),
|
||||
(int)(player.transform.position.z / Data.chunkWidth));
|
||||
|
||||
if (lastPlayerChunkCoord.x != playerChunkCoord.x || lastPlayerChunkCoord.z != playerChunkCoord.z)
|
||||
{
|
||||
LoadChunks(playerChunkCoord);
|
||||
}
|
||||
|
||||
lastPlayerChunkCoord = new ChunkCoord((int)(player.transform.position.x / Data.chunkWidth),
|
||||
(int)(player.transform.position.z / Data.chunkWidth));
|
||||
|
||||
//update 1 chunk in list
|
||||
if (chunksToUpdate.Count > 0)
|
||||
{
|
||||
@@ -107,22 +120,66 @@ public class World : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadChunks(ChunkCoord playerChunk)
|
||||
{
|
||||
List<Chunk> checkList = new List<Chunk>();
|
||||
|
||||
for (int x = playerChunk.x - Data.viewDistance; x < playerChunk.x + Data.viewDistance; x++)
|
||||
{
|
||||
for (int z = playerChunk.z - Data.viewDistance; z < playerChunk.z + Data.viewDistance; z++)
|
||||
{
|
||||
if(chunks[x, z].gameObject == null)
|
||||
{
|
||||
chunks[x, z].Initialize();
|
||||
chunks[x, z].gameObject.transform.SetParent(gameObject.transform);
|
||||
}
|
||||
if(!chunks[x, z].active)
|
||||
{
|
||||
chunksToUpdate.Enqueue(new ChunkCoord(x, z));
|
||||
}
|
||||
checkList.Add(chunks[x, z]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Chunk c in lastActiveChunks)
|
||||
{
|
||||
if (!checkList.Contains(c))
|
||||
{
|
||||
c.DestroyMesh();
|
||||
}
|
||||
}
|
||||
|
||||
lastActiveChunks.Clear();
|
||||
|
||||
lastActiveChunks = new List<Chunk>(checkList);
|
||||
}
|
||||
|
||||
|
||||
//enqueue player position update to list
|
||||
public void UpdatePlayerPosition(Vector3 position, byte id)
|
||||
{
|
||||
playersPositionsToUpdate.Enqueue(new Player.PlayerPositionUpdateData(id, position, false));
|
||||
if(playersPositionsToUpdate.Count < 50)
|
||||
{
|
||||
playersPositionsToUpdate.Enqueue(new Player.PlayerPositionUpdateData(id, position, false));
|
||||
}
|
||||
}
|
||||
|
||||
//enqueue player rotation update to list
|
||||
public void UpdatePlayerRotation(Quaternion rotation, byte id)
|
||||
{
|
||||
playersRotationsToUpdate.Enqueue(new Player.PlayerRotationsUpdateData(id, rotation));
|
||||
if(playersRotationsToUpdate.Count < 50)
|
||||
{
|
||||
playersRotationsToUpdate.Enqueue(new Player.PlayerRotationsUpdateData(id, rotation));
|
||||
}
|
||||
}
|
||||
|
||||
//enqueue player create data to list
|
||||
public void AddPlayer(byte id)
|
||||
{
|
||||
playersToCreate.Enqueue(id);
|
||||
if(!otherPlayers.ContainsKey(id))
|
||||
{
|
||||
playersToCreate.Enqueue(id);
|
||||
}
|
||||
}
|
||||
|
||||
//creates the array for chunk objects
|
||||
@@ -140,14 +197,14 @@ public class World : MonoBehaviour
|
||||
//initialized the chunk objects
|
||||
public void CreateChunks()
|
||||
{
|
||||
for (int x = 0; x < worldSize; x++)
|
||||
for (int x = worldSize / 2 - Data.viewDistance; x < worldSize / 2 + Data.viewDistance; x++)
|
||||
{
|
||||
for (int z = 0; z < worldSize; z++)
|
||||
for (int z = worldSize / 2 - Data.viewDistance; z < worldSize / 2 + Data.viewDistance; z++)
|
||||
{
|
||||
chunks[x, z].Initialize();
|
||||
chunks[x, z].gameObject.transform.SetParent(gameObject.transform);
|
||||
chunks[x, z].AddBlocks();
|
||||
chunks[x, z].CreateMesh();
|
||||
chunksToUpdate.Enqueue(new ChunkCoord(x, z));
|
||||
lastActiveChunks.Add(chunks[x, z]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,11 +261,11 @@ public class World : MonoBehaviour
|
||||
int zInChunk = z - (zChunk * Data.chunkWidth);
|
||||
|
||||
Chunk c = chunks[xChunk, zChunk];
|
||||
for (int y = 0; y < Data.chunkHeight; y++)
|
||||
for (int y = Data.chunkHeight - 1; y > 0; y--)
|
||||
{
|
||||
if (c.blocks[xInChunk, y, zInChunk] == 0)
|
||||
if (c.blocks[xInChunk, y, zInChunk] != 0)
|
||||
{
|
||||
return (byte)(y - 1);
|
||||
return (byte)(y + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,6 +357,8 @@ public class World : MonoBehaviour
|
||||
Time.timeScale = 1;
|
||||
player.transform.position = player.GetDefaultPlayerPosition();
|
||||
deadScreen.SetActive(false);
|
||||
LoadChunks(new ChunkCoord((int)(player.transform.position.x / Data.chunkWidth),
|
||||
(int)(player.transform.position.z / Data.chunkWidth)));
|
||||
}
|
||||
|
||||
public void ResumeButton()
|
||||
|
||||
@@ -373,3 +373,19 @@ InputManager:
|
||||
type: 0
|
||||
axis: 8
|
||||
joyNum: 0
|
||||
- serializedVersion: 3
|
||||
m_Name: LB
|
||||
descriptiveName:
|
||||
descriptiveNegativeName:
|
||||
negativeButton:
|
||||
positiveButton: joystick button 4
|
||||
altNegativeButton:
|
||||
altPositiveButton:
|
||||
gravity: 1000
|
||||
dead: 0.001
|
||||
sensitivity: 1000
|
||||
snap: 0
|
||||
invert: 0
|
||||
type: 0
|
||||
axis: 8
|
||||
joyNum: 0
|
||||
|
||||
@@ -16,13 +16,13 @@ PlayerSettings:
|
||||
productName: Minecraft Client
|
||||
defaultCursor: {fileID: 0}
|
||||
cursorHotspot: {x: 0, y: 0}
|
||||
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
|
||||
m_SplashScreenBackgroundColor: {r: 0, g: 0.17825913, b: 1, a: 1}
|
||||
m_ShowUnitySplashScreen: 1
|
||||
m_ShowUnitySplashLogo: 1
|
||||
m_SplashScreenOverlayOpacity: 1
|
||||
m_SplashScreenAnimation: 1
|
||||
m_SplashScreenLogoStyle: 1
|
||||
m_SplashScreenDrawMode: 0
|
||||
m_SplashScreenLogoStyle: 0
|
||||
m_SplashScreenDrawMode: 1
|
||||
m_SplashScreenBackgroundAnimationZoom: 1
|
||||
m_SplashScreenLogoAnimationZoom: 1
|
||||
m_SplashScreenBackgroundLandscapeAspect: 1
|
||||
@@ -39,7 +39,9 @@ PlayerSettings:
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
m_SplashScreenLogos: []
|
||||
m_SplashScreenLogos:
|
||||
- logo: {fileID: 10404, guid: 0000000000000000e000000000000000, type: 0}
|
||||
duration: 3.01
|
||||
m_VirtualRealitySplashScreen: {fileID: 0}
|
||||
m_HolographicTrackingLossScreen: {fileID: 0}
|
||||
defaultScreenWidth: 512
|
||||
@@ -580,9 +582,9 @@ PlayerSettings:
|
||||
ps4IncludedModules: []
|
||||
ps4attribVROutputEnabled: 0
|
||||
monoEnv:
|
||||
splashScreenBackgroundSourceLandscape: {fileID: 0}
|
||||
splashScreenBackgroundSourceLandscape: {fileID: 21300000, guid: b9659c3db2ca9c0469b9d747f546103a, type: 3}
|
||||
splashScreenBackgroundSourcePortrait: {fileID: 0}
|
||||
blurSplashScreenBackground: 1
|
||||
blurSplashScreenBackground: 0
|
||||
spritePackerPolicy:
|
||||
webGLMemorySize: 16
|
||||
webGLExceptionSupport: 1
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
{
|
||||
"templatePinStates": [],
|
||||
"dependencyTypeInfos": [
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.AnimationClip",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEditor.Animations.AnimatorController",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.AnimatorOverrideController",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEditor.Audio.AudioMixerController",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.ComputeShader",
|
||||
"ignore": true,
|
||||
"defaultInstantiationMode": 1,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.Cubemap",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.GameObject",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEditor.LightingDataAsset",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": false
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.LightingSettings",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.Material",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEditor.MonoScript",
|
||||
"ignore": true,
|
||||
"defaultInstantiationMode": 1,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.PhysicMaterial",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.PhysicsMaterial2D",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.Rendering.PostProcessing.PostProcessResources",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.Rendering.VolumeProfile",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEditor.SceneAsset",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": false
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.Shader",
|
||||
"ignore": true,
|
||||
"defaultInstantiationMode": 1,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.ShaderVariantCollection",
|
||||
"ignore": true,
|
||||
"defaultInstantiationMode": 1,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.Texture",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.Texture2D",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
},
|
||||
{
|
||||
"userAdded": false,
|
||||
"type": "UnityEngine.Timeline.TimelineAsset",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 0,
|
||||
"supportsModification": true
|
||||
}
|
||||
],
|
||||
"defaultDependencyTypeInfo": {
|
||||
"userAdded": false,
|
||||
"type": "<default_scene_template_dependencies>",
|
||||
"ignore": false,
|
||||
"defaultInstantiationMode": 1,
|
||||
"supportsModification": true
|
||||
},
|
||||
"newSceneOverride": 0
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Noise
|
||||
{
|
||||
public byte GetHeight(int x, int z, int randomOffsetX, int randomOffsetZ)
|
||||
{
|
||||
float scale = 0.025f;
|
||||
byte perlinHeight = 10;
|
||||
byte groundHeight = 50;
|
||||
|
||||
byte height = (byte)(Mathf.PerlinNoise((x + randomOffsetX) * scale + 0.1f, (z + randomOffsetZ) * scale + 0.1f) * perlinHeight + groundHeight);
|
||||
return height;
|
||||
}
|
||||
|
||||
public bool CheckTree(int x, int z)
|
||||
{
|
||||
float scale = .99f;
|
||||
float threshold = .96f;
|
||||
|
||||
if (Mathf.PerlinNoise((x) * scale + 0.1f, (z) * scale + 0.1f) >= threshold)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Get3DPerlin(Vector3 position, float offset, float scale, float threshold)
|
||||
{
|
||||
float x = (position.x + offset + .1f) * scale;
|
||||
float y = (position.y + offset + .1f) * scale;
|
||||
float z = (position.z + offset + .1f) * scale;
|
||||
|
||||
float AB = Mathf.PerlinNoise(x, y);
|
||||
float BC = Mathf.PerlinNoise(y, z);
|
||||
float AC = Mathf.PerlinNoise(x, z);
|
||||
|
||||
float BA = Mathf.PerlinNoise(y, x);
|
||||
float CB = Mathf.PerlinNoise(z, y);
|
||||
float CA = Mathf.PerlinNoise(z, x);
|
||||
|
||||
if ((AB + BC + AC + BA + CB + CA) / 6f > threshold)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dedaa2ec7a8b12443a08f16cad880f84
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -13,6 +13,7 @@ public class World : MonoBehaviour
|
||||
private int randomOffsetX, randomOffsetZ;
|
||||
private int seed = 0;
|
||||
private string dataPath;
|
||||
private Noise noise = new Noise();
|
||||
|
||||
//chunks
|
||||
public Chunk[,] chunks;
|
||||
@@ -29,6 +30,8 @@ public class World : MonoBehaviour
|
||||
|
||||
if (File.Exists(Application.dataPath + "\\save.world"))
|
||||
{
|
||||
Console.WriteLine("loading world... \n");
|
||||
|
||||
chunks = new Chunk[worldSize, worldSize];
|
||||
for (int x = 0; x < worldSize; x++)
|
||||
{
|
||||
@@ -65,6 +68,8 @@ public class World : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("generate world... \n");
|
||||
|
||||
CreateChunks();
|
||||
CreateTrees();
|
||||
}
|
||||
@@ -102,12 +107,12 @@ public class World : MonoBehaviour
|
||||
{
|
||||
for (int z = 4; z < worldSize * Data.chunkWidth - 4; z++)
|
||||
{
|
||||
if (CheckTree(x, z))
|
||||
if (noise.CheckTree(x, z))
|
||||
{
|
||||
ChunkCoord chunk = new ChunkCoord((int)(x / Data.chunkWidth),
|
||||
(int)(z / Data.chunkWidth));
|
||||
int xInChunk = (int)(x - chunk.x * Data.chunkWidth);
|
||||
int yInChunk = (int)(GetHeight(x, z));
|
||||
int yInChunk = (int)(noise.GetHeight(x, z, randomOffsetX, randomOffsetZ));
|
||||
int zInChunk = (int)(z - chunk.z * Data.chunkWidth);
|
||||
|
||||
int height = Random.Range(5, 9);
|
||||
@@ -157,11 +162,6 @@ public class World : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ public class World : MonoBehaviour
|
||||
//return the ID of a block
|
||||
public byte GetBlockID(Vector3 positionInWorld)
|
||||
{
|
||||
byte height = GetHeight((int)positionInWorld.x, (int)positionInWorld.z);
|
||||
byte height = noise.GetHeight((int)positionInWorld.x, (int)positionInWorld.z, randomOffsetX, randomOffsetZ);
|
||||
|
||||
//world pass
|
||||
if (positionInWorld.x < 0 || positionInWorld.y < 0 || positionInWorld.z < 0 ||
|
||||
@@ -180,24 +180,37 @@ public class World : MonoBehaviour
|
||||
return 0;
|
||||
}
|
||||
|
||||
//chunk pass
|
||||
//surface pass
|
||||
if ((int)positionInWorld.y == height)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
//bedrock pass
|
||||
if ((int)positionInWorld.y == 0)
|
||||
{
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//dirt pass
|
||||
if ((int)positionInWorld.y > height - 3)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
//underground pass
|
||||
if ((int)positionInWorld.y < height)
|
||||
{
|
||||
//caves
|
||||
if((int)positionInWorld.y > 6 && (int)positionInWorld.y < height - 8)
|
||||
{
|
||||
if (noise.Get3DPerlin(positionInWorld, 0, 0.18f, 0.5f))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
@@ -240,30 +253,6 @@ public class World : MonoBehaviour
|
||||
return true;
|
||||
}
|
||||
|
||||
private byte GetHeight(int x, int z)
|
||||
{
|
||||
float scale = 0.025f;
|
||||
byte perlinHeight = 10;
|
||||
byte groundHeight = 10;
|
||||
|
||||
byte height = (byte)(Mathf.PerlinNoise((x + randomOffsetX) * scale + 0.1f, (z + randomOffsetZ) * scale + 0.1f) * perlinHeight + groundHeight);
|
||||
return height;
|
||||
}
|
||||
|
||||
private bool CheckTree(int x, int z)
|
||||
{
|
||||
float scale = .99f;
|
||||
float threshold = .96f;
|
||||
|
||||
if (Mathf.PerlinNoise((x) * scale + 0.1f, (z) * scale + 0.1f) >= threshold)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public void EditBlock(ChunkCoord chunk, Vector3 positionInChunk, byte blockID)
|
||||
{
|
||||
byte xInChunk = (byte)(positionInChunk.x);
|
||||
@@ -311,6 +300,6 @@ public class World : MonoBehaviour
|
||||
}
|
||||
}
|
||||
writer.Close();
|
||||
Console.WriteLine("world saved! \n");
|
||||
Console.WriteLine("world saved! (world.save) \n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,5 +166,5 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 5457f26f725053d46bffb9885acfd7d8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
worldSize: 20
|
||||
worldSize: 60
|
||||
transferDelay: 5
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user