Есть классы, есть двери, есть механика вселения, свага есть

This commit is contained in:
vladislove committed 2026-10-21 21:21:16 +03:00
1 parent 2ae795c30a
commit 0f9a539460
69 files changed
+3956 -295

No files matched your search

@@ -115,7 +115,7 @@ Transform:
m_GameObject: {fileID: 2843372904200575810} m_GameObject: {fileID: 2843372904200575810}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: -0, z: 2.76}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
@@ -165,6 +165,7 @@ GameObject:
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 3746822541032507966} - component: {fileID: 3746822541032507966}
- component: {fileID: 4674200379723888158}
m_Layer: 0 m_Layer: 0
m_Name: DoubleDoors m_Name: DoubleDoors
m_TagString: Untagged m_TagString: Untagged
@@ -188,6 +189,27 @@ Transform:
- {fileID: 2807690065452777319} - {fileID: 2807690065452777319}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!114 &4674200379723888158
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6535836871367019504}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5850387c1f4a4054bb33e19563ddb215, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.LevelGenerating.DoorController
leftWing: {fileID: 6416625630927243762}
rightWing: {fileID: 3030238907295410112}
openType: 0
openSpeed: 3.5
slideDistance: 1
openAngle: 90
autoOpenNearPlayer: 1
playerTag: Player
triggerSize: {x: 3.5, y: 2.5, z: 4.5}
--- !u!1 &7358846770334495735 --- !u!1 &7358846770334495735
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 36f9248c6699c0e4295c8f863bda9395
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,119 @@
fileFormatVersion: 2
guid: da5af0ba450b7c147ae871bbfac878b5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,119 @@
fileFormatVersion: 2
guid: 97e418d4539e0b34ba59707f1d5f3ebd
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,119 @@
fileFormatVersion: 2
guid: 2dcca23c595b3e14a86b95f3081c1886
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,119 @@
fileFormatVersion: 2
guid: e9d4375ebd3d4404eb92d12dc9de1eec
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,119 @@
fileFormatVersion: 2
guid: f149f0b4eecb8ed43aacf32b0e4f15d1
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,119 @@
fileFormatVersion: 2
guid: 3bd18914fb9c41747b4d74d337108d39
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,119 @@
fileFormatVersion: 2
guid: 2e266426a179a1742942531a967468b6
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,119 @@
fileFormatVersion: 2
guid: 2301f05100cef9f4fa12cc56532d677e
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
+144
View File
@@ -0,0 +1,144 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 1
m_Shader: {fileID: 4800000, guid: 0a7484571253481a8dbad0d7a985699d, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ROUGHNESSMAP
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: da5af0ba450b7c147ae871bbfac878b5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 2dcca23c595b3e14a86b95f3081c1886, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 97e418d4539e0b34ba59707f1d5f3ebd, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _RoughnessMap:
m_Texture: {fileID: 2800000, guid: e9d4375ebd3d4404eb92d12dc9de1eec, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 1
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _ScreenSpaceReflections: 1
- _ScreenSpaceReflectionsContributeTransparent: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UseRoughnessMap: 1
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &8407496104739676885
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 97c133dd693f55b4b9870a95732f9b1a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
+144
View File
@@ -0,0 +1,144 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 2
m_Shader: {fileID: 4800000, guid: 0a7484571253481a8dbad0d7a985699d, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ROUGHNESSMAP
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: f149f0b4eecb8ed43aacf32b0e4f15d1, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 2e266426a179a1742942531a967468b6, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 3bd18914fb9c41747b4d74d337108d39, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _RoughnessMap:
m_Texture: {fileID: 2800000, guid: 2301f05100cef9f4fa12cc56532d677e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 1
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _ScreenSpaceReflections: 1
- _ScreenSpaceReflectionsContributeTransparent: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UseRoughnessMap: 1
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &8407496104739676885
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 71a4dbd1ab99d8d4a9c1b3af4b283897
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,378 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3211079326419307056
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6282667961138379387}
- component: {fileID: 7854459092770844724}
- component: {fileID: 5529056598057758432}
m_Layer: 0
m_Name: FM_2_2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6282667961138379387
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3211079326419307056}
serializedVersion: 2
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0, y: -0.04135183, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4540079231376753174}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7854459092770844724
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3211079326419307056}
m_Mesh: {fileID: -3302765362846597455, guid: 50401149d8b10144097ce8bbebb08622, type: 3}
--- !u!23 &5529056598057758432
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3211079326419307056}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
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: 97c133dd693f55b4b9870a95732f9b1a, type: 2}
- {fileID: 2100000, guid: 71a4dbd1ab99d8d4a9c1b3af4b283897, 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: 3
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_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &7011085542959660750
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4540079231376753174}
- component: {fileID: 4789242207004797252}
m_Layer: 0
m_Name: DoubleDoor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4540079231376753174
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7011085542959660750}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: 3.7352257, y: -0.11592421, z: 19.840834}
m_LocalScale: {x: 1.27, y: 1.27, z: 1.27}
m_ConstrainProportionsScale: 1
m_Children:
- {fileID: 6282667961138379387}
- {fileID: 8033065502413695394}
- {fileID: 4808838616515635494}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!114 &4789242207004797252
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7011085542959660750}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5850387c1f4a4054bb33e19563ddb215, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.LevelGenerating.DoorController
leftWing: {fileID: 8033065502413695394}
rightWing: {fileID: 4808838616515635494}
openType: 1
openSpeed: 7
slideDistance: 1
openAngle: 90
autoOpenNearPlayer: 1
playerTag: Player
triggerSize: {x: 5, y: 2.5, z: 5}
--- !u!1 &7035773345097184077
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4808838616515635494}
- component: {fileID: 1065601554953497592}
- component: {fileID: 5363574094785855242}
- component: {fileID: 471795241343047879}
m_Layer: 0
m_Name: R_2_2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4808838616515635494
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7035773345097184077}
serializedVersion: 2
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.08189, y: 0.020675914, z: 0.032}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4540079231376753174}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1065601554953497592
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7035773345097184077}
m_Mesh: {fileID: 8460025600680667838, guid: 50401149d8b10144097ce8bbebb08622, type: 3}
--- !u!23 &5363574094785855242
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7035773345097184077}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
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: 71a4dbd1ab99d8d4a9c1b3af4b283897, type: 2}
- {fileID: 2100000, guid: fcb9fd8f56eb8774bbb4d0c8be749c6e, type: 2}
- {fileID: 2100000, guid: 97c133dd693f55b4b9870a95732f9b1a, type: 2}
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, 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: 3
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_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &471795241343047879
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7035773345097184077}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1.0889751, y: 2.34049, z: 0.16221163}
m_Center: {x: 0.5447729, y: 1.170245, z: -0.0308804}
--- !u!1 &7965967322314235943
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8033065502413695394}
- component: {fileID: 8663974570160070671}
- component: {fileID: 8309564723297074150}
- component: {fileID: 2191799945705715050}
m_Layer: 0
m_Name: L_2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8033065502413695394
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7965967322314235943}
serializedVersion: 2
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.08189, y: 0.020675914, z: 0.032}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4540079231376753174}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &8663974570160070671
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7965967322314235943}
m_Mesh: {fileID: 4928919458962430497, guid: 50401149d8b10144097ce8bbebb08622, type: 3}
--- !u!23 &8309564723297074150
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7965967322314235943}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
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: 71a4dbd1ab99d8d4a9c1b3af4b283897, type: 2}
- {fileID: 2100000, guid: 97c133dd693f55b4b9870a95732f9b1a, type: 2}
- {fileID: 2100000, guid: fcb9fd8f56eb8774bbb4d0c8be749c6e, 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: 3
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_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &2191799945705715050
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7965967322314235943}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1.0877306, y: 2.34049, z: 0.16221163}
m_Center: {x: -0.5441507, y: 1.170245, z: -0.0308804}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 18981877707abf547842020ad7b50086
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 50401149d8b10144097ce8bbebb08622
ModelImporter:
serializedVersion: 24600
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
searchTexturesGlobally: 0
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
preBakeConvexCollisionMesh: 0
preBakeTriangleCollisionMesh: 0
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
generateMeshLods: 0
meshLodGenerationFlags: 0
maximumMeshLod: -1
importUVs: -1
importVertexColors: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
calculateBlendshapeNormalsDeltaFromImportedNormals: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,143 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GlassDoor
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHAPREMULTIPLY_ON
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- MOTIONVECTORS
- DepthOnly
- SHADOWCASTER
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _DstBlendAlpha: 10
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _ScreenSpaceReflections: 1
- _ScreenSpaceReflectionsContributeTransparent: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 1
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &693259332561838588
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fcb9fd8f56eb8774bbb4d0c8be749c6e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,139 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LitDoor
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _ScreenSpaceReflections: 1
- _ScreenSpaceReflectionsContributeTransparent: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &5747619625072304454
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 67f45623e7d8aa7419d1d52f104bbf87
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,119 @@
fileFormatVersion: 2
guid: 4be43a77de0c665488b215960cd923ba
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -147,7 +147,7 @@ Material:
- _SrcBlend: 1 - _SrcBlend: 1
- _SrcBlendAlpha: 1 - _SrcBlendAlpha: 1
- _Surface: 0 - _Surface: 0
- _Tiling: 0.1 - _Tiling: 0.5
- _WorkflowMode: 1 - _WorkflowMode: 1
- _XRMotionVectorsPass: 1 - _XRMotionVectorsPass: 1
- _ZWrite: 1 - _ZWrite: 1
@@ -34,7 +34,7 @@ TextureImporter:
maxTextureSize: 2048 maxTextureSize: 2048
textureSettings: textureSettings:
serializedVersion: 2 serializedVersion: 2
filterMode: 1 filterMode: 0
aniso: 1 aniso: 1
mipBias: 0 mipBias: 0
wrapU: 0 wrapU: 0
@@ -16,14 +16,14 @@ MonoBehaviour:
spacing: 8 spacing: 8
ceilingDrop: -0.03 ceilingDrop: -0.03
rotationOffset: {x: 0, y: 0, z: 0} rotationOffset: {x: 0, y: 0, z: 0}
overrideLightParameters: 0 overrideLightParameters: 1
color: {r: 1, g: 1, b: 1, a: 1} color: {r: 0.9528302, g: 0.9500425, b: 0.92136884, a: 1}
intensity: 15 intensity: 2
range: 15 range: 15
shadows: 0 shadows: 0
bakeToRuntimeLightmap: 1 bakeToRuntimeLightmap: 1
disableRealtimeLightsAfterBake: 0 disableRealtimeLightsAfterBake: 0
lightmapResolution: 128 lightmapResolution: 512
ceilingBounceIntensity: 0.35 ceilingBounceIntensity: 0.3
bakedAmbientIntensity: 0.08 bakedAmbientIntensity: 0.7
cornerAOStrength: 0.6 cornerAOStrength: 0.4
@@ -17,13 +17,13 @@ MonoBehaviour:
ceilingDrop: -0.03 ceilingDrop: -0.03
rotationOffset: {x: -90, y: 0, z: 0} rotationOffset: {x: -90, y: 0, z: 0}
overrideLightParameters: 1 overrideLightParameters: 1
color: {r: 1, g: 1, b: 1, a: 1} color: {r: 0.9528302, g: 0.9500425, b: 0.92136884, a: 1}
intensity: 2 intensity: 2
range: 15 range: 15
shadows: 0 shadows: 0
bakeToRuntimeLightmap: 1 bakeToRuntimeLightmap: 1
disableRealtimeLightsAfterBake: 0 disableRealtimeLightsAfterBake: 0
lightmapResolution: 128 lightmapResolution: 512
ceilingBounceIntensity: 0.074 ceilingBounceIntensity: 0.3
bakedAmbientIntensity: 0.004 bakedAmbientIntensity: 0.7
cornerAOStrength: 0.111 cornerAOStrength: 0.4
+5 -5
View File
@@ -17,13 +17,13 @@ MonoBehaviour:
ceilingDrop: -0.03 ceilingDrop: -0.03
rotationOffset: {x: -90, y: 0, z: 0} rotationOffset: {x: -90, y: 0, z: 0}
overrideLightParameters: 1 overrideLightParameters: 1
color: {r: 1, g: 1, b: 1, a: 1} color: {r: 0.9528302, g: 0.9500425, b: 0.92136884, a: 1}
intensity: 2 intensity: 2
range: 15 range: 15
shadows: 0 shadows: 0
bakeToRuntimeLightmap: 1 bakeToRuntimeLightmap: 1
disableRealtimeLightsAfterBake: 0 disableRealtimeLightsAfterBake: 0
lightmapResolution: 128 lightmapResolution: 512
ceilingBounceIntensity: 0.074 ceilingBounceIntensity: 0.3
bakedAmbientIntensity: 0.004 bakedAmbientIntensity: 0.7
cornerAOStrength: 0.111 cornerAOStrength: 0.4
+13 -70
View File
@@ -2686,13 +2686,13 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 146683184} m_GameObject: {fileID: 146683184}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalRotation: {x: -0.98836154, y: 0, z: 0, w: 0.15212345}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -162.5, y: 0, z: 0}
--- !u!114 &146683187 --- !u!114 &146683187
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -13850,7 +13850,7 @@ MonoBehaviour:
lengthStartRoom: 10 lengthStartRoom: 10
lengthLiftRoom: 10 lengthLiftRoom: 10
widthLiftRoom: 5 widthLiftRoom: 5
lengthFloor: 100 lengthFloor: 200
corridorLength: 4 corridorLength: 4
corridorWigth: 3 corridorWigth: 3
minRoomCount: 10 minRoomCount: 10
@@ -13908,6 +13908,11 @@ MonoBehaviour:
planeBaseSize: 10 planeBaseSize: 10
wallHeight: 5 wallHeight: 5
colliderThickness: 0.2 colliderThickness: 0.2
doorPrefab: {fileID: 7011085542959660750, guid: 18981877707abf547842020ad7b50086, type: 3}
doorHeight: 3.8
lintelThickness: 0
doorRotationOffset: {x: 0, y: 180, z: 0}
doorPositionOffset: {x: 0, y: 0, z: 0}
--- !u!114 &740097208 --- !u!114 &740097208
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -19042,63 +19047,6 @@ PrefabInstance:
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 81044204068d943dd8e46160655d2108, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 81044204068d943dd8e46160655d2108, type: 3}
--- !u!1001 &978029648
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalPosition.x
value: 13.39975
objectReference: {fileID: 0}
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalPosition.z
value: 19.99045
objectReference: {fileID: 0}
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalRotation.x
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3746822541032507966, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6535836871367019504, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
propertyPath: m_Name
value: DoubleDoors
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 26401790c70e327479d4c08e53ba8cea, type: 3}
--- !u!1001 &979055499 --- !u!1001 &979055499
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -32446,7 +32394,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!114 &1706114974 --- !u!114 &1706114974
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -32483,7 +32431,7 @@ Light:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1706114973} m_GameObject: {fileID: 1706114973}
m_Enabled: 1 m_Enabled: 0
serializedVersion: 13 serializedVersion: 13
m_Type: 2 m_Type: 2
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
@@ -43184,14 +43132,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d9d6178191654e72a147db739b22275f, type: 3} m_Script: {fileID: 11500000, guid: d9d6178191654e72a147db739b22275f, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.PlayerUtils.PlayerCombat m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.PlayerUtils.PlayerCombat
damage: 25 canShoot: 1
fireRate: 0.12
weaponRange: 100
hitLayers: hitLayers:
serializedVersion: 2 serializedVersion: 2
m_Bits: 4294967295 m_Bits: 4294967295
isAutomatic: 1
recoilKick: 1.2
muzzleFlash: {fileID: 0} muzzleFlash: {fileID: 0}
impactPrefab: {fileID: 0} impactPrefab: {fileID: 0}
cameraPosition: {fileID: 5685763764745351606} cameraPosition: {fileID: 5685763764745351606}
@@ -43235,6 +43179,7 @@ MonoBehaviour:
moveSpeed: 10 moveSpeed: 10
sprintSpeed: 18 sprintSpeed: 18
crouchSpeed: 5 crouchSpeed: 5
canSlide: 1
slideInitialSpeed: 50 slideInitialSpeed: 50
slideDuration: 0.85 slideDuration: 0.85
slideFriction: 2.8 slideFriction: 2.8
@@ -43243,7 +43188,6 @@ MonoBehaviour:
groundAcceleration: 10 groundAcceleration: 10
airAcceleration: 30 airAcceleration: 30
airCap: 1.8 airCap: 1.8
showSpeedometer: 1
jumpHeight: 2 jumpHeight: 2
gravity: -27 gravity: -27
fallMultiplier: 2 fallMultiplier: 2
@@ -43295,7 +43239,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8184cc49f30946f4802bbf1bbe841e2f, type: 3} m_Script: {fileID: 11500000, guid: 8184cc49f30946f4802bbf1bbe841e2f, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.PlayerUtils.PlayerUI m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.PlayerUtils.PlayerUI
showSpeedometer: 1 showHUD: 1
--- !u!4 &5016588167603968964 stripped --- !u!4 &5016588167603968964 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 1672666446545052606, guid: 51510de34f82041149d25090ec962e10, type: 3} m_CorrespondingSourceObject: {fileID: 1672666446545052606, guid: 51510de34f82041149d25090ec962e10, type: 3}
@@ -45238,4 +45182,3 @@ SceneRoots:
- {fileID: 740097205} - {fileID: 740097205}
- {fileID: 552049569} - {fileID: 552049569}
- {fileID: 1706114976} - {fileID: 1706114976}
- {fileID: 978029648}
@@ -17,11 +17,11 @@ MonoBehaviour:
m_OverrideState: 0 m_OverrideState: 0
m_Value: 1 m_Value: 1
threshold: threshold:
m_OverrideState: 1 m_OverrideState: 0
m_Value: 1.48 m_Value: 1.48
intensity: intensity:
m_OverrideState: 1 m_OverrideState: 1
m_Value: 10.58 m_Value: 15
scatter: scatter:
m_OverrideState: 0 m_OverrideState: 0
m_Value: 0.727 m_Value: 0.727
@@ -29,8 +29,8 @@ MonoBehaviour:
m_OverrideState: 0 m_OverrideState: 0
m_Value: 65472 m_Value: 65472
tint: tint:
m_OverrideState: 0 m_OverrideState: 1
m_Value: {r: 1, g: 0.7311321, b: 0.7311321, a: 1} m_Value: {r: 1, g: 1, b: 1, a: 1}
highQualityFiltering: highQualityFiltering:
m_OverrideState: 0 m_OverrideState: 0
m_Value: 0 m_Value: 0
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: af2dacc7d53248c98287d3cde20c56bc
timeCreated: 1792605140
+212
View File
@@ -0,0 +1,212 @@
using UnityEngine;
namespace _Project.Scripts.PlayerUtils
{
[RequireComponent(typeof(Rigidbody), typeof(CapsuleCollider))]
public class EnemyAI : MonoBehaviour, IDamageable
{
[Header("Класс и Профиль Врага")]
public BodyClass enemyClass = BodyClass.Trooper;
[Tooltip("Если не назначен, сгенерируется автоматически под выбранный класс")]
public BodyProfile profile;
[Header("Настройки ИИ")]
[SerializeField] private float detectionRange = 30f;
[SerializeField] private float eyeHeight = 1.5f;
[SerializeField] private LayerMask obstacleMask = ~0;
public float CurrentHealth { get; private set; }
public bool IsDead { get; private set; }
// Можно вселяться в любого живого врага (или если у него осталось мало ХП — на твой выбор)
public bool CanBePossessed => !IsDead;
private Rigidbody _rb;
private Transform _playerTransform;
private float _fireTimer;
private float _strafeTimer;
private int _strafeDir = 1;
private LineRenderer _sniperLaser;
private void Awake()
{
_rb = GetComponent<Rigidbody>();
_rb.freezeRotation = true;
}
private void Start()
{
if (Player.Instance != null)
_playerTransform = Player.Instance.transform;
if (profile == null || profile.bodyClass != enemyClass)
{
profile = BodyProfile.CreateDefault(enemyClass);
}
CurrentHealth = profile.maxHealth;
if (enemyClass == BodyClass.Sniper && _sniperLaser == null)
{
SetupSniperLaser();
}
}
private void SetupSniperLaser()
{
_sniperLaser = gameObject.AddComponent<LineRenderer>();
_sniperLaser.startWidth = 0.02f;
_sniperLaser.endWidth = 0.02f;
_sniperLaser.material = new Material(Shader.Find("Sprites/Default"));
_sniperLaser.startColor = new Color(1f, 0f, 0f, 0.7f);
_sniperLaser.endColor = new Color(1f, 0f, 0f, 0.1f);
_sniperLaser.enabled = false;
}
private void Update()
{
if (IsDead || _playerTransform == null) return;
_fireTimer -= Time.deltaTime;
_strafeTimer -= Time.deltaTime;
if (_strafeTimer <= 0f)
{
_strafeDir = Random.value > 0.5f ? 1 : -1;
_strafeTimer = Random.Range(0.6f, 1.5f);
}
Vector3 eyePos = transform.position + Vector3.up * eyeHeight;
Vector3 targetPos = _playerTransform.position + Vector3.up * 1.0f;
Vector3 toPlayer = targetPos - eyePos;
float dist = toPlayer.magnitude;
if (dist > detectionRange || !HasLineOfSight(eyePos, targetPos, dist))
{
if (_sniperLaser != null) _sniperLaser.enabled = false;
return;
}
// Поворот лицом к игроку по горизонтали
Vector3 flatDir = new Vector3(toPlayer.x, 0f, toPlayer.z).normalized;
if (flatDir.sqrMagnitude > 0.001f)
{
transform.rotation = Quaternion.Slerp(
transform.rotation, Quaternion.LookRotation(flatDir), Time.deltaTime * 10f);
}
// Лазер снайпера виден за 0.5 сек до выстрела
if (_sniperLaser != null)
{
_sniperLaser.enabled = _fireTimer < 0.5f;
if (_sniperLaser.enabled)
{
_sniperLaser.SetPosition(0, eyePos);
_sniperLaser.SetPosition(1, targetPos);
}
}
// Стрельба по игроку
if (dist <= profile.weaponRange && _fireTimer <= 0f)
{
ShootAtPlayer(eyePos, toPlayer.normalized);
}
}
private void FixedUpdate()
{
if (IsDead || _playerTransform == null) return;
Vector3 eyePos = transform.position + Vector3.up * eyeHeight;
Vector3 targetPos = _playerTransform.position + Vector3.up * 1.0f;
Vector3 toPlayer = targetPos - eyePos;
float dist = toPlayer.magnitude;
if (dist > detectionRange || !HasLineOfSight(eyePos, targetPos, dist))
{
_rb.linearVelocity = new Vector3(0f, _rb.linearVelocity.y, 0f);
return;
}
Vector3 forward = new Vector3(toPlayer.x, 0f, toPlayer.z).normalized;
Vector3 right = Vector3.Cross(Vector3.up, forward);
Vector3 moveDir = Vector3.zero;
// Тактика передвижения зависит от класса!
switch (enemyClass)
{
case BodyClass.Scout:
// Агрессивно сближается зигзагами
if (dist > 3.5f) moveDir = (forward + right * (_strafeDir * 0.65f)).normalized;
else moveDir = right * _strafeDir;
break;
case BodyClass.Trooper:
// Держит среднюю дистанцию (8-14м) и стрейфит
if (dist > 14f) moveDir = forward + right * (_strafeDir * 0.3f);
else if (dist < 7f) moveDir = -forward + right * (_strafeDir * 0.5f);
else moveDir = right * _strafeDir;
moveDir.Normalize();
break;
case BodyClass.Juggernaut:
// Медленно и неотвратимо идёт напролом
if (dist > 4f) moveDir = forward;
break;
case BodyClass.Sniper:
// Держится далеко (отступает, если игрок ближе 15м)
if (dist < 15f) moveDir = -forward + right * (_strafeDir * 0.25f);
else if (dist > 28f) moveDir = forward;
moveDir.Normalize();
break;
}
Vector3 vel = moveDir * (profile.moveSpeed * 0.8f);
_rb.linearVelocity = new Vector3(vel.x, _rb.linearVelocity.y, vel.z);
}
private bool HasLineOfSight(Vector3 from, Vector3 to, float dist)
{
Vector3 dir = (to - from).normalized;
if (Physics.Raycast(from, dir, out RaycastHit hit, dist, obstacleMask, QueryTriggerInteraction.Ignore))
{
if (hit.transform == _playerTransform || hit.transform.root == _playerTransform)
return true;
return false;
}
return true;
}
private void ShootAtPlayer(Vector3 origin, Vector3 baseDir)
{
_fireTimer = profile.fireRate * 1.6f;
int pellets = Mathf.Max(1, profile.pelletsPerShot);
float spread = Mathf.Max(1.5f, profile.spreadAngle + 1.5f);
// Сдвигаем точку вылета чуть вперёд от глаз врага
Vector3 muzzlePos = origin + baseDir * 0.6f;
for (int i = 0; i < pellets; i++)
{
Vector3 dir = Quaternion.Euler(
Random.Range(-spread, spread),
Random.Range(-spread, spread), 0f) * baseDir;
Projectile.Spawn(muzzlePos, dir, profile, false, gameObject, obstacleMask);
}
}
public void TakeDamage(float amount)
{
if (IsDead) return;
CurrentHealth -= amount;
if (CurrentHealth <= 0f)
{
IsDead = true;
Destroy(gameObject);
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d49ace5afc784259b944f30ef5d3e613
timeCreated: 1792605144
@@ -0,0 +1,163 @@
using UnityEngine;
namespace _Project.Scripts.LevelGenerating
{
// =====================================================================
// Контроллер ДВОЙНОЙ двери (левая + правая створка).
// Сейчас сам создаёт Trigger-коллайдер и открывает створки при подходе игрока.
// Позже оркестратор сможет управлять дверью через Open(), Close() и SetLocked().
// =====================================================================
public class DoorController : MonoBehaviour
{
public enum OpenType
{
Sliding, // раздвижная: левая створка едет влево (-X), правая вправо (+X)
Rotating // распашная: створки поворачиваются на петлях в разные стороны
}
[Header("Створки двойной двери")]
[Tooltip("Левая створка двери")]
[SerializeField] private Transform leftWing;
[Tooltip("Правая створка двери")]
[SerializeField] private Transform rightWing;
[Header("Режим и скорость открытия")]
[SerializeField] private OpenType openType = OpenType.Sliding;
[SerializeField] private float openSpeed = 3.5f;
[Tooltip("Для Sliding: на сколько метров каждая створка отъезжает в свою сторону по локальной оси X")]
[SerializeField] private float slideDistance = 1f;
[Tooltip("Для Rotating: на какой угол (в градусах) распахивается каждая створка")]
[SerializeField] private float openAngle = 90f;
[Header("Авто-открытие (временно, до оркестратора)")]
[Tooltip("Выключи, когда дверями начнёт управлять оркестратор")]
[SerializeField] private bool autoOpenNearPlayer = true;
[SerializeField] private string playerTag = "Player";
[SerializeField] private Vector3 triggerSize = new Vector3(3.5f, 2.5f, 4.5f);
public bool IsOpen { get; private set; }
public bool IsLocked { get; private set; }
private Vector3 _leftClosedPos, _rightClosedPos;
private Quaternion _leftClosedRot, _rightClosedRot;
private int _playersInsideTrigger;
private void Awake()
{
// Если створки не назначены в инспекторе, пробуем найти первые два дочерних объекта автоматически
if (leftWing == null && transform.childCount > 0) leftWing = transform.GetChild(0);
if (rightWing == null && transform.childCount > 1) rightWing = transform.GetChild(1);
if (leftWing != null)
{
_leftClosedPos = leftWing.localPosition;
_leftClosedRot = leftWing.localRotation;
}
if (rightWing != null)
{
_rightClosedPos = rightWing.localPosition;
_rightClosedRot = rightWing.localRotation;
}
if (autoOpenNearPlayer)
{
SetupProximityTrigger();
}
}
private void SetupProximityTrigger()
{
var col = GetComponent<BoxCollider>();
if (col == null || !col.isTrigger)
{
var trigger = gameObject.AddComponent<BoxCollider>();
trigger.isTrigger = true;
trigger.size = triggerSize;
trigger.center = new Vector3(0f, triggerSize.y / 2f, 0f);
}
}
private void Update()
{
if (openType == OpenType.Sliding)
{
// Левая створка едет в -X, правая в +X
if (leftWing != null)
{
Vector3 targetL = IsOpen ? _leftClosedPos + Vector3.left * slideDistance : _leftClosedPos;
leftWing.localPosition = Vector3.MoveTowards(
leftWing.localPosition, targetL, openSpeed * Time.deltaTime);
}
if (rightWing != null)
{
Vector3 targetR = IsOpen ? _rightClosedPos + Vector3.right * slideDistance : _rightClosedPos;
rightWing.localPosition = Vector3.MoveTowards(
rightWing.localPosition, targetR, openSpeed * Time.deltaTime);
}
}
else // Rotating
{
float rotSpeed = openSpeed * 60f * Time.deltaTime;
if (leftWing != null)
{
Quaternion targetL = IsOpen
? _leftClosedRot * Quaternion.Euler(0f, -openAngle, 0f)
: _leftClosedRot;
leftWing.localRotation = Quaternion.RotateTowards(leftWing.localRotation, targetL, rotSpeed);
}
if (rightWing != null)
{
Quaternion targetR = IsOpen
? _rightClosedRot * Quaternion.Euler(0f, openAngle, 0f)
: _rightClosedRot;
rightWing.localRotation = Quaternion.RotateTowards(rightWing.localRotation, targetR, rotSpeed);
}
}
}
// ---------- API для будущего Оркестратора ----------
public void Open()
{
if (IsLocked) return;
IsOpen = true;
}
public void Close() => IsOpen = false;
public void SetLocked(bool locked)
{
IsLocked = locked;
if (locked) Close();
}
// ---------- Триггер приближения игрока ----------
private void OnTriggerEnter(Collider other)
{
if (!autoOpenNearPlayer || !IsPlayer(other)) return;
_playersInsideTrigger++;
Open();
}
private void OnTriggerExit(Collider other)
{
if (!autoOpenNearPlayer || !IsPlayer(other)) return;
_playersInsideTrigger = Mathf.Max(0, _playersInsideTrigger - 1);
if (_playersInsideTrigger == 0) Close();
}
private bool IsPlayer(Collider col)
{
if (col.CompareTag(playerTag)) return true;
if (col.transform.root.CompareTag(playerTag)) return true;
return col.name.Contains("Player") || col.transform.root.name.Contains("Player");
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5850387c1f4a4054bb33e19563ddb215
timeCreated: 1792595120
@@ -5,54 +5,38 @@ namespace _Project.Scripts.LevelGenerating
{ {
public enum FloorKind public enum FloorKind
{ {
Generated, // обычный этаж: раскладка -> роли -> стены -> наполнение Generated,
Special // готовая локация (крыша с боссом), собрана вручную, генератор не нужен Special
} }
// =====================================================================
// Данные ОДНОГО этажа. Заменяет статический LevelManager.Rooms.
// Все координаты и размеры комнат - в МОДУЛЯХ (1 модуль = 0.5 м), см. LevelGrid.
//
// НЕ ЗАБЫТЬ:
// - Для сохранения в файл этот класс НЕ годится напрямую: Room использует свойства,
// которые JsonUtility не сериализует. Для диска нужны отдельные структуры (FloorSave)
// с публичными полями, а FloorData остаётся рабочим объектом генерации.
// - Parent / CorridorOf живут в WallsGenerator (нужны только при генерации раскладки).
// =====================================================================
public class FloorData public class FloorData
{ {
public int Index; // номер этажа (0-based) public int Index;
public FloorKind Kind; public FloorKind Kind;
public int Seed; // пока не используется (сид "пох"), поле на будущее public int Seed;
public string SpecialId; // для Special: id префаба локации, например "BossRoof" public string SpecialId;
public int SizeModules; // сторона карты этажа в модулях (для Generated) public int SizeModules;
public readonly List<Room> Rooms = new List<Room>(); public readonly List<Room> Rooms = new List<Room>();
public readonly Dictionary<Room, int> Depth = new Dictionary<Room, int>(); public readonly Dictionary<Room, int> Depth = new Dictionary<Room, int>();
// Отрезки стен (заполняет ShellBuilder.Build) // Отрезки стен и дверные проёмы (заполняет ShellBuilder.Build)
public readonly List<WallRun> Walls = new List<WallRun>(); public readonly List<WallRun> Walls = new List<WallRun>();
public readonly List<Doorway> Doorways = new List<Doorway>();
public Room Start; // стартовая комната (вход с предыдущего этажа) public Room Start;
public Room Lift; // комната с лифтом (выход на следующий этаж) public Room Lift;
// ---------- Выборки ---------- // ---------- Выборки ----------
public IEnumerable<Room> Corridors => Rooms.Where(r => r.rt == RoomType.Corridor); public IEnumerable<Room> Corridors => Rooms.Where(r => r.rt == RoomType.Corridor);
// Всё, кроме коридоров (старт, лифт и обычные комнаты)
public IEnumerable<Room> PlayableRooms => Rooms.Where(r => r.rt != RoomType.Corridor); public IEnumerable<Room> PlayableRooms => Rooms.Where(r => r.rt != RoomType.Corridor);
// Комнаты, которым ещё не назначена роль
public IEnumerable<Room> UnassignedRooms => Rooms.Where(r => r.rt == RoomType.Undefined); public IEnumerable<Room> UnassignedRooms => Rooms.Where(r => r.rt == RoomType.Undefined);
public IEnumerable<Room> OfType(RoomType type) => Rooms.Where(r => r.rt == type); public IEnumerable<Room> OfType(RoomType type) => Rooms.Where(r => r.rt == type);
public int GetDepth(Room room) => Depth.TryGetValue(room, out int d) ? d : -1; public int GetDepth(Room room) => Depth.TryGetValue(room, out int d) ? d : -1;
// ---------- Изменение ---------- // ---------- Изменение ----------
// Добавить комнату (не коридор) вместе с глубиной
public void AddRoom(Room room, int depth) public void AddRoom(Room room, int depth)
{ {
Rooms.Add(room); Rooms.Add(room);
@@ -62,7 +46,6 @@ namespace _Project.Scripts.LevelGenerating
else if (room.rt == RoomType.Lift) Lift = room; else if (room.rt == RoomType.Lift) Lift = room;
} }
// Коридоры глубины не имеют
public void AddCorridor(Room corridor) => Rooms.Add(corridor); public void AddCorridor(Room corridor) => Rooms.Add(corridor);
public void Remove(Room room) public void Remove(Room room)
@@ -78,6 +61,7 @@ namespace _Project.Scripts.LevelGenerating
Rooms.Clear(); Rooms.Clear();
Depth.Clear(); Depth.Clear();
Walls.Clear(); Walls.Clear();
Doorways.Clear();
Start = null; Start = null;
Lift = null; Lift = null;
} }
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using _Project.Scripts.PlayerUtils;
using UnityEngine;
namespace _Project.Scripts.LevelGenerating
{
[Serializable]
public class EnemySpawnEntry
{
public BodyClass enemyClass = BodyClass.Trooper;
[Tooltip("Кастомный префаб этого класса. Если пусто — возьмётся общий префаб или создастся капсула.")]
public GameObject customPrefab;
[Tooltip("Вес (шанс) выбора этого класса относительно других в списке")]
[Min(1f)] public float weight = 10f;
}
// =====================================================================
// Конфиг спавна врагов для темы комнаты (RoomTheme).
// Создаётся: ПКМ -> Create -> Level -> Room Enemy Spawn Config.
// =====================================================================
[CreateAssetMenu(menuName = "Level/Room Enemy Spawn Config", fileName = "RoomEnemySpawnConfig")]
public class RoomEnemySpawnConfig : ScriptableObject
{
[Header("Количество врагов в комнате")]
[Min(0)] public int minEnemies = 2;
[Min(0)] public int maxEnemies = 4;
[Tooltip("Добавлять +1 врага за каждые N кв. метров площади (0 = не зависит от размера комнаты)")]
[Min(0f)] public float extraEnemyPerArea = 35f;
[Tooltip("Отступ от стен при спавне врагов (в метрах)")]
[Min(1f)] public float wallMargin = 2f;
[Header("Префаб по умолчанию")]
[Tooltip("Если не назначен — генератор сам соберёт работающую капсулу с EnemyAI!")]
public GameObject defaultEnemyPrefab;
[Header("Пул классов для этой комнаты")]
public List<EnemySpawnEntry> enemyPool = new List<EnemySpawnEntry>
{
new EnemySpawnEntry { enemyClass = BodyClass.Scout, weight = 25f },
new EnemySpawnEntry { enemyClass = BodyClass.Trooper, weight = 45f },
new EnemySpawnEntry { enemyClass = BodyClass.Juggernaut, weight = 15f },
new EnemySpawnEntry { enemyClass = BodyClass.Sniper, weight = 15f }
};
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 543780e1d0e842ca96364a1f94696107
timeCreated: 1792605497
@@ -1,21 +1,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using _Project.Scripts.PlayerUtils;
using UnityEngine; using UnityEngine;
namespace _Project.Scripts.LevelGenerating namespace _Project.Scripts.LevelGenerating
{ {
// =====================================================================
// Генератор, который оформляет одну комнату после того, как построены её меши.
// Специальные комнаты (лифт, старт) получают свои реализации,
// обычные - универсальный ThemedRoomGenerator.
// =====================================================================
public interface IRoomGenerator public interface IRoomGenerator
{ {
bool Supports(Room room); bool Supports(Room room);
void Generate(RoomView view, FloorData floor, RoomTheme theme); void Generate(RoomView view, FloorData floor, RoomTheme theme);
} }
// Универсальный генератор: материалы из темы и сетка светильников под потолком.
// Позже сюда добавится расстановка предметов по правилам темы.
public class ThemedRoomGenerator : IRoomGenerator public class ThemedRoomGenerator : IRoomGenerator
{ {
public bool Supports(Room room) => true; public bool Supports(Room room) => true;
@@ -35,17 +29,21 @@ namespace _Project.Scripts.LevelGenerating
if (theme.lightConfig != null) if (theme.lightConfig != null)
{ {
CreateLights(view, theme.lightConfig); CreateLights(view, theme.lightConfig);
RuntimeRoomLightmapBaker.BakeRoom(view, theme.lightConfig); // <-- ЗАПЕКАЕМ СВЕТ НА ЛЕТУ! RuntimeRoomLightmapBaker.BakeRoom(view, theme.lightConfig);
}
if (theme.spawnEnemies)
{
SpawnEnemies(view, floor, theme.enemyConfig);
} }
} }
private static void ApplyMaterial(List<Renderer> renderers, Material mat) private static void ApplyMaterial(List<Renderer> renderers, Material mat)
{ {
if (mat == null) return; // остаётся материал префаба if (mat == null) return;
foreach (var r in renderers) r.sharedMaterial = mat; foreach (var r in renderers) r.sharedMaterial = mat;
} }
// Сетка светильников: спавнит префаб из RoomLightConfig и применяет параметры
private static void CreateLights(RoomView view, RoomLightConfig config) private static void CreateLights(RoomView view, RoomLightConfig config)
{ {
Vector3 size = view.SizeMeters; Vector3 size = view.SizeMeters;
@@ -79,7 +77,6 @@ namespace _Project.Scripts.LevelGenerating
} }
else else
{ {
// Запасной вариант, если префаб забыли назначить в SO
lightGo = new GameObject($"FallbackLight_{ix}_{iz}"); lightGo = new GameObject($"FallbackLight_{ix}_{iz}");
lightGo.transform.SetParent(lightsRoot, false); lightGo.transform.SetParent(lightsRoot, false);
lightGo.transform.SetPositionAndRotation(pos, rot); lightGo.transform.SetPositionAndRotation(pos, rot);
@@ -87,7 +84,6 @@ namespace _Project.Scripts.LevelGenerating
fallbackLight.type = LightType.Point; fallbackLight.type = LightType.Point;
} }
// Если включена перезапись параметров (или сработал запасной вариант без префаба)
if (config.overrideLightParameters || config.lightPrefab == null) if (config.overrideLightParameters || config.lightPrefab == null)
{ {
var lights = lightGo.GetComponentsInChildren<Light>(true); var lights = lightGo.GetComponentsInChildren<Light>(true);
@@ -102,5 +98,223 @@ namespace _Project.Scripts.LevelGenerating
} }
} }
} }
// ---------- ГЕНЕРАЦИЯ ВРАГОВ В КОМНАТЕ ----------
private static void SpawnEnemies(RoomView view, FloorData floor, RoomEnemySpawnConfig config)
{
RoomType rt = view.Data.rt;
// В коридорах и в лифте врагов не спавним
if (rt == RoomType.Corridor || rt == RoomType.Lift || rt == RoomType.Undefined)
return;
Vector3 size = view.SizeMeters;
Vector3 origin = view.OriginMeters;
float area = size.x * size.z;
int count;
if (rt == RoomType.Start)
{
// В стартовой комнате ставим 1 врага (первый носитель, в которого игрок может сразу вселиться Духом)
count = 1;
}
else if (config != null)
{
int baseCount = Random.Range(config.minEnemies, config.maxEnemies + 1);
int areaBonus = config.extraEnemyPerArea > 0f ? Mathf.FloorToInt(area / config.extraEnemyPerArea) : 0;
count = baseCount + areaBonus;
}
else
{
// Авто-расчёт по площади комнаты и глубине (чем дальше от старта, тем больше охрана)
int depth = Mathf.Max(1, floor.GetDepth(view.Data));
int min = Mathf.Clamp(1 + depth / 2, 1, 3);
int max = Mathf.Clamp(2 + Mathf.FloorToInt(area / 30f), min, 6);
count = Random.Range(min, max + 1);
}
if (count <= 0) return;
var enemiesRoot = new GameObject("Enemies").transform;
enemiesRoot.SetParent(view.transform, false);
float margin = config != null ? config.wallMargin : 2f;
float minX = origin.x + Mathf.Min(margin, size.x * 0.35f);
float maxX = origin.x + size.x - Mathf.Min(margin, size.x * 0.35f);
float minZ = origin.z + Mathf.Min(margin, size.z * 0.35f);
float maxZ = origin.z + size.z - Mathf.Min(margin, size.z * 0.35f);
var spawnedPositions = new List<Vector3>();
for (int i = 0; i < count; i++)
{
BodyClass chosenClass = rt == RoomType.Start
? BodyClass.Trooper // На старте всегда даём сбалансированного Штурмовика (или Скаута)
: PickClass(rt, config);
Vector3 spawnPos = FindSpawnPosition(minX, maxX, minZ, maxZ, view.CenterMeters, rt == RoomType.Start, spawnedPositions);
spawnedPositions.Add(spawnPos);
GameObject prefab = ResolveEnemyPrefab(chosenClass, config);
EnemyAI enemy = CreateEnemyInstance(prefab, chosenClass, spawnPos, enemiesRoot, i);
view.Enemies.Add(enemy);
}
}
// Подбирает точку спавна в комнате так, чтобы враги не слипались друг с другом
// и не спавнились прямо на голове игрока в Start-комнате
private static Vector3 FindSpawnPosition(float minX, float maxX, float minZ, float maxZ,
Vector3 roomCenter, bool isStartRoom, List<Vector3> occupied)
{
for (int attempt = 0; attempt < 15; attempt++)
{
Vector3 candidate = new Vector3(
Random.Range(minX, maxX),
0.1f,
Random.Range(minZ, maxZ));
// В стартовой комнате игрок падает в центр, поэтому врага ставим чуть поодаль от центра
if (isStartRoom && Vector2.Distance(new Vector2(candidate.x, candidate.z), new Vector2(roomCenter.x, roomCenter.z)) < 2.5f)
continue;
bool tooClose = false;
foreach (var pos in occupied)
{
if ((candidate - pos).sqrMagnitude < 3.0f) // минимум ~1.7м между врагами
{
tooClose = true;
break;
}
}
if (!tooClose) return candidate;
}
return new Vector3(Random.Range(minX, maxX), 0.1f, Random.Range(minZ, maxZ));
}
// Выбирает класс врага из конфига ИЛИ автоматически по смыслу комнаты (RoomType)
private static BodyClass PickClass(RoomType roomType, RoomEnemySpawnConfig config)
{
if (config != null && config.enemyPool != null && config.enemyPool.Count > 0)
{
float totalWeight = 0f;
foreach (var e in config.enemyPool) totalWeight += e.weight;
float roll = Random.Range(0f, totalWeight);
float cursor = 0f;
foreach (var e in config.enemyPool)
{
cursor += e.weight;
if (roll <= cursor) return e.enemyClass;
}
return config.enemyPool[0].enemyClass;
}
// Умное распределение классов по ролям комнат по умолчанию:
float r = Random.value;
switch (roomType)
{
case RoomType.Storage:
case RoomType.BoilerRoom:
case RoomType.SwitchboardRoom:
// Узкие технические комнаты: много Джаггернаутов (35%) и быстрых Скаутов (40%)
if (r < 0.35f) return BodyClass.Juggernaut;
if (r < 0.75f) return BodyClass.Scout;
return BodyClass.Trooper;
case RoomType.Penthouse:
case RoomType.Laboratory:
// Просторные/чистые залы: Снайперы (35%), Штурмовики (45%), Скауты (20%)
if (r < 0.35f) return BodyClass.Sniper;
if (r < 0.80f) return BodyClass.Trooper;
return BodyClass.Scout;
default: // Office и остальные
// Офисы: в основном Штурмовики (45%) и Скауты (30%), реже Снайпер (15%) и Джаггернаут (10%)
if (r < 0.45f) return BodyClass.Trooper;
if (r < 0.75f) return BodyClass.Scout;
if (r < 0.90f) return BodyClass.Sniper;
return BodyClass.Juggernaut;
}
}
private static GameObject ResolveEnemyPrefab(BodyClass cls, RoomEnemySpawnConfig config)
{
if (config == null) return null;
if (config.enemyPool != null)
{
foreach (var entry in config.enemyPool)
{
if (entry.enemyClass == cls && entry.customPrefab != null)
return entry.customPrefab;
}
}
return config.defaultEnemyPrefab;
}
// Спавнит префаб врага ИЛИ автоматически собирает боевую капсулу нужного размера и цвета, если префаб ещё не сделан!
private static EnemyAI CreateEnemyInstance(GameObject prefab, BodyClass cls, Vector3 pos, Transform parent, int index)
{
Quaternion rot = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f);
GameObject go;
if (prefab != null)
{
go = Object.Instantiate(prefab, pos, rot, parent);
}
else
{
// Авто-сборка капсулы врага (чтобы можно было играть сразу без готовых 3D-моделей!)
go = GameObject.CreatePrimitive(PrimitiveType.Capsule);
go.transform.SetParent(parent, false);
// Подгоняем размер и цвет капсулы под класс врага, чтобы игрок сразу различал их визуально!
Vector3 scale = Vector3.one;
Color classColor = Color.blue;
switch (cls)
{
case BodyClass.Scout:
scale = new Vector3(0.85f, 0.9f, 0.85f);
classColor = new Color(1f, 0.85f, 0.1f); // Жёлтый (быстрый)
break;
case BodyClass.Trooper:
scale = new Vector3(1f, 1f, 1f);
classColor = new Color(0.2f, 0.5f, 1f); // Синий (штурмовик)
break;
case BodyClass.Juggernaut:
scale = new Vector3(1.35f, 1.25f, 1.35f); // Крупный высокий танк
classColor = new Color(0.9f, 0.15f, 0.15f); // Красный
break;
case BodyClass.Sniper:
scale = new Vector3(0.9f, 1.05f, 0.9f);
classColor = new Color(0.75f, 0.2f, 1f); // Фиолетовый (снайпер)
break;
}
go.transform.localScale = scale;
// Поднимаем капсулу так, чтобы её низ стоял ровно на полу (Y = 0)
go.transform.SetPositionAndRotation(pos + Vector3.up * scale.y, rot);
var renderer = go.GetComponent<Renderer>();
if (renderer != null)
{
renderer.material.color = classColor;
}
}
go.name = $"Enemy_{index}_{cls}";
var ai = go.GetComponent<EnemyAI>();
if (ai == null) ai = go.AddComponent<EnemyAI>();
ai.enemyClass = cls;
ai.profile = BodyProfile.CreateDefault(cls);
return ai;
}
} }
} }
@@ -2,11 +2,6 @@
namespace _Project.Scripts.LevelGenerating namespace _Project.Scripts.LevelGenerating
{ {
// =====================================================================
// Набор оформления комнаты: материалы, конфиг освещения и пропсы.
// Создаётся в проекте: ПКМ -> Create -> Level -> Room Theme.
// Новая тема - это новые данные, код не меняется.
// =====================================================================
[CreateAssetMenu(menuName = "Level/Room Theme", fileName = "RoomTheme")] [CreateAssetMenu(menuName = "Level/Room Theme", fileName = "RoomTheme")]
public class RoomTheme : ScriptableObject public class RoomTheme : ScriptableObject
{ {
@@ -19,6 +14,12 @@ namespace _Project.Scripts.LevelGenerating
[Tooltip("Конфиг света с префабом и настройками. Если пусто — света в комнате не будет.")] [Tooltip("Конфиг света с префабом и настройками. Если пусто — света в комнате не будет.")]
public RoomLightConfig lightConfig; public RoomLightConfig lightConfig;
[Header("Враги")]
[Tooltip("Спавнить ли врагов в этой комнате (для Коридоров и Лифта выключается автоматически)")]
public bool spawnEnemies = true;
[Tooltip("Опциональный конфиг спавна. Если пусто — классы врагов подберутся автоматически под тип комнаты!")]
public RoomEnemySpawnConfig enemyConfig;
[Header("Предметы (опционально)")] [Header("Предметы (опционально)")]
public RoomPropSet propSet; public RoomPropSet propSet;
} }
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using _Project.Scripts.PlayerUtils;
using UnityEngine; using UnityEngine;
namespace _Project.Scripts.LevelGenerating namespace _Project.Scripts.LevelGenerating
@@ -12,8 +13,9 @@ namespace _Project.Scripts.LevelGenerating
public readonly List<Renderer> FloorRenderers = new List<Renderer>(); public readonly List<Renderer> FloorRenderers = new List<Renderer>();
public readonly List<Renderer> CeilingRenderers = new List<Renderer>(); public readonly List<Renderer> CeilingRenderers = new List<Renderer>();
public readonly List<Renderer> WallRenderers = new List<Renderer>(); public readonly List<Renderer> WallRenderers = new List<Renderer>();
//public readonly List<DoorController> Doors = new List<DoorController>(); public readonly List<DoorController> Doors = new List<DoorController>();
public readonly List<RenderTexture> BakedLightmaps = new List<RenderTexture>(); public readonly List<EnemyAI> Enemies = new List<EnemyAI>();
public List<RenderTexture> BakedLightmaps = new List<RenderTexture>();
public Vector3 OriginMeters => public Vector3 OriginMeters =>
new Vector3(Data.Position.x * LevelGrid.Module, 0f, Data.Position.y * LevelGrid.Module); new Vector3(Data.Position.x * LevelGrid.Module, 0f, Data.Position.y * LevelGrid.Module);
@@ -28,7 +30,11 @@ namespace _Project.Scripts.LevelGenerating
{ {
foreach (var rt in BakedLightmaps) foreach (var rt in BakedLightmaps)
{ {
if (rt != null) rt.Release(); if (rt != null)
{
rt.Release();
Destroy(rt);
}
} }
BakedLightmaps.Clear(); BakedLightmaps.Clear();
} }
@@ -19,7 +19,25 @@ namespace _Project.Scripts.LevelGenerating
public static void BakeRoom(RoomView view, RoomLightConfig config) public static void BakeRoom(RoomView view, RoomLightConfig config)
{ {
if (config == null || !config.bakeToRuntimeLightmap) return; var targets = new List<Renderer>();
targets.AddRange(view.FloorRenderers);
targets.AddRange(view.CeilingRenderers);
targets.AddRange(view.WallRenderers);
// Если запекание ВЫКЛЮЧЕНО в конфиге — сбрасываем лайтмапу в чёрный цвет (выключаем фейковый Emission),
// чтобы ты сразу видел разницу!
if (config == null || !config.bakeToRuntimeLightmap)
{
var resetBlock = new MaterialPropertyBlock();
foreach (var r in targets)
{
if (r == null) continue;
r.GetPropertyBlock(resetBlock);
resetBlock.SetTexture(LightmapTexProp, Texture2D.blackTexture);
r.SetPropertyBlock(resetBlock);
}
return;
}
if (_bakeMaterial == null) if (_bakeMaterial == null)
{ {
@@ -80,10 +98,7 @@ namespace _Project.Scripts.LevelGenerating
rMin.y)); rMin.y));
// 3. Собираем все рендереры комнаты (пол, потолок, стены) // 3. Собираем все рендереры комнаты (пол, потолок, стены)
var targets = new List<Renderer>();
targets.AddRange(view.FloorRenderers);
targets.AddRange(view.CeilingRenderers);
targets.AddRange(view.WallRenderers);
var cmd = new CommandBuffer { name = $"BakeRoom_{view.Index}" }; var cmd = new CommandBuffer { name = $"BakeRoom_{view.Index}" };
var mpb = new MaterialPropertyBlock(); var mpb = new MaterialPropertyBlock();
@@ -108,6 +123,10 @@ namespace _Project.Scripts.LevelGenerating
// Назначаем напрямую в инстанс материала (100% работает с любым Shader Graph и SRP Batcher!) // Назначаем напрямую в инстанс материала (100% работает с любым Shader Graph и SRP Batcher!)
r.material.SetTexture(LightmapTexProp, rt); r.material.SetTexture(LightmapTexProp, rt);
r.GetPropertyBlock(mpb);
mpb.SetTexture(LightmapTexProp, rt);
r.SetPropertyBlock(mpb);
} }
// Выполняем запекание на GPU мгновенно // Выполняем запекание на GPU мгновенно
@@ -115,12 +134,19 @@ namespace _Project.Scripts.LevelGenerating
cmd.Release(); cmd.Release();
// 4. САМОЕ ГЛАВНОЕ ДЛЯ FPS: Выключаем реальные источники света после запекания! // 4. САМОЕ ГЛАВНОЕ ДЛЯ FPS: Выключаем реальные источники света после запекания!
if (config.disableRealtimeLightsAfterBake) int bakedShellMask = LayerMask.GetMask("Ground", "Ceiling", "Wall");
foreach (var l in lights)
{ {
foreach (var l in lights) // Убираем запечённые стены, пол и потолок из Culling Mask лампы
l.cullingMask &= ~bakedShellMask;
// Если включена галочка оптимизации в конфиге — убираем дорогие тени
if (config.disableRealtimeLightsAfterBake)
{ {
l.enabled = false; l.shadows = LightShadows.None;
} }
} }
} }
} }
@@ -3,14 +3,8 @@ using UnityEngine;
namespace _Project.Scripts.LevelGenerating namespace _Project.Scripts.LevelGenerating
{ {
// Куда смотрит видимая сторона стены (внутрь комнаты или коридора)
public enum WallFacing { XP, XN, ZP, ZN } public enum WallFacing { XP, XN, ZP, ZN }
// Прямой отрезок стены по линии сетки (координаты в модулях).
// Start - точка на линии сетки, с которой отрезок начинается.
// Для ZP/ZN отрезок идёт вдоль +X, для XP/XN - вдоль +Z.
// RoomIndex - индекс комнаты в FloorData.Rooms, которой принадлежит стена.
// Поля публичные, чтобы потом сохранять в файл.
[System.Serializable] [System.Serializable]
public struct WallRun public struct WallRun
{ {
@@ -28,26 +22,38 @@ namespace _Project.Scripts.LevelGenerating
} }
} }
// ===================================================================== // Дверной проём в стене (для перемычки над дверью и спавна самой двойной двери)
// Строит отрезки стен из FloorData. Спавна здесь нет, только данные. [System.Serializable]
// public struct Doorway
// Правила: {
// - Стена стоит на границе прямоугольника комнаты (плоскость без толщины). public Vector2Int Start;
// - У коридора стены только по двум длинным сторонам, торцы открыты. public int Length;
// - В стенах комнат вырезаются проёмы шириной ровно с коридор. public WallFacing Facing;
// - Каждый отрезок помнит комнату-владельца (RoomIndex). public int RoomIndex;
// ===================================================================== public bool SpawnDoor;
public Doorway(Vector2Int start, int length, WallFacing facing, int roomIndex, bool spawnDoor)
{
Start = start;
Length = length;
Facing = facing;
RoomIndex = roomIndex;
SpawnDoor = spawnDoor;
}
}
public static class ShellBuilder public static class ShellBuilder
{ {
private struct Gap private struct Gap
{ {
public bool Vertical; // линия x = Line (вертикальная), иначе z = Line public bool Vertical;
public int Line, From, To; public int Line, From, To;
} }
public static void Build(FloorData floor) public static void Build(FloorData floor)
{ {
floor.Walls.Clear(); floor.Walls.Clear();
floor.Doorways.Clear();
var gaps = CollectGaps(floor); var gaps = CollectGaps(floor);
for (int i = 0; i < floor.Rooms.Count; i++) for (int i = 0; i < floor.Rooms.Count; i++)
@@ -58,16 +64,22 @@ namespace _Project.Scripts.LevelGenerating
if (r.rt == RoomType.Corridor) if (r.rt == RoomType.Corridor)
{ {
// у коридора проёмов нет, его торцы просто открыты // Длинные стороны коридора — стены, а на торцах — перемычки над дверью (обращённые внутрь коридора)
if (IsAlongX(r)) if (IsAlongX(r))
{ {
AddSide(floor, i, false, z0, x0, x1, WallFacing.ZP, null); AddSide(floor, i, false, z0, x0, x1, WallFacing.ZP, null);
AddSide(floor, i, false, z1, x0, x1, WallFacing.ZN, null); AddSide(floor, i, false, z1, x0, x1, WallFacing.ZN, null);
AddDoorway(floor, i, true, x0, z0, z1, WallFacing.XP, false);
AddDoorway(floor, i, true, x1, z0, z1, WallFacing.XN, false);
} }
else else
{ {
AddSide(floor, i, true, x0, z0, z1, WallFacing.XP, null); AddSide(floor, i, true, x0, z0, z1, WallFacing.XP, null);
AddSide(floor, i, true, x1, z0, z1, WallFacing.XN, null); AddSide(floor, i, true, x1, z0, z1, WallFacing.XN, null);
AddDoorway(floor, i, false, z0, x0, x1, WallFacing.ZP, false);
AddDoorway(floor, i, false, z1, x0, x1, WallFacing.ZN, false);
} }
} }
else else
@@ -80,7 +92,6 @@ namespace _Project.Scripts.LevelGenerating
} }
} }
// Коридор идёт вдоль X, если его выход по оси X (запасной вариант: длинная сторона)
private static bool IsAlongX(Room c) private static bool IsAlongX(Room c)
{ {
if (c.exits != null && c.exits.Count > 0) if (c.exits != null && c.exits.Count > 0)
@@ -88,7 +99,6 @@ namespace _Project.Scripts.LevelGenerating
return c.Length >= c.Width; return c.Length >= c.Width;
} }
// Места, где коридор упирается в стены комнат
private static List<Gap> CollectGaps(FloorData floor) private static List<Gap> CollectGaps(FloorData floor)
{ {
var gaps = new List<Gap>(); var gaps = new List<Gap>();
@@ -112,7 +122,6 @@ namespace _Project.Scripts.LevelGenerating
return gaps; return gaps;
} }
// Добавляет сторону [from, to] на линии line, вырезая проёмы
private static void AddSide(FloorData floor, int owner, bool vertical, int line, int from, int to, private static void AddSide(FloorData floor, int owner, bool vertical, int line, int from, int to,
WallFacing facing, List<Gap> gaps) WallFacing facing, List<Gap> gaps)
{ {
@@ -129,6 +138,13 @@ namespace _Project.Scripts.LevelGenerating
foreach (var g in own) foreach (var g in own)
{ {
if (g.From > cursor) AddRun(floor, owner, vertical, line, cursor, g.From, facing); if (g.From > cursor) AddRun(floor, owner, vertical, line, cursor, g.From, facing);
// Записываем проём для перемычки и двери
int gapStart = Mathf.Max(cursor, g.From);
int gapEnd = Mathf.Min(to, g.To);
if (gapEnd > gapStart)
AddDoorway(floor, owner, vertical, line, gapStart, gapEnd, facing, true);
cursor = Mathf.Max(cursor, g.To); cursor = Mathf.Max(cursor, g.To);
} }
} }
@@ -142,5 +158,12 @@ namespace _Project.Scripts.LevelGenerating
Vector2Int start = vertical ? new Vector2Int(line, a) : new Vector2Int(a, line); Vector2Int start = vertical ? new Vector2Int(line, a) : new Vector2Int(a, line);
floor.Walls.Add(new WallRun(start, b - a, facing, owner)); floor.Walls.Add(new WallRun(start, b - a, facing, owner));
} }
private static void AddDoorway(FloorData floor, int owner, bool vertical, int line, int a, int b,
WallFacing facing, bool spawnDoor)
{
Vector2Int start = vertical ? new Vector2Int(line, a) : new Vector2Int(a, line);
floor.Doorways.Add(new Doorway(start, b - a, facing, owner, spawnDoor));
}
} }
} }
@@ -6,24 +6,10 @@ namespace _Project.Scripts.LevelGenerating
public class ShellResult public class ShellResult
{ {
public Transform Root; public Transform Root;
public List<RoomView> Views = new List<RoomView>(); // индекс совпадает с FloorData.Rooms public List<RoomView> Views = new List<RoomView>();
public List<DoorController> AllDoors = new List<DoorController>();
} }
// =====================================================================
// Спавнит пол, потолок и стены из одного префаба-плоскости.
// Для каждой комнаты создаётся объект Room_N_Тип с компонентом RoomView.
// Материалы здесь НЕ назначаются: этим занимаются генераторы комнат (RoomTheme).
//
// Требования к префабу:
// - Unity Plane (3D Object -> Plane): лежит в XZ, нормаль +Y, размер 10x10 при scale 1.
// Если размер другой (например 1x1), поменяй planeBaseSize. Quad не подойдёт: у него нормаль -Z.
// - Меш и Renderer на корне префаба. Коллайдеры на префабе игнорируются и заменяются на Box.
//
// Все плоскости видны только с одной стороны (внутрь комнаты):
// стены смотрят внутрь, пол вверх, потолок вниз.
//
// НЕ ЗАБЫТЬ: сейчас сюда попадает и комната лифта. Позже у неё будет свой фиксированный префаб.
// =====================================================================
public class ShellSpawner : MonoBehaviour public class ShellSpawner : MonoBehaviour
{ {
[SerializeField] private GameObject planePrefab; [SerializeField] private GameObject planePrefab;
@@ -31,6 +17,18 @@ namespace _Project.Scripts.LevelGenerating
[SerializeField] private float wallHeight = 3f; [SerializeField] private float wallHeight = 3f;
[SerializeField] private float colliderThickness = 0.2f; [SerializeField] private float colliderThickness = 0.2f;
[Header("Двери и проёмы")]
[Tooltip("Префаб двойной двери (с компонентом DoorController)")]
[SerializeField] private GameObject doorPrefab;
[Tooltip("Высота дверного проёма в метрах. От doorHeight до wallHeight будет построена перемычка с текстурой комнаты.")]
[SerializeField] private float doorHeight = 2.2f;
[Tooltip("Толщина перемычки над дверью в метрах (0 = плоская, >0 = объёмная с нижней гранью над головой)")]
[Min(0f)] [SerializeField] private float lintelThickness = 0.3f;
[Tooltip("Дополнительный поворот префаба двери (по умолчанию 180 по Y)")]
[SerializeField] private Vector3 doorRotationOffset = new Vector3(0f, 180f, 0f);
[Tooltip("Локальное смещение двери относительно проёма (X - вдоль стены, Y - высота, Z - вперёд/назад)")]
[SerializeField] private Vector3 doorPositionOffset = Vector3.zero;
public ShellResult Spawn(FloorData floor) public ShellResult Spawn(FloorData floor)
{ {
if (planePrefab == null) if (planePrefab == null)
@@ -44,6 +42,9 @@ namespace _Project.Scripts.LevelGenerating
Root = new GameObject($"Floor_{floor.Index}_Shell").transform Root = new GameObject($"Floor_{floor.Index}_Shell").transform
}; };
int groundLayer = LayerMask.NameToLayer("Ground");
int ceilingLayer = LayerMask.NameToLayer("Ceiling");
// 1. Объект на каждую комнату + пол и потолок // 1. Объект на каждую комнату + пол и потолок
for (int i = 0; i < floor.Rooms.Count; i++) for (int i = 0; i < floor.Rooms.Count; i++)
{ {
@@ -64,18 +65,17 @@ namespace _Project.Scripts.LevelGenerating
// пол: нормаль вверх // пол: нормаль вверх
var floorGo = Make(roomGo.transform, "Floor", new Vector3(c.x, 0f, c.z), var floorGo = Make(roomGo.transform, "Floor", new Vector3(c.x, 0f, c.z),
Quaternion.identity, scale, true); Quaternion.identity, scale, true);
floorGo.layer = LayerMask.NameToLayer("Ground"); if (groundLayer != -1) floorGo.layer = groundLayer;
view.FloorRenderers.AddRange(floorGo.GetComponentsInChildren<Renderer>()); view.FloorRenderers.AddRange(floorGo.GetComponentsInChildren<Renderer>());
// потолок: перевёрнут, нормаль вниз // потолок: перевёрнут, нормаль вниз
var ceilingGo = Make(roomGo.transform, "Ceiling", new Vector3(c.x, wallHeight, c.z), var ceilingGo = Make(roomGo.transform, "Ceiling", new Vector3(c.x, wallHeight, c.z),
Quaternion.Euler(180f, 0f, 0f), scale, false); Quaternion.Euler(180f, 0f, 0f), scale, false);
ceilingGo.layer = LayerMask.NameToLayer("Ceiling"); if (ceilingLayer != -1) ceilingGo.layer = ceilingLayer;
view.CeilingRenderers.AddRange(ceilingGo.GetComponentsInChildren<Renderer>()); view.CeilingRenderers.AddRange(ceilingGo.GetComponentsInChildren<Renderer>());
} }
// 2. Стены раскладываются по комнатам-владельцам // 2. Сплошные стены раскладываются по комнатам-владельцам
foreach (var run in floor.Walls) foreach (var run in floor.Walls)
{ {
if (run.RoomIndex < 0 || run.RoomIndex >= result.Views.Count) if (run.RoomIndex < 0 || run.RoomIndex >= result.Views.Count)
@@ -83,48 +83,159 @@ namespace _Project.Scripts.LevelGenerating
Debug.LogWarning($"Стена ссылается на несуществующую комнату {run.RoomIndex}"); Debug.LogWarning($"Стена ссылается на несуществующую комнату {run.RoomIndex}");
continue; continue;
} }
SpawnWall(result.Views[run.RoomIndex], run); SpawnWallPiece(result.Views[run.RoomIndex], run.Start, run.Length, run.Facing, 0f, wallHeight, 0f, "Wall");
}
// 3. Дверные проёмы: объёмная перемычка над дверью + сама двойная дверь
foreach (var dw in floor.Doorways)
{
if (dw.RoomIndex < 0 || dw.RoomIndex >= result.Views.Count) continue;
SpawnDoorway(result.Views[dw.RoomIndex], dw, result);
} }
return result; return result;
} }
private void SpawnWall(RoomView view, WallRun run) private void SpawnDoorway(RoomView view, Doorway dw, ShellResult result)
{ {
float len = run.Length * LevelGrid.Module; // 1. Объёмная перемычка над дверью (от doorHeight до wallHeight)
float y = wallHeight / 2f; float topWallHeight = wallHeight - doorHeight;
float sx = run.Start.x * LevelGrid.Module; if (topWallHeight > 0.01f)
float sz = run.Start.y * LevelGrid.Module; {
SpawnLintel(view, dw, doorHeight, topWallHeight);
}
// 2. Спавн префаба двойной двери на каждом проёме комнаты
if (!dw.SpawnDoor || doorPrefab == null) return;
float len = dw.Length * LevelGrid.Module;
float sx = dw.Start.x * LevelGrid.Module;
float sz = dw.Start.y * LevelGrid.Module;
Vector3 basePos;
Quaternion baseRot;
switch (dw.Facing)
{
case WallFacing.ZP: // южная стена, нормаль в +Z
basePos = new Vector3(sx + len / 2f, 0f, sz);
baseRot = Quaternion.Euler(0f, 0f, 0f);
break;
case WallFacing.ZN: // северная стена, нормаль в -Z
basePos = new Vector3(sx + len / 2f, 0f, sz);
baseRot = Quaternion.Euler(0f, 180f, 0f);
break;
case WallFacing.XP: // западная стена, нормаль в +X
basePos = new Vector3(sx, 0f, sz + len / 2f);
baseRot = Quaternion.Euler(0f, 90f, 0f);
break;
default: // XN: восточная стена, нормаль в -X
basePos = new Vector3(sx, 0f, sz + len / 2f);
baseRot = Quaternion.Euler(0f, -90f, 0f);
break;
}
Quaternion finalRot = baseRot * Quaternion.Euler(doorRotationOffset);
Vector3 finalPos = basePos + finalRot * doorPositionOffset;
var doorGo = Instantiate(doorPrefab, finalPos, finalRot, view.transform);
doorGo.name = $"DoubleDoor_{dw.Facing}";
var controller = doorGo.GetComponent<DoorController>();
if (controller == null) controller = doorGo.AddComponent<DoorController>();
view.Doors.Add(controller);
result.AllDoors.Add(controller);
}
// Строит перемычку над дверью с учётом толщины lintelThickness:
// лицевую вертикальную стенку (сдвинутую на halfThick внутрь комнаты) и нижнюю горизонтальную грань
private void SpawnLintel(RoomView view, Doorway dw, float bottomY, float pieceHeight)
{
float halfThick = lintelThickness * 0.5f;
// Лицевая вертикальная сторона перемычки
SpawnWallPiece(view, dw.Start, dw.Length, dw.Facing, bottomY, pieceHeight, halfThick, "Wall_AboveDoor");
// Если толщина > 0, закрываем нижний торец перемычки (на высоте doorHeight, нормалью вниз)
if (halfThick > 0.001f)
{
float len = dw.Length * LevelGrid.Module;
float sx = dw.Start.x * LevelGrid.Module;
float sz = dw.Start.y * LevelGrid.Module;
Vector3 capPos;
Vector3 capScale;
switch (dw.Facing)
{
case WallFacing.ZP: // от линии стены в +Z на halfThick
capPos = new Vector3(sx + len / 2f, bottomY, sz + halfThick / 2f);
capScale = new Vector3(len / planeBaseSize, 1f, halfThick / planeBaseSize);
break;
case WallFacing.ZN: // от линии стены в -Z на halfThick
capPos = new Vector3(sx + len / 2f, bottomY, sz - halfThick / 2f);
capScale = new Vector3(len / planeBaseSize, 1f, halfThick / planeBaseSize);
break;
case WallFacing.XP: // от линии стены в +X на halfThick
capPos = new Vector3(sx + halfThick / 2f, bottomY, sz + len / 2f);
capScale = new Vector3(halfThick / planeBaseSize, 1f, len / planeBaseSize);
break;
default: // XN: от линии стены в -X на halfThick
capPos = new Vector3(sx - halfThick / 2f, bottomY, sz + len / 2f);
capScale = new Vector3(halfThick / planeBaseSize, 1f, len / planeBaseSize);
break;
}
// Поворот 180 по X — нормаль смотрит вниз (в проём над дверью)
var capGo = Make(view.transform, "Wall_AboveDoor_Bottom", capPos,
Quaternion.Euler(180f, 0f, 0f), capScale, false);
int wallLayer = LayerMask.NameToLayer("Wall");
if (wallLayer != -1) capGo.layer = wallLayer;
view.WallRenderers.AddRange(capGo.GetComponentsInChildren<Renderer>());
}
}
private void SpawnWallPiece(RoomView view, Vector2Int startCell, int lengthModules, WallFacing facing,
float bottomY, float pieceHeight, float forwardOffset, string pieceName)
{
float len = lengthModules * LevelGrid.Module;
float y = bottomY + pieceHeight / 2f;
float sx = startCell.x * LevelGrid.Module;
float sz = startCell.y * LevelGrid.Module;
Vector3 pos; Vector3 pos;
Quaternion rot; Quaternion rot;
Vector3 scale; Vector3 scale;
switch (run.Facing) switch (facing)
{ {
case WallFacing.ZP: // идёт вдоль X, нормаль +Z case WallFacing.ZP:
pos = new Vector3(sx + len / 2f, y, sz); pos = new Vector3(sx + len / 2f, y, sz + forwardOffset);
rot = Quaternion.Euler(90f, 0f, 0f); rot = Quaternion.Euler(90f, 0f, 0f);
scale = new Vector3(len / planeBaseSize, 1f, wallHeight / planeBaseSize); scale = new Vector3(len / planeBaseSize, 1f, pieceHeight / planeBaseSize);
break; break;
case WallFacing.ZN: // идёт вдоль X, нормаль -Z case WallFacing.ZN:
pos = new Vector3(sx + len / 2f, y, sz); pos = new Vector3(sx + len / 2f, y, sz - forwardOffset);
rot = Quaternion.Euler(-90f, 0f, 0f); rot = Quaternion.Euler(-90f, 0f, 0f);
scale = new Vector3(len / planeBaseSize, 1f, wallHeight / planeBaseSize); scale = new Vector3(len / planeBaseSize, 1f, pieceHeight / planeBaseSize);
break; break;
case WallFacing.XP: // идёт вдоль Z, нормаль +X case WallFacing.XP:
pos = new Vector3(sx, y, sz + len / 2f); pos = new Vector3(sx + forwardOffset, y, sz + len / 2f);
rot = Quaternion.Euler(0f, 0f, -90f); rot = Quaternion.Euler(0f, 0f, -90f);
scale = new Vector3(wallHeight / planeBaseSize, 1f, len / planeBaseSize); scale = new Vector3(pieceHeight / planeBaseSize, 1f, len / planeBaseSize);
break; break;
default: // XN: идёт вдоль Z, нормаль -X default: // XN
pos = new Vector3(sx, y, sz + len / 2f); pos = new Vector3(sx - forwardOffset, y, sz + len / 2f);
rot = Quaternion.Euler(0f, 0f, 90f); rot = Quaternion.Euler(0f, 0f, 90f);
scale = new Vector3(wallHeight / planeBaseSize, 1f, len / planeBaseSize); scale = new Vector3(pieceHeight / planeBaseSize, 1f, len / planeBaseSize);
break; break;
} }
var go = Make(view.transform, "Wall", pos, rot, scale, true); var go = Make(view.transform, pieceName, pos, rot, scale, true);
int wallLayer = LayerMask.NameToLayer("Wall");
if (wallLayer != -1) go.layer = wallLayer;
view.WallRenderers.AddRange(go.GetComponentsInChildren<Renderer>()); view.WallRenderers.AddRange(go.GetComponentsInChildren<Renderer>());
} }
@@ -135,12 +246,10 @@ namespace _Project.Scripts.LevelGenerating
go.name = name; go.name = name;
go.transform.localScale = scale; go.transform.localScale = scale;
// коллайдеры префаба не используем: у плоскости нет толщины
foreach (var c in go.GetComponents<Collider>()) Destroy(c); foreach (var c in go.GetComponents<Collider>()) Destroy(c);
if (withCollider) if (withCollider)
{ {
// Box прячем за видимой стороной (локальный -Y), чтобы он не съедал место внутри комнаты
var box = go.AddComponent<BoxCollider>(); var box = go.AddComponent<BoxCollider>();
box.size = new Vector3(planeBaseSize, colliderThickness, planeBaseSize); box.size = new Vector3(planeBaseSize, colliderThickness, planeBaseSize);
box.center = new Vector3(0f, -colliderThickness / 2f, 0f); box.center = new Vector3(0f, -colliderThickness / 2f, 0f);
+3
View File
@@ -13,6 +13,7 @@ namespace _Project.Scripts
public PlayerCombat Combat { get; private set; } public PlayerCombat Combat { get; private set; }
public PlayerSound Sound { get; private set; } public PlayerSound Sound { get; private set; }
public PlayerUI UI { get; private set; } public PlayerUI UI { get; private set; }
public PlayerPossession Possession { get; private set; }
protected override void Awake() protected override void Awake()
{ {
@@ -25,6 +26,8 @@ namespace _Project.Scripts
Combat = GetComponent<PlayerCombat>(); Combat = GetComponent<PlayerCombat>();
Sound = GetComponent<PlayerSound>(); Sound = GetComponent<PlayerSound>();
UI = GetComponent<PlayerUI>(); UI = GetComponent<PlayerUI>();
Possession = GetComponent<PlayerPossession>();
if (Possession == null) Possession = gameObject.AddComponent<PlayerPossession>();
Cursor.lockState = CursorLockMode.Locked; Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false; Cursor.visible = false;
@@ -0,0 +1,207 @@
using UnityEngine;
namespace _Project.Scripts.PlayerUtils
{
public enum BodyClass
{
Spirit,
Scout,
Trooper,
Juggernaut,
Sniper
}
[CreateAssetMenu(menuName = "Player/Body Profile", fileName = "BodyProfile")]
public class BodyProfile : ScriptableObject
{
public BodyClass bodyClass = BodyClass.Trooper;
public string displayName = "Штурмовик";
public float maxHealth = 100f;
[Header("Передвижение (PlayerMovement)")]
public float moveSpeed = 6.5f;
public float sprintSpeed = 9.5f;
public float crouchSpeed = 3f;
public bool canSlide = true;
public float slideInitialSpeed = 15f;
public float slideDuration = 0.85f;
public float airAcceleration = 80f;
public float jumpHeight = 1.35f;
public float gravity = -25f;
public float standingHeight = 2f;
[Header("Камера и Звук (PlayerCamera & Sound)")]
public float standingCameraY = 1.6f;
public float crouchingCameraY = 0.8f;
public float walkBobSpeed = 12f;
public float walkBobAmount = 0.04f;
public float slideTiltAngle = 4f;
public float footstepPitch = 1f;
[Header("Оружие и Снаряды (PlayerCombat)")]
public bool canShoot = true;
public bool isAutomatic = true;
public float damage = 25f;
public float fireRate = 0.12f;
public float weaponRange = 100f;
public int pelletsPerShot = 1;
public float spreadAngle = 0f;
public bool pierceTargets = false;
public float recoilKick = 1.2f;
[Header("Параметры летящего снаряда")]
[Tooltip("Скорость полёта снаряда в м/с (чтобы от него можно было увернуться!)")]
public float projectileSpeed = 30f;
public float projectileSize = 0.22f;
public Color projectileColor = new Color(1f, 0.6f, 0.1f, 1f);
public static BodyProfile CreateDefault(BodyClass type)
{
var p = CreateInstance<BodyProfile>();
p.bodyClass = type;
switch (type)
{
case BodyClass.Spirit:
p.displayName = "ДУХ МЩЕНИЯ";
p.maxHealth = 25f;
p.moveSpeed = 11f;
p.sprintSpeed = 15f;
p.crouchSpeed = 6f;
p.canSlide = true;
p.slideInitialSpeed = 22f;
p.slideDuration = 1.1f;
p.airAcceleration = 160f;
p.jumpHeight = 1.8f;
p.gravity = -18f;
p.standingHeight = 1.6f;
p.standingCameraY = 1.3f;
p.walkBobAmount = 0.015f;
p.canShoot = false;
break;
case BodyClass.Scout:
p.displayName = "СКАУТ (Чистильщик)";
p.maxHealth = 70f;
p.moveSpeed = 9f;
p.sprintSpeed = 13f;
p.crouchSpeed = 4.5f;
p.canSlide = true;
p.slideInitialSpeed = 20f;
p.slideDuration = 1.15f;
p.airAcceleration = 140f;
p.jumpHeight = 1.65f;
p.gravity = -24f;
p.standingHeight = 1.8f;
p.standingCameraY = 1.5f;
p.walkBobSpeed = 15f;
p.walkBobAmount = 0.05f;
p.slideTiltAngle = 7f;
p.footstepPitch = 1.2f;
p.canShoot = true;
p.isAutomatic = true;
p.damage = 14f;
p.fireRate = 0.08f;
p.weaponRange = 45f;
p.pelletsPerShot = 1;
p.spreadAngle = 2.5f;
p.recoilKick = 0.6f;
p.projectileSpeed = 36f; // Жёлтые быстрые очереди
p.projectileSize = 0.16f;
p.projectileColor = new Color(1f, 0.9f, 0.2f, 1f);
break;
case BodyClass.Trooper:
p.displayName = "ШТУРМОВИК СБ";
p.maxHealth = 120f;
p.moveSpeed = 6.5f;
p.sprintSpeed = 9.5f;
p.crouchSpeed = 3f;
p.canSlide = true;
p.slideInitialSpeed = 15f;
p.slideDuration = 0.85f;
p.airAcceleration = 80f;
p.jumpHeight = 1.35f;
p.gravity = -25f;
p.standingHeight = 2f;
p.standingCameraY = 1.6f;
p.walkBobSpeed = 12f;
p.walkBobAmount = 0.04f;
p.footstepPitch = 1f;
p.canShoot = true;
p.isAutomatic = true;
p.damage = 25f;
p.fireRate = 0.14f;
p.weaponRange = 90f;
p.pelletsPerShot = 1;
p.spreadAngle = 1.2f;
p.recoilKick = 1.1f;
p.projectileSpeed = 28f; // Голубые плазменные сгустки средней скорости
p.projectileSize = 0.22f;
p.projectileColor = new Color(0.2f, 0.7f, 1f, 1f);
break;
case BodyClass.Juggernaut:
p.displayName = "ДЖАГГЕРНАУТ (Танк)";
p.maxHealth = 280f;
p.moveSpeed = 4.2f;
p.sprintSpeed = 5.8f;
p.crouchSpeed = 2f;
p.canSlide = false;
p.airAcceleration = 35f;
p.jumpHeight = 0.85f;
p.gravity = -35f;
p.standingHeight = 2.4f;
p.standingCameraY = 1.95f;
p.crouchingCameraY = 1.2f;
p.walkBobSpeed = 7f;
p.walkBobAmount = 0.07f;
p.footstepPitch = 0.65f;
p.canShoot = true;
p.isAutomatic = false;
p.damage = 18f;
p.fireRate = 0.85f;
p.weaponRange = 35f;
p.pelletsPerShot = 8;
p.spreadAngle = 7f;
p.recoilKick = 4.2f;
p.projectileSpeed = 22f; // Крупная ярко-оранжевая картечь (отлично видно для уворота!)
p.projectileSize = 0.25f;
p.projectileColor = new Color(1f, 0.3f, 0.1f, 1f);
break;
case BodyClass.Sniper:
p.displayName = "СНАЙПЕР-ФАНТОМ";
p.maxHealth = 85f;
p.moveSpeed = 6.2f;
p.sprintSpeed = 8.8f;
p.crouchSpeed = 3.2f;
p.canSlide = true;
p.slideInitialSpeed = 14f;
p.slideDuration = 0.8f;
p.airAcceleration = 90f;
p.jumpHeight = 1.45f;
p.gravity = -20f;
p.standingHeight = 2f;
p.standingCameraY = 1.65f;
p.walkBobSpeed = 10f;
p.walkBobAmount = 0.015f;
p.footstepPitch = 1.05f;
p.canShoot = true;
p.isAutomatic = false;
p.damage = 110f;
p.fireRate = 1.1f;
p.weaponRange = 200f;
p.pelletsPerShot = 1;
p.spreadAngle = 0f;
p.pierceTargets = true;
p.recoilKick = 3.0f;
p.projectileSpeed = 60f; // Фиолетовый скоростной заряд рейлгана
p.projectileSize = 0.28f;
p.projectileColor = new Color(0.85f, 0.2f, 1f, 1f);
break;
}
return p;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8addb03ef12f4e9eb6834129b77b5969
timeCreated: 1792605123
@@ -1,5 +1,4 @@
using UnityEngine; using UnityEngine;
using UnityEngine.InputSystem;
namespace _Project.Scripts.PlayerUtils namespace _Project.Scripts.PlayerUtils
{ {
@@ -24,6 +23,8 @@ namespace _Project.Scripts.PlayerUtils
[SerializeField] private float sprintBobAmount = 0.07f; [SerializeField] private float sprintBobAmount = 0.07f;
[SerializeField] private float impactRecoverySpeed = 6f; [SerializeField] private float impactRecoverySpeed = 6f;
public Transform CameraTransform => cameraPosition;
private PlayerControls controls; private PlayerControls controls;
private PlayerMovement movement; private PlayerMovement movement;
@@ -47,6 +48,23 @@ namespace _Project.Scripts.PlayerUtils
yRotation = transform.eulerAngles.y; yRotation = transform.eulerAngles.y;
} }
public void ApplyProfile(BodyProfile profile)
{
standingCameraY = profile.standingCameraY;
crouchingCameraY = profile.crouchingCameraY;
walkBobSpeed = profile.walkBobSpeed;
sprintBobSpeed = profile.walkBobSpeed * 1.25f;
walkBobAmount = profile.walkBobAmount;
sprintBobAmount = profile.walkBobAmount * 1.6f;
slideCameraTiltAngle = profile.slideTiltAngle;
}
public void SetYaw(float yaw)
{
yRotation = yaw;
transform.rotation = Quaternion.Euler(0f, yRotation, 0f);
}
private void Update() private void Update()
{ {
HandleMouseLook(); HandleMouseLook();
@@ -56,12 +74,13 @@ namespace _Project.Scripts.PlayerUtils
private void HandleMouseLook() private void HandleMouseLook()
{ {
Vector2 lookInput = controls.Player.Look.ReadValue<Vector2>(); Vector2 lookInput = controls.Player.Look.ReadValue<Vector2>();
float dt = Time.unscaledDeltaTime;
cameraPitch -= lookInput.y * mouseSensitivity; cameraPitch -= lookInput.y * mouseSensitivity;
cameraPitch = Mathf.Clamp(cameraPitch, -maxLookAngle, maxLookAngle); cameraPitch = Mathf.Clamp(cameraPitch, -maxLookAngle, maxLookAngle);
float targetTilt = movement.IsSliding ? -slideCameraTiltAngle : 0f; float targetTilt = movement.IsSliding ? -slideCameraTiltAngle : 0f;
currentCameraTilt = Mathf.Lerp(currentCameraTilt, targetTilt, Time.deltaTime * 10f); currentCameraTilt = Mathf.Lerp(currentCameraTilt, targetTilt, dt * 10f);
cameraPosition.localRotation = Quaternion.Euler(cameraPitch, 0f, currentCameraTilt); cameraPosition.localRotation = Quaternion.Euler(cameraPitch, 0f, currentCameraTilt);
@@ -71,9 +90,10 @@ namespace _Project.Scripts.PlayerUtils
private void HandleCameraAndBobbing() private void HandleCameraAndBobbing()
{ {
float dt = Time.unscaledDeltaTime;
bool isLowered = movement.IsCrouching || movement.IsSliding; bool isLowered = movement.IsCrouching || movement.IsSliding;
float targetCamY = isLowered ? crouchingCameraY : standingCameraY; float targetCamY = isLowered ? crouchingCameraY : standingCameraY;
baseCameraY = Mathf.Lerp(baseCameraY, targetCamY, Time.deltaTime * crouchTransitionSpeed); baseCameraY = Mathf.Lerp(baseCameraY, targetCamY, dt * crouchTransitionSpeed);
bool isMoving = movement.MoveInput.sqrMagnitude > 0.01f && movement.IsGrounded && !movement.IsSliding; bool isMoving = movement.MoveInput.sqrMagnitude > 0.01f && movement.IsGrounded && !movement.IsSliding;
@@ -82,13 +102,12 @@ namespace _Project.Scripts.PlayerUtils
float speed = movement.IsSprinting ? sprintBobSpeed : walkBobSpeed; float speed = movement.IsSprinting ? sprintBobSpeed : walkBobSpeed;
float amount = movement.IsSprinting ? sprintBobAmount : walkBobAmount; float amount = movement.IsSprinting ? sprintBobAmount : walkBobAmount;
bobTimer += Time.deltaTime * speed; bobTimer += dt * speed;
bobOffset.x = Mathf.Cos(bobTimer * 0.5f) * amount; bobOffset.x = Mathf.Cos(bobTimer * 0.5f) * amount;
bobOffset.y = Mathf.Sin(bobTimer) * amount; bobOffset.y = Mathf.Sin(bobTimer) * amount;
if (Mathf.Sin(bobTimer) <= -0.9f && !stepTaken) if (Mathf.Sin(bobTimer) <= -0.9f && !stepTaken)
{ {
// ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ
Player.Instance.Sound.PlayFootstep(movement.IsSprinting); Player.Instance.Sound.PlayFootstep(movement.IsSprinting);
stepTaken = true; stepTaken = true;
} }
@@ -98,10 +117,10 @@ namespace _Project.Scripts.PlayerUtils
{ {
bobTimer = 0f; bobTimer = 0f;
stepTaken = false; stepTaken = false;
bobOffset = Vector3.Lerp(bobOffset, Vector3.zero, Time.deltaTime * 10f); bobOffset = Vector3.Lerp(bobOffset, Vector3.zero, dt * 10f);
} }
currentImpactOffset = Mathf.Lerp(currentImpactOffset, 0f, Time.deltaTime * impactRecoverySpeed); currentImpactOffset = Mathf.Lerp(currentImpactOffset, 0f, dt * impactRecoverySpeed);
cameraPosition.localPosition = new Vector3(bobOffset.x, baseCameraY + bobOffset.y - currentImpactOffset, 0f); cameraPosition.localPosition = new Vector3(bobOffset.x, baseCameraY + bobOffset.y - currentImpactOffset, 0f);
} }
@@ -5,13 +5,9 @@ namespace _Project.Scripts.PlayerUtils
{ {
public class PlayerCombat : MonoBehaviour public class PlayerCombat : MonoBehaviour
{ {
[Header("Оружие и Стрельба (Hitscan)")] [Header("Оружие и Стрельба (Projectiles)")]
[SerializeField] private float damage = 25f; [SerializeField] private bool canShoot = true;
[SerializeField] private float fireRate = 0.12f;
[SerializeField] private float weaponRange = 100f;
[SerializeField] private LayerMask hitLayers = ~0; [SerializeField] private LayerMask hitLayers = ~0;
[SerializeField] private bool isAutomatic = true;
[SerializeField] private float recoilKick = 1.2f;
[Header("Эффекты (без звука)")] [Header("Эффекты (без звука)")]
[SerializeField] private ParticleSystem muzzleFlash; [SerializeField] private ParticleSystem muzzleFlash;
@@ -21,6 +17,7 @@ namespace _Project.Scripts.PlayerUtils
[SerializeField] private Transform cameraPosition; [SerializeField] private Transform cameraPosition;
private PlayerControls controls; private PlayerControls controls;
private BodyProfile currentProfile;
private float shootTimer = 0f; private float shootTimer = 0f;
private bool isShootingInput = false; private bool isShootingInput = false;
@@ -32,45 +29,51 @@ namespace _Project.Scripts.PlayerUtils
controls.Player.Attack.canceled += _ => isShootingInput = false; controls.Player.Attack.canceled += _ => isShootingInput = false;
} }
public void ApplyProfile(BodyProfile profile)
{
currentProfile = profile;
canShoot = profile.canShoot;
shootTimer = 0f;
}
private void Update() private void Update()
{ {
if (shootTimer > 0f) shootTimer -= Time.deltaTime; if (shootTimer > 0f) shootTimer -= Time.unscaledDeltaTime;
if (!canShoot || currentProfile == null) return;
bool shootPressed = isShootingInput || (Mouse.current != null && (isAutomatic ? Mouse.current.leftButton.isPressed : Mouse.current.leftButton.wasPressedThisFrame)); bool isAuto = currentProfile.isAutomatic;
bool shootPressed = isShootingInput || (Mouse.current != null && (isAuto ? Mouse.current.leftButton.isPressed : Mouse.current.leftButton.wasPressedThisFrame));
if (shootPressed && shootTimer <= 0f) if (shootPressed && shootTimer <= 0f)
{ {
Shoot(); Shoot();
if (!isAuto) isShootingInput = false;
} }
} }
private void Shoot() private void Shoot()
{ {
shootTimer = fireRate; shootTimer = currentProfile.fireRate;
// ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ
Player.Instance.Sound.PlayShoot(); Player.Instance.Sound.PlayShoot();
if (muzzleFlash != null) muzzleFlash.Play(); if (muzzleFlash != null) muzzleFlash.Play();
Player.Instance.CameraController.ApplyRecoil(recoilKick); Player.Instance.CameraController.ApplyRecoil(currentProfile.recoilKick);
Ray ray = new Ray(cameraPosition.position, cameraPosition.forward); int pellets = Mathf.Max(1, currentProfile.pelletsPerShot);
if (Physics.Raycast(ray, out RaycastHit hit, weaponRange, hitLayers, QueryTriggerInteraction.Ignore)) float spread = currentProfile.spreadAngle;
Vector3 spawnPos = cameraPosition.position + cameraPosition.forward * 0.6f - cameraPosition.up * 0.1f;
for (int i = 0; i < pellets; i++)
{ {
if (hit.collider.TryGetComponent<IDamageable>(out var damageable)) Vector3 dir = cameraPosition.forward;
if (spread > 0.01f)
{ {
damageable.TakeDamage(damage); dir = Quaternion.Euler(
} Random.Range(-spread, spread),
else if (hit.rigidbody != null) Random.Range(-spread, spread), 0f) * dir;
{
hit.rigidbody.AddForceAtPosition(-hit.normal * (damage * 10f), hit.point, ForceMode.Impulse);
} }
if (impactPrefab != null) Projectile.Spawn(spawnPos, dir, currentProfile, true, gameObject, hitLayers, impactPrefab);
{
GameObject impact = Instantiate(impactPrefab, hit.point + (hit.normal * 0.001f), Quaternion.LookRotation(hit.normal));
Destroy(impact, 3f);
}
} }
} }
} }
@@ -12,6 +12,7 @@ namespace _Project.Scripts.PlayerUtils
[SerializeField] private float crouchSpeed = 3f; [SerializeField] private float crouchSpeed = 3f;
[Header("Параметры Подката (Slide)")] [Header("Параметры Подката (Slide)")]
[SerializeField] private bool canSlide = true;
[SerializeField] private float slideInitialSpeed = 15f; [SerializeField] private float slideInitialSpeed = 15f;
[SerializeField] private float slideDuration = 0.85f; [SerializeField] private float slideDuration = 0.85f;
[SerializeField] private float slideFriction = 2.8f; [SerializeField] private float slideFriction = 2.8f;
@@ -22,7 +23,6 @@ namespace _Project.Scripts.PlayerUtils
[SerializeField] private float groundAcceleration = 10f; [SerializeField] private float groundAcceleration = 10f;
[SerializeField] private float airAcceleration = 80f; [SerializeField] private float airAcceleration = 80f;
[SerializeField] private float airCap = 2.0f; [SerializeField] private float airCap = 2.0f;
[SerializeField] private bool showSpeedometer = true;
[Header("Гравитация и Прыжок")] [Header("Гравитация и Прыжок")]
[SerializeField] private float jumpHeight = 1.35f; [SerializeField] private float jumpHeight = 1.35f;
@@ -47,6 +47,7 @@ namespace _Project.Scripts.PlayerUtils
public bool IsSliding { get; private set; } public bool IsSliding { get; private set; }
public Vector2 MoveInput { get; private set; } public Vector2 MoveInput { get; private set; }
public float CurrentSpeed => horizontalVelocity.magnitude; public float CurrentSpeed => horizontalVelocity.magnitude;
private bool wasGrounded; private bool wasGrounded;
private float jumpBufferTimer = 0f; private float jumpBufferTimer = 0f;
private Vector3 horizontalVelocity = Vector3.zero; private Vector3 horizontalVelocity = Vector3.zero;
@@ -57,15 +58,16 @@ namespace _Project.Scripts.PlayerUtils
private Vector3 slideDirection = Vector3.zero; private Vector3 slideDirection = Vector3.zero;
private float slideCooldownTimer = 0f; private float slideCooldownTimer = 0f;
private void Start() private void Awake()
{ {
rb = GetComponent<Rigidbody>(); rb = GetComponent<Rigidbody>();
col = GetComponent<CapsuleCollider>(); col = GetComponent<CapsuleCollider>();
rb.useGravity = false; rb.useGravity = false;
rb.freezeRotation = true; rb.freezeRotation = true;
rb.interpolation = RigidbodyInterpolation.None; }
private void Start()
{
controls = Player.Instance.Controls; controls = Player.Instance.Controls;
controls.Player.Sprint.started += _ => IsSprinting = true; controls.Player.Sprint.started += _ => IsSprinting = true;
@@ -77,12 +79,35 @@ namespace _Project.Scripts.PlayerUtils
controls.Player.Jump.performed += _ => QueueJump(); controls.Player.Jump.performed += _ => QueueJump();
} }
public void ApplyProfile(BodyProfile profile)
{
moveSpeed = profile.moveSpeed;
sprintSpeed = profile.sprintSpeed;
crouchSpeed = profile.crouchSpeed;
canSlide = profile.canSlide;
slideInitialSpeed = profile.slideInitialSpeed;
slideDuration = profile.slideDuration;
airAcceleration = profile.airAcceleration;
jumpHeight = profile.jumpHeight;
gravity = profile.gravity;
standingHeight = profile.standingHeight;
if (!canSlide && IsSliding) StopSlide();
}
public void AddVerticalImpulse(float velocityY)
{
verticalVelocity = velocityY;
IsGrounded = false;
}
private void Update() private void Update()
{ {
MoveInput = controls.Player.Move.ReadValue<Vector2>(); MoveInput = controls.Player.Move.ReadValue<Vector2>();
if (jumpBufferTimer > 0f) jumpBufferTimer -= Time.deltaTime; float dt = Time.unscaledDeltaTime;
if (slideCooldownTimer > 0f) slideCooldownTimer -= Time.deltaTime; if (jumpBufferTimer > 0f) jumpBufferTimer -= dt;
if (slideCooldownTimer > 0f) slideCooldownTimer -= dt;
if (Mouse.current != null && Mathf.Abs(Mouse.current.scroll.y.ReadValue()) > 0.1f) if (Mouse.current != null && Mathf.Abs(Mouse.current.scroll.y.ReadValue()) > 0.1f)
QueueJump(); QueueJump();
@@ -100,7 +125,11 @@ namespace _Project.Scripts.PlayerUtils
ApplyMovement(); ApplyMovement();
rb.linearVelocity = new Vector3(horizontalVelocity.x, verticalVelocity, horizontalVelocity.z); float timeMult = Player.Instance.Possession != null ? Player.Instance.Possession.PlayerTimeMultiplier : 1f;
rb.linearVelocity = new Vector3(
horizontalVelocity.x * timeMult,
verticalVelocity,
horizontalVelocity.z * timeMult);
wasGrounded = IsGrounded; wasGrounded = IsGrounded;
} }
@@ -108,7 +137,7 @@ namespace _Project.Scripts.PlayerUtils
{ {
bool isLowered = IsCrouching || IsSliding; bool isLowered = IsCrouching || IsSliding;
float targetHeight = isLowered ? crouchingHeight : standingHeight; float targetHeight = isLowered ? crouchingHeight : standingHeight;
col.height = Mathf.Lerp(col.height, targetHeight, Time.deltaTime * crouchTransitionSpeed); col.height = Mathf.Lerp(col.height, targetHeight, Time.unscaledDeltaTime * crouchTransitionSpeed);
col.center = new Vector3(col.center.x, col.height * 0.5f, col.center.z); col.center = new Vector3(col.center.x, col.height * 0.5f, col.center.z);
} }
@@ -126,8 +155,6 @@ namespace _Project.Scripts.PlayerUtils
jumpBufferTimer = 0f; jumpBufferTimer = 0f;
Player.Instance.CameraController.TriggerJumpImpact(); Player.Instance.CameraController.TriggerJumpImpact();
// ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ
Player.Instance.Sound.PlayJump(); Player.Instance.Sound.PlayJump();
} }
@@ -201,7 +228,6 @@ namespace _Project.Scripts.PlayerUtils
if (!wasGrounded && IsGrounded) if (!wasGrounded && IsGrounded)
{ {
// ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ
Player.Instance.Sound.PlayLand(); Player.Instance.Sound.PlayLand();
} }
@@ -217,7 +243,7 @@ namespace _Project.Scripts.PlayerUtils
private void OnCrouchPressed() private void OnCrouchPressed()
{ {
if (IsSprinting && IsGrounded && MoveInput.y > 0.2f && slideCooldownTimer <= 0f) StartSlide(); if (canSlide && IsSprinting && IsGrounded && MoveInput.y > 0.2f && slideCooldownTimer <= 0f) StartSlide();
else IsCrouching = true; else IsCrouching = true;
} }
@@ -235,7 +261,6 @@ namespace _Project.Scripts.PlayerUtils
slideDirection = (transform.forward * MoveInput.y + transform.right * MoveInput.x).normalized; slideDirection = (transform.forward * MoveInput.y + transform.right * MoveInput.x).normalized;
if (slideDirection.sqrMagnitude < 0.01f) slideDirection = transform.forward; if (slideDirection.sqrMagnitude < 0.01f) slideDirection = transform.forward;
// ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ
Player.Instance.Sound.PlaySlide(); Player.Instance.Sound.PlaySlide();
} }
@@ -244,6 +269,5 @@ namespace _Project.Scripts.PlayerUtils
IsSliding = false; IsSliding = false;
slideCooldownTimer = slideCooldown; slideCooldownTimer = slideCooldown;
} }
} }
} }
@@ -0,0 +1,255 @@
using System.Collections;
using UnityEngine;
using UnityEngine.InputSystem;
namespace _Project.Scripts.PlayerUtils
{
public class PlayerPossession : MonoBehaviour, IDamageable
{
[Header("Профиль Духа (Форма по умолчанию)")]
[SerializeField] private BodyProfile spiritProfile;
[Header("Настройки Вселения (Possession)")]
[Tooltip("Радиус зоны вселения в метрах")]
[SerializeField] private float possessRange = 12f;
[Tooltip("С какого максимального расстояния прицел замечает врага и показывает сферу зоны")]
[SerializeField] private float maxAimLookDistance = 60f;
[SerializeField] private float possessDashDuration = 0.15f;
[SerializeField] private LayerMask possessRayMask = ~0;
[Header("Визуал Сферы Зоны Вселения")]
[Tooltip("Если true — сфера рисуется вокруг врага (показывая зону, куда надо войти). Если false — вокруг игрока.")]
[SerializeField] private bool centerSphereOnTarget = true;
[SerializeField] private Color zoneReadyColor = new Color(0.1f, 0.95f, 1f, 0.10f); // Враг в зоне (можно жать E)
[SerializeField] private Color zoneOutOfRangeColor = new Color(1f, 0.35f, 0.35f, 0.06f); // Навёлся, но далеко
[Header("Замедление времени в форме Духа")]
[SerializeField, Range(0.1f, 1f)] private float spiritTimeScale = 0.45f;
public BodyProfile CurrentProfile { get; private set; }
public bool IsInSpiritForm => CurrentProfile != null && CurrentProfile.bodyClass == BodyClass.Spirit;
public float CurrentHealth { get; private set; }
public float MaxHealth => CurrentProfile != null ? CurrentProfile.maxHealth : 25f;
// Враг, на которого наведён прицел (на любом расстоянии до maxAimLookDistance)
public EnemyAI AimedEnemy { get; private set; }
// Находится ли этот враг внутри сферы вселения (possessRange)
public bool IsTargetInPossessZone { get; private set; }
public float PlayerTimeMultiplier =>
IsInSpiritForm ? (1f / Mathf.Max(0.1f, Time.timeScale)) * 0.85f : 1f;
private Transform _camTransform;
private bool _isTransitioning;
private float _invulnerableTimer;
// Полупрозрачная сфера зоны вселения
private GameObject _zoneSphere;
private Renderer _zoneRenderer;
private Material _zoneMaterial;
private float _currentZoneAlpha;
private void Awake()
{
if (spiritProfile == null)
spiritProfile = BodyProfile.CreateDefault(BodyClass.Spirit);
CreatePossessionZoneSphere();
}
private void Start()
{
_camTransform = Player.Instance.CameraController.CameraTransform;
EnterSpiritForm(false);
}
private void CreatePossessionZoneSphere()
{
_zoneSphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
_zoneSphere.name = "PossessionZoneSphere";
// Убираем коллайдер, это чисто визуальная голограмма зоны
var col = _zoneSphere.GetComponent<Collider>();
if (col != null) Destroy(col);
_zoneRenderer = _zoneSphere.GetComponent<Renderer>();
_zoneRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
_zoneRenderer.receiveShadows = false;
// Используем прозрачный шейдер, который рисуется поверх и мягко подсвечивает площадь
Shader shader = Shader.Find("Sprites/Default");
_zoneMaterial = new Material(shader);
_zoneMaterial.color = Color.clear;
_zoneRenderer.material = _zoneMaterial;
_zoneSphere.SetActive(false);
}
private void Update()
{
if (_invulnerableTimer > 0f) _invulnerableTimer -= Time.unscaledDeltaTime;
if (_isTransitioning)
{
if (_zoneSphere != null) _zoneSphere.SetActive(false);
return;
}
UpdateAimedTarget();
UpdateZoneVisual();
HandleInput();
}
private void UpdateAimedTarget()
{
AimedEnemy = null;
IsTargetInPossessZone = false;
if (_camTransform == null) return;
Ray ray = new Ray(_camTransform.position, _camTransform.forward);
if (Physics.SphereCast(ray, 0.5f, out RaycastHit hit, maxAimLookDistance, possessRayMask, QueryTriggerInteraction.Ignore))
{
var enemy = hit.collider.GetComponentInParent<EnemyAI>();
if (enemy != null && enemy.CanBePossessed)
{
AimedEnemy = enemy;
float dist = Vector3.Distance(transform.position, enemy.transform.position);
IsTargetInPossessZone = dist <= possessRange;
}
}
}
private void UpdateZoneVisual()
{
if (_zoneSphere == null) return;
if (AimedEnemy != null)
{
if (!_zoneSphere.activeSelf) _zoneSphere.SetActive(true);
// Диаметр сферы = 2 * радиус (possessRange)
float diameter = possessRange * 2f;
_zoneSphere.transform.localScale = new Vector3(diameter, diameter, diameter);
// Центр сферы: либо на враге, либо на игроке
Vector3 center = centerSphereOnTarget ? AimedEnemy.transform.position : transform.position;
_zoneSphere.transform.position = center;
Color targetColor = IsTargetInPossessZone ? zoneReadyColor : zoneOutOfRangeColor;
_zoneMaterial.color = Color.Lerp(_zoneMaterial.color, targetColor, Time.unscaledDeltaTime * 12f);
}
else
{
if (_zoneSphere.activeSelf)
{
_zoneMaterial.color = Color.clear;
_zoneSphere.SetActive(false);
}
}
}
private void HandleInput()
{
if (Keyboard.current == null) return;
// Клавиша E — Вселиться, если враг под прицелом И находится внутри сферы!
if (Keyboard.current.eKey.wasPressedThisFrame && AimedEnemy != null && IsTargetInPossessZone)
{
StartCoroutine(PossessRoutine(AimedEnemy));
}
// Клавиша Q — Покинуть тело
else if (Keyboard.current.qKey.wasPressedThisFrame && !IsInSpiritForm)
{
EnterSpiritForm(true);
}
}
private IEnumerator PossessRoutine(EnemyAI target)
{
_isTransitioning = true;
if (_zoneSphere != null) _zoneSphere.SetActive(false);
BodyProfile newProfile = target.profile != null
? target.profile
: BodyProfile.CreateDefault(target.enemyClass);
float inheritedHealth = Mathf.Max(target.CurrentHealth, newProfile.maxHealth * 0.5f);
Vector3 startPos = transform.position;
Vector3 endPos = target.transform.position;
Quaternion targetRot = target.transform.rotation;
Destroy(target.gameObject);
float elapsed = 0f;
while (elapsed < possessDashDuration)
{
elapsed += Time.unscaledDeltaTime;
float t = Mathf.Clamp01(elapsed / possessDashDuration);
transform.position = Vector3.Lerp(startPos, endPos, t);
yield return null;
}
transform.position = endPos;
Player.Instance.CameraController.SetYaw(targetRot.eulerAngles.y);
ApplyProfile(newProfile, inheritedHealth);
_invulnerableTimer = 0.4f;
_isTransitioning = false;
}
public void EnterSpiritForm(bool ejectImpulse)
{
ApplyProfile(spiritProfile, spiritProfile.maxHealth);
_invulnerableTimer = 0.5f;
if (ejectImpulse && Player.Instance.Movement != null)
{
Player.Instance.Movement.AddVerticalImpulse(8f);
}
}
public void ApplyProfile(BodyProfile profile, float startHealth)
{
CurrentProfile = profile;
CurrentHealth = Mathf.Clamp(startHealth, 1f, profile.maxHealth);
bool isSpirit = profile.bodyClass == BodyClass.Spirit;
Time.timeScale = isSpirit ? spiritTimeScale : 1f;
Time.fixedDeltaTime = 0.02f * Time.timeScale;
Player.Instance.Movement.ApplyProfile(profile);
Player.Instance.CameraController.ApplyProfile(profile);
Player.Instance.Combat.ApplyProfile(profile);
Player.Instance.Sound.SetFootstepPitch(profile.footstepPitch);
}
public void TakeDamage(float amount)
{
if (_invulnerableTimer > 0f || _isTransitioning) return;
CurrentHealth -= amount;
if (CurrentHealth <= 0f)
{
if (!IsInSpiritForm)
{
Debug.Log("Носитель уничтожен! Выброс в форму Духа!");
EnterSpiritForm(true);
}
else
{
CurrentHealth = 0f;
Debug.Log("ДУХ УНИЧТОЖЕН! ИГРА ОКОНЧЕНА.");
EnterSpiritForm(false);
}
}
}
private void OnDestroy()
{
if (_zoneSphere != null) Destroy(_zoneSphere);
Time.timeScale = 1f;
Time.fixedDeltaTime = 0.02f;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 246649c648e14696bc2cac61522a8d66
timeCreated: 1792605158
@@ -17,25 +17,25 @@ namespace _Project.Scripts.PlayerUtils
[Header("Звуки Оружия")] [Header("Звуки Оружия")]
[SerializeField] private AudioClip shootSound; [SerializeField] private AudioClip shootSound;
private float _baseFootstepPitch = 1f;
private void Reset() private void Reset()
{ {
// Автоматически подцепит AudioSource при добавлении скрипта на объект
audioSource = GetComponent<AudioSource>(); audioSource = GetComponent<AudioSource>();
} }
public void SetFootstepPitch(float pitch) => _baseFootstepPitch = pitch;
public void PlayFootstep(bool isSprinting) public void PlayFootstep(bool isSprinting)
{ {
if (footstepSounds == null || footstepSounds.Length == 0) return; if (footstepSounds == null || footstepSounds.Length == 0) return;
int randomIndex = Random.Range(0, footstepSounds.Length); int randomIndex = Random.Range(0, footstepSounds.Length);
audioSource.pitch = _baseFootstepPitch * Random.Range(0.92f, 1.08f);
// Немного меняем высоту звука для разнообразия
audioSource.pitch = Random.Range(0.9f, 1.1f);
float volume = isSprinting ? 0.6f : 0.4f; float volume = isSprinting ? 0.6f : 0.4f;
audioSource.PlayOneShot(footstepSounds[randomIndex], volume); audioSource.PlayOneShot(footstepSounds[randomIndex], volume);
audioSource.pitch = 1f;
audioSource.pitch = 1f; // Сбрасываем питч обратно
} }
public void PlayJump() public void PlayJump()
+32 -25
View File
@@ -5,49 +5,56 @@ namespace _Project.Scripts.PlayerUtils
public class PlayerUI : MonoBehaviour public class PlayerUI : MonoBehaviour
{ {
[Header("Настройки Интерфейса")] [Header("Настройки Интерфейса")]
[SerializeField] private bool showSpeedometer = true; [SerializeField] private bool showHUD = true;
private PlayerMovement movement; private PlayerMovement movement;
private PlayerPossession possession;
private void Start() private void Start()
{ {
// Берем ссылку на компонент передвижения через фасад Player
movement = Player.Instance.Movement; movement = Player.Instance.Movement;
possession = Player.Instance.Possession;
} }
private void OnGUI() private void OnGUI()
{ {
if (!showSpeedometer || movement == null) return; if (!showHUD || movement == null) return;
// Читаем публичное свойство скорости (мы добавим его ниже)
float speed = movement.CurrentSpeed; float speed = movement.CurrentSpeed;
float csUnits = speed * 38.5f; float csUnits = speed * 38.5f;
GUIStyle style = new GUIStyle GUIStyle style = new GUIStyle { fontSize = 22, fontStyle = FontStyle.Bold };
{
fontSize = 24,
fontStyle = FontStyle.Bold
};
string state = ""; string state = "";
if (movement.IsSliding) { style.normal.textColor = Color.yellow; state = " [SLIDE]"; }
else if (!movement.IsGrounded) { style.normal.textColor = Color.green; state = " [AIR]"; }
else style.normal.textColor = Color.white;
// Настраиваем цвет и текст состояния GUI.Label(new Rect(30, 30, 600, 40), $"Speed: {speed:F1} m/s ({csUnits:F0} u/s){state}", style);
if (movement.IsSliding)
{
style.normal.textColor = Color.yellow;
state = " [SLIDE]";
}
else if (!movement.IsGrounded)
{
style.normal.textColor = Color.green;
state = " [AIR]";
}
else
{
style.normal.textColor = Color.white;
}
GUI.Label(new Rect(30, 30, 500, 50), $"Speed: {speed:F1} m/s ({csUnits:F0} u/s){state}", style); if (possession != null && possession.CurrentProfile != null)
{
style.normal.textColor = possession.IsInSpiritForm ? Color.cyan : Color.green;
string bodyInfo = $"Форма: {possession.CurrentProfile.displayName} | HP: {possession.CurrentHealth:F0}/{possession.MaxHealth:F0}";
if (!possession.IsInSpiritForm) bodyInfo += " ([Q] Покинуть тело)";
GUI.Label(new Rect(30, 65, 800, 40), bodyInfo, style);
if (possession.AimedEnemy != null)
{
if (possession.IsTargetInPossessZone)
{
style.normal.textColor = Color.cyan;
GUI.Label(new Rect(Screen.width / 2f - 160f, Screen.height / 2f + 40f, 450f, 40f),
$"[E] ВСЕЛИТЬСЯ: {possession.AimedEnemy.enemyClass}", style);
}
else
{
style.normal.textColor = new Color(1f, 0.5f, 0.5f);
GUI.Label(new Rect(Screen.width / 2f - 180f, Screen.height / 2f + 40f, 500f, 40f),
$"ДАЛЕКО — ВОЙДИ В СФЕРУ ({possession.AimedEnemy.enemyClass})", style);
}
}
}
} }
} }
} }
@@ -0,0 +1,161 @@
using System.Collections.Generic;
using UnityEngine;
namespace _Project.Scripts.PlayerUtils
{
public class Projectile : MonoBehaviour
{
private Vector3 _direction;
private float _speed;
private float _damage;
private float _maxDistance;
private float _radius;
private bool _pierce;
private bool _firedByPlayer;
private GameObject _owner;
private LayerMask _hitMask;
private GameObject _impactPrefab;
private float _traveledDistance;
private readonly HashSet<IDamageable> _hitTargets = new HashSet<IDamageable>();
// Фабрика: создаёт красивый светящийся снаряд со шлейфом прямо из кода!
public static void Spawn(
Vector3 position,
Vector3 direction,
BodyProfile profile,
bool firedByPlayer,
GameObject owner,
LayerMask hitMask,
GameObject impactPrefab = null)
{
var go = GameObject.CreatePrimitive(PrimitiveType.Sphere);
go.name = firedByPlayer ? "PlayerProjectile" : "EnemyProjectile";
go.transform.position = position;
go.transform.localScale = Vector3.one * profile.projectileSize;
// Убираем стандартный коллайдер, так как проверяем полёт точным SphereCast
var col = go.GetComponent<Collider>();
if (col != null) Destroy(col);
// Делаем снаряд ярко светящимся (хорошо видно в полёте для уворотов!)
var rend = go.GetComponent<Renderer>();
if (rend != null)
{
var mat = new Material(Shader.Find("Sprites/Default"));
mat.color = profile.projectileColor;
rend.material = mat;
rend.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
}
// Добавляем красивый шлейф (трассер) за снарядом
var trail = go.AddComponent<TrailRenderer>();
trail.time = 0.18f;
trail.startWidth = profile.projectileSize * 0.85f;
trail.endWidth = 0f;
trail.material = new Material(Shader.Find("Sprites/Default"));
trail.startColor = profile.projectileColor;
trail.endColor = new Color(profile.projectileColor.r, profile.projectileColor.g, profile.projectileColor.b, 0f);
trail.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
var proj = go.AddComponent<Projectile>();
proj._direction = direction.normalized;
proj._speed = profile.projectileSpeed;
proj._damage = firedByPlayer ? profile.damage : profile.damage * 0.5f;
proj._maxDistance = profile.weaponRange;
proj._radius = profile.projectileSize * 0.45f;
proj._pierce = profile.pierceTargets;
proj._firedByPlayer = firedByPlayer;
proj._owner = owner;
proj._hitMask = hitMask;
proj._impactPrefab = impactPrefab;
}
private void Update()
{
// Снаряды летят в мировом времени (Time.deltaTime), поэтому в форме Духа
// они замедляются, позволяя игроку красиво уворачиваться от них!
float step = _speed * Time.deltaTime;
if (step <= 0.0001f) return;
if (_pierce)
{
// Пробивной снаряд Снайпера
var hits = Physics.SphereCastAll(transform.position, _radius, _direction, step, _hitMask, QueryTriggerInteraction.Ignore);
foreach (var hit in hits)
{
if (ShouldIgnore(hit.collider)) continue;
var dmg = hit.collider.GetComponentInParent<IDamageable>();
if (dmg != null)
{
if (_hitTargets.Add(dmg))
{
dmg.TakeDamage(_damage);
SpawnImpact(hit);
}
}
else
{
// Упёрлись в стену/пол — уничтожаем снаряд
SpawnImpact(hit);
Destroy(gameObject);
return;
}
}
}
else
{
// Обычный снаряд: до первого попадания
if (Physics.SphereCast(transform.position, _radius, _direction, out RaycastHit hit, step, _hitMask, QueryTriggerInteraction.Ignore))
{
if (!ShouldIgnore(hit.collider))
{
var dmg = hit.collider.GetComponentInParent<IDamageable>();
if (dmg != null)
{
dmg.TakeDamage(_damage);
}
else if (hit.rigidbody != null)
{
hit.rigidbody.AddForceAtPosition(_direction * (_damage * 8f), hit.point, ForceMode.Impulse);
}
SpawnImpact(hit);
Destroy(gameObject);
return;
}
}
}
transform.position += _direction * step;
_traveledDistance += step;
if (_traveledDistance >= _maxDistance)
{
Destroy(gameObject);
}
}
private bool ShouldIgnore(Collider col)
{
if (_owner != null && (col.gameObject == _owner || col.transform.root.gameObject == _owner))
return true;
// Чтобы враги случайно не расстреливали друг друга в спину, их снаряды бьют только игрока и стены
if (!_firedByPlayer && col.GetComponentInParent<EnemyAI>() != null)
return true;
return false;
}
private void SpawnImpact(RaycastHit hit)
{
if (_impactPrefab != null)
{
var imp = Instantiate(_impactPrefab, hit.point + hit.normal * 0.01f, Quaternion.LookRotation(hit.normal));
Destroy(imp, 2.5f);
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5a79c15e1a66487d8ccb763a8a0af922
timeCreated: 1792606090
@@ -2333,7 +2333,7 @@
"useTexelSize": true, "useTexelSize": true,
"isHDR": false, "isHDR": false,
"m_Modifiable": true, "m_Modifiable": true,
"m_DefaultType": 0 "m_DefaultType": 1
} }
{ {
@@ -3232,7 +3232,7 @@
"m_SerializableColors": [] "m_SerializableColors": []
}, },
"m_TextureType": 0, "m_TextureType": 0,
"m_NormalMapSpace": 1, "m_NormalMapSpace": 0,
"m_EnableGlobalMipBias": true, "m_EnableGlobalMipBias": true,
"m_MipSamplingMode": 0 "m_MipSamplingMode": 0
} }
@@ -1192,7 +1192,7 @@
"m_SerializableColors": [] "m_SerializableColors": []
}, },
"m_TextureType": 0, "m_TextureType": 0,
"m_NormalMapSpace": 1, "m_NormalMapSpace": 0,
"m_EnableGlobalMipBias": true, "m_EnableGlobalMipBias": true,
"m_MipSamplingMode": 0 "m_MipSamplingMode": 0
} }
@@ -3159,7 +3159,7 @@
"useTexelSize": true, "useTexelSize": true,
"isHDR": false, "isHDR": false,
"m_Modifiable": true, "m_Modifiable": true,
"m_DefaultType": 0 "m_DefaultType": 1
} }
{ {
@@ -4410,7 +4410,7 @@
"m_SerializableColors": [] "m_SerializableColors": []
}, },
"m_TextureType": 0, "m_TextureType": 0,
"m_NormalMapSpace": 1, "m_NormalMapSpace": 0,
"m_EnableGlobalMipBias": true, "m_EnableGlobalMipBias": true,
"m_MipSamplingMode": 0 "m_MipSamplingMode": 0
} }
@@ -2076,7 +2076,7 @@
"useTexelSize": true, "useTexelSize": true,
"isHDR": false, "isHDR": false,
"m_Modifiable": true, "m_Modifiable": true,
"m_DefaultType": 0 "m_DefaultType": 1
} }
{ {
+1 -1
View File
@@ -12,7 +12,7 @@ TagManager:
- Water - Water
- UI - UI
- Ceiling - Ceiling
- - Wall
- -
- -
- -