diff --git a/Assets/RoomAssets/Doors/DoubleDoor/DoubleDoors.prefab b/Assets/RoomAssets/Doors/DoubleDoor/DoubleDoors.prefab index a928904..2daf383 100644 --- a/Assets/RoomAssets/Doors/DoubleDoor/DoubleDoors.prefab +++ b/Assets/RoomAssets/Doors/DoubleDoor/DoubleDoors.prefab @@ -115,7 +115,7 @@ Transform: m_GameObject: {fileID: 2843372904200575810} serializedVersion: 2 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_ConstrainProportionsScale: 0 m_Children: @@ -165,6 +165,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 3746822541032507966} + - component: {fileID: 4674200379723888158} m_Layer: 0 m_Name: DoubleDoors m_TagString: Untagged @@ -188,6 +189,27 @@ Transform: - {fileID: 2807690065452777319} m_Father: {fileID: 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 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/RoomAssets/Doors/FactoryDoor.meta b/Assets/RoomAssets/Doors/FactoryDoor.meta new file mode 100644 index 0000000..5ffb6b7 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 36f9248c6699c0e4295c8f863bda9395 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/01_BaseColor.png b/Assets/RoomAssets/Doors/FactoryDoor/01_BaseColor.png new file mode 100644 index 0000000..2b44a14 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/01_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:726dbee6688901ba5841d531f67c1ddaad2b1dff4e2719fa40a2d877c86081d6 +size 5813720 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/01_BaseColor.png.meta b/Assets/RoomAssets/Doors/FactoryDoor/01_BaseColor.png.meta new file mode 100644 index 0000000..66481c9 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/01_BaseColor.png.meta @@ -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: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/01_Metallic.png b/Assets/RoomAssets/Doors/FactoryDoor/01_Metallic.png new file mode 100644 index 0000000..bc0453b --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/01_Metallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3dc795dd04d8c4f5e09933f28b0ff5d405d6eb2e3fb861fe2e05dda7b35fd88e +size 270144 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/01_Metallic.png.meta b/Assets/RoomAssets/Doors/FactoryDoor/01_Metallic.png.meta new file mode 100644 index 0000000..2f57819 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/01_Metallic.png.meta @@ -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: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/01_Normal.png b/Assets/RoomAssets/Doors/FactoryDoor/01_Normal.png new file mode 100644 index 0000000..827d2d4 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/01_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:baf9a99d7c1ea88a354019d1538e0dbfd7f254beb553b6ce6e8728e945b7b92d +size 751873 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/01_Normal.png.meta b/Assets/RoomAssets/Doors/FactoryDoor/01_Normal.png.meta new file mode 100644 index 0000000..9d12efd --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/01_Normal.png.meta @@ -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: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/01_Roughness.png b/Assets/RoomAssets/Doors/FactoryDoor/01_Roughness.png new file mode 100644 index 0000000..061e2b3 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/01_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c0b320e5373aeffddfe3de6eb6c851c0055a4a8d7abe2d68a1bf88e156f0bd1 +size 604735 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/01_Roughness.png.meta b/Assets/RoomAssets/Doors/FactoryDoor/01_Roughness.png.meta new file mode 100644 index 0000000..36d84a8 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/01_Roughness.png.meta @@ -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: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/02_BaseColor.png b/Assets/RoomAssets/Doors/FactoryDoor/02_BaseColor.png new file mode 100644 index 0000000..d2aac3e --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/02_BaseColor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e39a09f070d6f3a856d72acfca1fc5a094b179d453dfd34b723a06addd5cf473 +size 3363824 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/02_BaseColor.png.meta b/Assets/RoomAssets/Doors/FactoryDoor/02_BaseColor.png.meta new file mode 100644 index 0000000..785fdcb --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/02_BaseColor.png.meta @@ -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: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/02_Metallic.png b/Assets/RoomAssets/Doors/FactoryDoor/02_Metallic.png new file mode 100644 index 0000000..3edd6f9 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/02_Metallic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50e116f18af2e0adb9554df36ef63c4d6b4a39daa6001d5b98031041cbfd8a3a +size 127976 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/02_Metallic.png.meta b/Assets/RoomAssets/Doors/FactoryDoor/02_Metallic.png.meta new file mode 100644 index 0000000..0c4e829 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/02_Metallic.png.meta @@ -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: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/02_Normal.png b/Assets/RoomAssets/Doors/FactoryDoor/02_Normal.png new file mode 100644 index 0000000..79d4010 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/02_Normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:192eecc82545ce5dddc3ad7fe368d69d2b7ea6a055a379450d80e4df71c2bbec +size 3599858 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/02_Normal.png.meta b/Assets/RoomAssets/Doors/FactoryDoor/02_Normal.png.meta new file mode 100644 index 0000000..e345368 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/02_Normal.png.meta @@ -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: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/02_Roughness.png b/Assets/RoomAssets/Doors/FactoryDoor/02_Roughness.png new file mode 100644 index 0000000..936526d --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/02_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3de16b5e2cd412178df78f0f07fa368b8821c6cdfc2f56259346878e82ee465 +size 460875 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/02_Roughness.png.meta b/Assets/RoomAssets/Doors/FactoryDoor/02_Roughness.png.meta new file mode 100644 index 0000000..0667a8c --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/02_Roughness.png.meta @@ -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: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/1.mat b/Assets/RoomAssets/Doors/FactoryDoor/1.mat new file mode 100644 index 0000000..7c29bb6 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/1.mat @@ -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 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/1.mat.meta b/Assets/RoomAssets/Doors/FactoryDoor/1.mat.meta new file mode 100644 index 0000000..80cd61e --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/1.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97c133dd693f55b4b9870a95732f9b1a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/2.mat b/Assets/RoomAssets/Doors/FactoryDoor/2.mat new file mode 100644 index 0000000..bcbceed --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/2.mat @@ -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 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/2.mat.meta b/Assets/RoomAssets/Doors/FactoryDoor/2.mat.meta new file mode 100644 index 0000000..dd239fb --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/2.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 71a4dbd1ab99d8d4a9c1b3af4b283897 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/DoubleDoor.prefab b/Assets/RoomAssets/Doors/FactoryDoor/DoubleDoor.prefab new file mode 100644 index 0000000..55d174d --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/DoubleDoor.prefab @@ -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} diff --git a/Assets/RoomAssets/Doors/FactoryDoor/DoubleDoor.prefab.meta b/Assets/RoomAssets/Doors/FactoryDoor/DoubleDoor.prefab.meta new file mode 100644 index 0000000..6540305 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/DoubleDoor.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 18981877707abf547842020ad7b50086 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/Factory door.fbx b/Assets/RoomAssets/Doors/FactoryDoor/Factory door.fbx new file mode 100644 index 0000000..ae1e765 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/Factory door.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:847f27096563478150863a3250c444f5a09cdf04f48f53035d294aad659a5f75 +size 1610912 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/Factory door.fbx.meta b/Assets/RoomAssets/Doors/FactoryDoor/Factory door.fbx.meta new file mode 100644 index 0000000..60f787a --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/Factory door.fbx.meta @@ -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: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/GlassDoor.mat b/Assets/RoomAssets/Doors/FactoryDoor/GlassDoor.mat new file mode 100644 index 0000000..703de06 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/GlassDoor.mat @@ -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 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/GlassDoor.mat.meta b/Assets/RoomAssets/Doors/FactoryDoor/GlassDoor.mat.meta new file mode 100644 index 0000000..1dbb688 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/GlassDoor.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fcb9fd8f56eb8774bbb4d0c8be749c6e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/LitDoor.mat b/Assets/RoomAssets/Doors/FactoryDoor/LitDoor.mat new file mode 100644 index 0000000..b164549 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/LitDoor.mat @@ -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 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/LitDoor.mat.meta b/Assets/RoomAssets/Doors/FactoryDoor/LitDoor.mat.meta new file mode 100644 index 0000000..cebc446 --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/LitDoor.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 67f45623e7d8aa7419d1d52f104bbf87 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RoomAssets/Doors/FactoryDoor/glass_Roughness.png b/Assets/RoomAssets/Doors/FactoryDoor/glass_Roughness.png new file mode 100644 index 0000000..daa34cf --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/glass_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edb49b9fb6f8658d420567214d2283a1e6bcbd036b7b9f01d8a6934c8b7a7cf7 +size 799284 diff --git a/Assets/RoomAssets/Doors/FactoryDoor/glass_Roughness.png.meta b/Assets/RoomAssets/Doors/FactoryDoor/glass_Roughness.png.meta new file mode 100644 index 0000000..0b7a32f --- /dev/null +++ b/Assets/RoomAssets/Doors/FactoryDoor/glass_Roughness.png.meta @@ -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: diff --git a/Assets/RoomAssets/Office/_Textures/Ceiling/Ceiling_Office.mat b/Assets/RoomAssets/Office/_Textures/Ceiling/Ceiling_Office.mat index c95d4f8..d9b1813 100644 --- a/Assets/RoomAssets/Office/_Textures/Ceiling/Ceiling_Office.mat +++ b/Assets/RoomAssets/Office/_Textures/Ceiling/Ceiling_Office.mat @@ -147,7 +147,7 @@ Material: - _SrcBlend: 1 - _SrcBlendAlpha: 1 - _Surface: 0 - - _Tiling: 0.1 + - _Tiling: 0.5 - _WorkflowMode: 1 - _XRMotionVectorsPass: 1 - _ZWrite: 1 diff --git a/Assets/RoomAssets/Office/_Textures/Ceiling/tiles_0125_normal_opengl_4k.png.meta b/Assets/RoomAssets/Office/_Textures/Ceiling/tiles_0125_normal_opengl_4k.png.meta index d79645f..a4ccb83 100644 --- a/Assets/RoomAssets/Office/_Textures/Ceiling/tiles_0125_normal_opengl_4k.png.meta +++ b/Assets/RoomAssets/Office/_Textures/Ceiling/tiles_0125_normal_opengl_4k.png.meta @@ -34,7 +34,7 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 1 + filterMode: 0 aniso: 1 mipBias: 0 wrapU: 0 diff --git a/Assets/RoomAssets/_LightAssets/Corridor.asset b/Assets/RoomAssets/_LightAssets/Corridor.asset index f71f10b..0bd70fb 100644 --- a/Assets/RoomAssets/_LightAssets/Corridor.asset +++ b/Assets/RoomAssets/_LightAssets/Corridor.asset @@ -16,14 +16,14 @@ MonoBehaviour: spacing: 8 ceilingDrop: -0.03 rotationOffset: {x: 0, y: 0, z: 0} - overrideLightParameters: 0 - color: {r: 1, g: 1, b: 1, a: 1} - intensity: 15 + overrideLightParameters: 1 + color: {r: 0.9528302, g: 0.9500425, b: 0.92136884, a: 1} + intensity: 2 range: 15 shadows: 0 bakeToRuntimeLightmap: 1 disableRealtimeLightsAfterBake: 0 - lightmapResolution: 128 - ceilingBounceIntensity: 0.35 - bakedAmbientIntensity: 0.08 - cornerAOStrength: 0.6 + lightmapResolution: 512 + ceilingBounceIntensity: 0.3 + bakedAmbientIntensity: 0.7 + cornerAOStrength: 0.4 diff --git a/Assets/RoomAssets/_LightAssets/Laboratory.asset b/Assets/RoomAssets/_LightAssets/Laboratory.asset index 4dc13f2..8e2a1a5 100644 --- a/Assets/RoomAssets/_LightAssets/Laboratory.asset +++ b/Assets/RoomAssets/_LightAssets/Laboratory.asset @@ -17,13 +17,13 @@ MonoBehaviour: ceilingDrop: -0.03 rotationOffset: {x: -90, y: 0, z: 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: 2 range: 15 shadows: 0 bakeToRuntimeLightmap: 1 disableRealtimeLightsAfterBake: 0 - lightmapResolution: 128 - ceilingBounceIntensity: 0.074 - bakedAmbientIntensity: 0.004 - cornerAOStrength: 0.111 + lightmapResolution: 512 + ceilingBounceIntensity: 0.3 + bakedAmbientIntensity: 0.7 + cornerAOStrength: 0.4 diff --git a/Assets/RoomAssets/_LightAssets/Office.asset b/Assets/RoomAssets/_LightAssets/Office.asset index 7368a2c..9e889f0 100644 --- a/Assets/RoomAssets/_LightAssets/Office.asset +++ b/Assets/RoomAssets/_LightAssets/Office.asset @@ -17,13 +17,13 @@ MonoBehaviour: ceilingDrop: -0.03 rotationOffset: {x: -90, y: 0, z: 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: 2 range: 15 shadows: 0 bakeToRuntimeLightmap: 1 disableRealtimeLightsAfterBake: 0 - lightmapResolution: 128 - ceilingBounceIntensity: 0.074 - bakedAmbientIntensity: 0.004 - cornerAOStrength: 0.111 + lightmapResolution: 512 + ceilingBounceIntensity: 0.3 + bakedAmbientIntensity: 0.7 + cornerAOStrength: 0.4 diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 5dfd9f3..6ea2ab3 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -2686,13 +2686,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 146683184} 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_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: -162.5, y: 0, z: 0} --- !u!114 &146683187 MonoBehaviour: m_ObjectHideFlags: 0 @@ -13850,7 +13850,7 @@ MonoBehaviour: lengthStartRoom: 10 lengthLiftRoom: 10 widthLiftRoom: 5 - lengthFloor: 100 + lengthFloor: 200 corridorLength: 4 corridorWigth: 3 minRoomCount: 10 @@ -13908,6 +13908,11 @@ MonoBehaviour: planeBaseSize: 10 wallHeight: 5 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 MonoBehaviour: m_ObjectHideFlags: 0 @@ -19042,63 +19047,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] 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 PrefabInstance: m_ObjectHideFlags: 0 @@ -32446,7 +32394,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &1706114974 MonoBehaviour: m_ObjectHideFlags: 0 @@ -32483,7 +32431,7 @@ Light: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1706114973} - m_Enabled: 1 + m_Enabled: 0 serializedVersion: 13 m_Type: 2 m_Color: {r: 1, g: 1, b: 1, a: 1} @@ -43184,14 +43132,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d9d6178191654e72a147db739b22275f, type: 3} m_Name: m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.PlayerUtils.PlayerCombat - damage: 25 - fireRate: 0.12 - weaponRange: 100 + canShoot: 1 hitLayers: serializedVersion: 2 m_Bits: 4294967295 - isAutomatic: 1 - recoilKick: 1.2 muzzleFlash: {fileID: 0} impactPrefab: {fileID: 0} cameraPosition: {fileID: 5685763764745351606} @@ -43235,6 +43179,7 @@ MonoBehaviour: moveSpeed: 10 sprintSpeed: 18 crouchSpeed: 5 + canSlide: 1 slideInitialSpeed: 50 slideDuration: 0.85 slideFriction: 2.8 @@ -43243,7 +43188,6 @@ MonoBehaviour: groundAcceleration: 10 airAcceleration: 30 airCap: 1.8 - showSpeedometer: 1 jumpHeight: 2 gravity: -27 fallMultiplier: 2 @@ -43295,7 +43239,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8184cc49f30946f4802bbf1bbe841e2f, type: 3} m_Name: m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.PlayerUtils.PlayerUI - showSpeedometer: 1 + showHUD: 1 --- !u!4 &5016588167603968964 stripped Transform: m_CorrespondingSourceObject: {fileID: 1672666446545052606, guid: 51510de34f82041149d25090ec962e10, type: 3} @@ -45238,4 +45182,3 @@ SceneRoots: - {fileID: 740097205} - {fileID: 552049569} - {fileID: 1706114976} - - {fileID: 978029648} diff --git a/Assets/Scenes/Main/Global Volume Profile.asset b/Assets/Scenes/Main/Global Volume Profile.asset index 277969c..e904584 100644 --- a/Assets/Scenes/Main/Global Volume Profile.asset +++ b/Assets/Scenes/Main/Global Volume Profile.asset @@ -17,11 +17,11 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 1 threshold: - m_OverrideState: 1 + m_OverrideState: 0 m_Value: 1.48 intensity: m_OverrideState: 1 - m_Value: 10.58 + m_Value: 15 scatter: m_OverrideState: 0 m_Value: 0.727 @@ -29,8 +29,8 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 65472 tint: - m_OverrideState: 0 - m_Value: {r: 1, g: 0.7311321, b: 0.7311321, a: 1} + m_OverrideState: 1 + m_Value: {r: 1, g: 1, b: 1, a: 1} highQualityFiltering: m_OverrideState: 0 m_Value: 0 diff --git a/Assets/_Project/Scripts/Enemy.meta b/Assets/_Project/Scripts/Enemy.meta new file mode 100644 index 0000000..9c75200 --- /dev/null +++ b/Assets/_Project/Scripts/Enemy.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: af2dacc7d53248c98287d3cde20c56bc +timeCreated: 1792605140 \ No newline at end of file diff --git a/Assets/_Project/Scripts/Enemy/EnemyAI.cs b/Assets/_Project/Scripts/Enemy/EnemyAI.cs new file mode 100644 index 0000000..72f3952 --- /dev/null +++ b/Assets/_Project/Scripts/Enemy/EnemyAI.cs @@ -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(); + _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(); + _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); + } + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Scripts/Enemy/EnemyAI.cs.meta b/Assets/_Project/Scripts/Enemy/EnemyAI.cs.meta new file mode 100644 index 0000000..2254ccb --- /dev/null +++ b/Assets/_Project/Scripts/Enemy/EnemyAI.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d49ace5afc784259b944f30ef5d3e613 +timeCreated: 1792605144 \ No newline at end of file diff --git a/Assets/_Project/Scripts/LevelGenerating/DoorController.cs b/Assets/_Project/Scripts/LevelGenerating/DoorController.cs new file mode 100644 index 0000000..10b1d05 --- /dev/null +++ b/Assets/_Project/Scripts/LevelGenerating/DoorController.cs @@ -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(); + if (col == null || !col.isTrigger) + { + var trigger = gameObject.AddComponent(); + 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"); + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Scripts/LevelGenerating/DoorController.cs.meta b/Assets/_Project/Scripts/LevelGenerating/DoorController.cs.meta new file mode 100644 index 0000000..b9b20c0 --- /dev/null +++ b/Assets/_Project/Scripts/LevelGenerating/DoorController.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5850387c1f4a4054bb33e19563ddb215 +timeCreated: 1792595120 \ No newline at end of file diff --git a/Assets/_Project/Scripts/LevelGenerating/FloorData.cs b/Assets/_Project/Scripts/LevelGenerating/FloorData.cs index c726f09..ea50cc7 100644 --- a/Assets/_Project/Scripts/LevelGenerating/FloorData.cs +++ b/Assets/_Project/Scripts/LevelGenerating/FloorData.cs @@ -5,54 +5,38 @@ namespace _Project.Scripts.LevelGenerating { public enum FloorKind { - Generated, // обычный этаж: раскладка -> роли -> стены -> наполнение - Special // готовая локация (крыша с боссом), собрана вручную, генератор не нужен + Generated, + Special } - // ===================================================================== - // Данные ОДНОГО этажа. Заменяет статический LevelManager.Rooms. - // Все координаты и размеры комнат - в МОДУЛЯХ (1 модуль = 0.5 м), см. LevelGrid. - // - // НЕ ЗАБЫТЬ: - // - Для сохранения в файл этот класс НЕ годится напрямую: Room использует свойства, - // которые JsonUtility не сериализует. Для диска нужны отдельные структуры (FloorSave) - // с публичными полями, а FloorData остаётся рабочим объектом генерации. - // - Parent / CorridorOf живут в WallsGenerator (нужны только при генерации раскладки). - // ===================================================================== public class FloorData { - public int Index; // номер этажа (0-based) + public int Index; public FloorKind Kind; - public int Seed; // пока не используется (сид "пох"), поле на будущее - public string SpecialId; // для Special: id префаба локации, например "BossRoof" - public int SizeModules; // сторона карты этажа в модулях (для Generated) + public int Seed; + public string SpecialId; + public int SizeModules; public readonly List Rooms = new List(); public readonly Dictionary Depth = new Dictionary(); - // Отрезки стен (заполняет ShellBuilder.Build) + // Отрезки стен и дверные проёмы (заполняет ShellBuilder.Build) public readonly List Walls = new List(); + public readonly List Doorways = new List(); - public Room Start; // стартовая комната (вход с предыдущего этажа) - public Room Lift; // комната с лифтом (выход на следующий этаж) + public Room Start; + public Room Lift; // ---------- Выборки ---------- public IEnumerable Corridors => Rooms.Where(r => r.rt == RoomType.Corridor); - - // Всё, кроме коридоров (старт, лифт и обычные комнаты) public IEnumerable PlayableRooms => Rooms.Where(r => r.rt != RoomType.Corridor); - - // Комнаты, которым ещё не назначена роль public IEnumerable UnassignedRooms => Rooms.Where(r => r.rt == RoomType.Undefined); - public IEnumerable OfType(RoomType type) => Rooms.Where(r => r.rt == type); - public int GetDepth(Room room) => Depth.TryGetValue(room, out int d) ? d : -1; // ---------- Изменение ---------- - // Добавить комнату (не коридор) вместе с глубиной public void AddRoom(Room room, int depth) { Rooms.Add(room); @@ -62,7 +46,6 @@ namespace _Project.Scripts.LevelGenerating else if (room.rt == RoomType.Lift) Lift = room; } - // Коридоры глубины не имеют public void AddCorridor(Room corridor) => Rooms.Add(corridor); public void Remove(Room room) @@ -78,6 +61,7 @@ namespace _Project.Scripts.LevelGenerating Rooms.Clear(); Depth.Clear(); Walls.Clear(); + Doorways.Clear(); Start = null; Lift = null; } diff --git a/Assets/_Project/Scripts/LevelGenerating/RoomEnemySpawnConfig.cs b/Assets/_Project/Scripts/LevelGenerating/RoomEnemySpawnConfig.cs new file mode 100644 index 0000000..5ee737c --- /dev/null +++ b/Assets/_Project/Scripts/LevelGenerating/RoomEnemySpawnConfig.cs @@ -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 enemyPool = new List + { + 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 } + }; + } +} \ No newline at end of file diff --git a/Assets/_Project/Scripts/LevelGenerating/RoomEnemySpawnConfig.cs.meta b/Assets/_Project/Scripts/LevelGenerating/RoomEnemySpawnConfig.cs.meta new file mode 100644 index 0000000..876ff11 --- /dev/null +++ b/Assets/_Project/Scripts/LevelGenerating/RoomEnemySpawnConfig.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 543780e1d0e842ca96364a1f94696107 +timeCreated: 1792605497 \ No newline at end of file diff --git a/Assets/_Project/Scripts/LevelGenerating/RoomGenerators.cs b/Assets/_Project/Scripts/LevelGenerating/RoomGenerators.cs index 669d051..3d93344 100644 --- a/Assets/_Project/Scripts/LevelGenerating/RoomGenerators.cs +++ b/Assets/_Project/Scripts/LevelGenerating/RoomGenerators.cs @@ -1,21 +1,15 @@ using System.Collections.Generic; +using _Project.Scripts.PlayerUtils; using UnityEngine; namespace _Project.Scripts.LevelGenerating { - // ===================================================================== - // Генератор, который оформляет одну комнату после того, как построены её меши. - // Специальные комнаты (лифт, старт) получают свои реализации, - // обычные - универсальный ThemedRoomGenerator. - // ===================================================================== public interface IRoomGenerator { bool Supports(Room room); void Generate(RoomView view, FloorData floor, RoomTheme theme); } - // Универсальный генератор: материалы из темы и сетка светильников под потолком. - // Позже сюда добавится расстановка предметов по правилам темы. public class ThemedRoomGenerator : IRoomGenerator { public bool Supports(Room room) => true; @@ -35,17 +29,21 @@ namespace _Project.Scripts.LevelGenerating if (theme.lightConfig != null) { 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 renderers, Material mat) { - if (mat == null) return; // остаётся материал префаба + if (mat == null) return; foreach (var r in renderers) r.sharedMaterial = mat; } - // Сетка светильников: спавнит префаб из RoomLightConfig и применяет параметры private static void CreateLights(RoomView view, RoomLightConfig config) { Vector3 size = view.SizeMeters; @@ -66,8 +64,8 @@ namespace _Project.Scripts.LevelGenerating for (int iz = 0; iz < nz; iz++) { Vector3 pos = origin + new Vector3( - (ix + 0.5f) / nx * size.x, - y, + (ix + 0.5f) / nx * size.x, + y, (iz + 0.5f) / nz * size.z); GameObject lightGo; @@ -79,7 +77,6 @@ namespace _Project.Scripts.LevelGenerating } else { - // Запасной вариант, если префаб забыли назначить в SO lightGo = new GameObject($"FallbackLight_{ix}_{iz}"); lightGo.transform.SetParent(lightsRoot, false); lightGo.transform.SetPositionAndRotation(pos, rot); @@ -87,7 +84,6 @@ namespace _Project.Scripts.LevelGenerating fallbackLight.type = LightType.Point; } - // Если включена перезапись параметров (или сработал запасной вариант без префаба) if (config.overrideLightParameters || config.lightPrefab == null) { var lights = lightGo.GetComponentsInChildren(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(); + + 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 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(); + if (renderer != null) + { + renderer.material.color = classColor; + } + } + + go.name = $"Enemy_{index}_{cls}"; + + var ai = go.GetComponent(); + if (ai == null) ai = go.AddComponent(); + + ai.enemyClass = cls; + ai.profile = BodyProfile.CreateDefault(cls); + + return ai; + } } } \ No newline at end of file diff --git a/Assets/_Project/Scripts/LevelGenerating/RoomTheme.cs b/Assets/_Project/Scripts/LevelGenerating/RoomTheme.cs index 42438d0..06966c2 100644 --- a/Assets/_Project/Scripts/LevelGenerating/RoomTheme.cs +++ b/Assets/_Project/Scripts/LevelGenerating/RoomTheme.cs @@ -2,11 +2,6 @@ namespace _Project.Scripts.LevelGenerating { - // ===================================================================== - // Набор оформления комнаты: материалы, конфиг освещения и пропсы. - // Создаётся в проекте: ПКМ -> Create -> Level -> Room Theme. - // Новая тема - это новые данные, код не меняется. - // ===================================================================== [CreateAssetMenu(menuName = "Level/Room Theme", fileName = "RoomTheme")] public class RoomTheme : ScriptableObject { @@ -19,6 +14,12 @@ namespace _Project.Scripts.LevelGenerating [Tooltip("Конфиг света с префабом и настройками. Если пусто — света в комнате не будет.")] public RoomLightConfig lightConfig; + [Header("Враги")] + [Tooltip("Спавнить ли врагов в этой комнате (для Коридоров и Лифта выключается автоматически)")] + public bool spawnEnemies = true; + [Tooltip("Опциональный конфиг спавна. Если пусто — классы врагов подберутся автоматически под тип комнаты!")] + public RoomEnemySpawnConfig enemyConfig; + [Header("Предметы (опционально)")] public RoomPropSet propSet; } diff --git a/Assets/_Project/Scripts/LevelGenerating/RoomView.cs b/Assets/_Project/Scripts/LevelGenerating/RoomView.cs index 6ea2465..77b18d2 100644 --- a/Assets/_Project/Scripts/LevelGenerating/RoomView.cs +++ b/Assets/_Project/Scripts/LevelGenerating/RoomView.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using _Project.Scripts.PlayerUtils; using UnityEngine; namespace _Project.Scripts.LevelGenerating @@ -12,8 +13,9 @@ namespace _Project.Scripts.LevelGenerating public readonly List FloorRenderers = new List(); public readonly List CeilingRenderers = new List(); public readonly List WallRenderers = new List(); - //public readonly List Doors = new List(); - public readonly List BakedLightmaps = new List(); + public readonly List Doors = new List(); + public readonly List Enemies = new List(); + public List BakedLightmaps = new List(); public Vector3 OriginMeters => 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) { - if (rt != null) rt.Release(); + if (rt != null) + { + rt.Release(); + Destroy(rt); + } } BakedLightmaps.Clear(); } diff --git a/Assets/_Project/Scripts/LevelGenerating/RuntimeRoomLightmapBaker.cs b/Assets/_Project/Scripts/LevelGenerating/RuntimeRoomLightmapBaker.cs index e5a8843..1d01f5a 100644 --- a/Assets/_Project/Scripts/LevelGenerating/RuntimeRoomLightmapBaker.cs +++ b/Assets/_Project/Scripts/LevelGenerating/RuntimeRoomLightmapBaker.cs @@ -19,8 +19,26 @@ namespace _Project.Scripts.LevelGenerating public static void BakeRoom(RoomView view, RoomLightConfig config) { - if (config == null || !config.bakeToRuntimeLightmap) return; + var targets = new List(); + 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) { var shader = Shader.Find("Hidden/LevelGenerating/UVRoomBaker"); @@ -80,10 +98,7 @@ namespace _Project.Scripts.LevelGenerating rMin.y)); // 3. Собираем все рендереры комнаты (пол, потолок, стены) - var targets = new List(); - targets.AddRange(view.FloorRenderers); - targets.AddRange(view.CeilingRenderers); - targets.AddRange(view.WallRenderers); + var cmd = new CommandBuffer { name = $"BakeRoom_{view.Index}" }; var mpb = new MaterialPropertyBlock(); @@ -108,6 +123,10 @@ namespace _Project.Scripts.LevelGenerating // Назначаем напрямую в инстанс материала (100% работает с любым Shader Graph и SRP Batcher!) r.material.SetTexture(LightmapTexProp, rt); + + r.GetPropertyBlock(mpb); + mpb.SetTexture(LightmapTexProp, rt); + r.SetPropertyBlock(mpb); } // Выполняем запекание на GPU мгновенно @@ -115,12 +134,19 @@ namespace _Project.Scripts.LevelGenerating cmd.Release(); // 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; } + } } } diff --git a/Assets/_Project/Scripts/LevelGenerating/ShellBuilder.cs b/Assets/_Project/Scripts/LevelGenerating/ShellBuilder.cs index 8aca51d..360301d 100644 --- a/Assets/_Project/Scripts/LevelGenerating/ShellBuilder.cs +++ b/Assets/_Project/Scripts/LevelGenerating/ShellBuilder.cs @@ -3,14 +3,8 @@ using UnityEngine; namespace _Project.Scripts.LevelGenerating { - // Куда смотрит видимая сторона стены (внутрь комнаты или коридора) public enum WallFacing { XP, XN, ZP, ZN } - // Прямой отрезок стены по линии сетки (координаты в модулях). - // Start - точка на линии сетки, с которой отрезок начинается. - // Для ZP/ZN отрезок идёт вдоль +X, для XP/XN - вдоль +Z. - // RoomIndex - индекс комнаты в FloorData.Rooms, которой принадлежит стена. - // Поля публичные, чтобы потом сохранять в файл. [System.Serializable] public struct WallRun { @@ -28,26 +22,38 @@ namespace _Project.Scripts.LevelGenerating } } - // ===================================================================== - // Строит отрезки стен из FloorData. Спавна здесь нет, только данные. - // - // Правила: - // - Стена стоит на границе прямоугольника комнаты (плоскость без толщины). - // - У коридора стены только по двум длинным сторонам, торцы открыты. - // - В стенах комнат вырезаются проёмы шириной ровно с коридор. - // - Каждый отрезок помнит комнату-владельца (RoomIndex). - // ===================================================================== + // Дверной проём в стене (для перемычки над дверью и спавна самой двойной двери) + [System.Serializable] + public struct Doorway + { + public Vector2Int Start; + public int Length; + public WallFacing Facing; + 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 { private struct Gap { - public bool Vertical; // линия x = Line (вертикальная), иначе z = Line + public bool Vertical; public int Line, From, To; } public static void Build(FloorData floor) { floor.Walls.Clear(); + floor.Doorways.Clear(); var gaps = CollectGaps(floor); for (int i = 0; i < floor.Rooms.Count; i++) @@ -58,16 +64,22 @@ namespace _Project.Scripts.LevelGenerating if (r.rt == RoomType.Corridor) { - // у коридора проёмов нет, его торцы просто открыты + // Длинные стороны коридора — стены, а на торцах — перемычки над дверью (обращённые внутрь коридора) if (IsAlongX(r)) { AddSide(floor, i, false, z0, x0, x1, WallFacing.ZP, 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 { AddSide(floor, i, true, x0, z0, z1, WallFacing.XP, 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 @@ -80,7 +92,6 @@ namespace _Project.Scripts.LevelGenerating } } - // Коридор идёт вдоль X, если его выход по оси X (запасной вариант: длинная сторона) private static bool IsAlongX(Room c) { if (c.exits != null && c.exits.Count > 0) @@ -88,7 +99,6 @@ namespace _Project.Scripts.LevelGenerating return c.Length >= c.Width; } - // Места, где коридор упирается в стены комнат private static List CollectGaps(FloorData floor) { var gaps = new List(); @@ -112,7 +122,6 @@ namespace _Project.Scripts.LevelGenerating return gaps; } - // Добавляет сторону [from, to] на линии line, вырезая проёмы private static void AddSide(FloorData floor, int owner, bool vertical, int line, int from, int to, WallFacing facing, List gaps) { @@ -129,6 +138,13 @@ namespace _Project.Scripts.LevelGenerating foreach (var g in own) { 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); } } @@ -142,5 +158,12 @@ namespace _Project.Scripts.LevelGenerating Vector2Int start = vertical ? new Vector2Int(line, a) : new Vector2Int(a, line); 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)); + } } } \ No newline at end of file diff --git a/Assets/_Project/Scripts/LevelGenerating/ShellSpawner.cs b/Assets/_Project/Scripts/LevelGenerating/ShellSpawner.cs index acf6fbb..243cad6 100644 --- a/Assets/_Project/Scripts/LevelGenerating/ShellSpawner.cs +++ b/Assets/_Project/Scripts/LevelGenerating/ShellSpawner.cs @@ -6,24 +6,10 @@ namespace _Project.Scripts.LevelGenerating public class ShellResult { public Transform Root; - public List Views = new List(); // индекс совпадает с FloorData.Rooms + public List Views = new List(); + public List AllDoors = new List(); } - // ===================================================================== - // Спавнит пол, потолок и стены из одного префаба-плоскости. - // Для каждой комнаты создаётся объект Room_N_Тип с компонентом RoomView. - // Материалы здесь НЕ назначаются: этим занимаются генераторы комнат (RoomTheme). - // - // Требования к префабу: - // - Unity Plane (3D Object -> Plane): лежит в XZ, нормаль +Y, размер 10x10 при scale 1. - // Если размер другой (например 1x1), поменяй planeBaseSize. Quad не подойдёт: у него нормаль -Z. - // - Меш и Renderer на корне префаба. Коллайдеры на префабе игнорируются и заменяются на Box. - // - // Все плоскости видны только с одной стороны (внутрь комнаты): - // стены смотрят внутрь, пол вверх, потолок вниз. - // - // НЕ ЗАБЫТЬ: сейчас сюда попадает и комната лифта. Позже у неё будет свой фиксированный префаб. - // ===================================================================== public class ShellSpawner : MonoBehaviour { [SerializeField] private GameObject planePrefab; @@ -31,6 +17,18 @@ namespace _Project.Scripts.LevelGenerating [SerializeField] private float wallHeight = 3f; [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) { if (planePrefab == null) @@ -44,6 +42,9 @@ namespace _Project.Scripts.LevelGenerating Root = new GameObject($"Floor_{floor.Index}_Shell").transform }; + int groundLayer = LayerMask.NameToLayer("Ground"); + int ceilingLayer = LayerMask.NameToLayer("Ceiling"); + // 1. Объект на каждую комнату + пол и потолок 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), Quaternion.identity, scale, true); - floorGo.layer = LayerMask.NameToLayer("Ground"); + if (groundLayer != -1) floorGo.layer = groundLayer; view.FloorRenderers.AddRange(floorGo.GetComponentsInChildren()); - // потолок: перевёрнут, нормаль вниз var ceilingGo = Make(roomGo.transform, "Ceiling", new Vector3(c.x, wallHeight, c.z), Quaternion.Euler(180f, 0f, 0f), scale, false); - ceilingGo.layer = LayerMask.NameToLayer("Ceiling"); + if (ceilingLayer != -1) ceilingGo.layer = ceilingLayer; view.CeilingRenderers.AddRange(ceilingGo.GetComponentsInChildren()); } - // 2. Стены раскладываются по комнатам-владельцам + // 2. Сплошные стены раскладываются по комнатам-владельцам foreach (var run in floor.Walls) { if (run.RoomIndex < 0 || run.RoomIndex >= result.Views.Count) @@ -83,48 +83,159 @@ namespace _Project.Scripts.LevelGenerating Debug.LogWarning($"Стена ссылается на несуществующую комнату {run.RoomIndex}"); 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; } - private void SpawnWall(RoomView view, WallRun run) + private void SpawnDoorway(RoomView view, Doorway dw, ShellResult result) { - float len = run.Length * LevelGrid.Module; - float y = wallHeight / 2f; - float sx = run.Start.x * LevelGrid.Module; - float sz = run.Start.y * LevelGrid.Module; + // 1. Объёмная перемычка над дверью (от doorHeight до wallHeight) + float topWallHeight = wallHeight - doorHeight; + if (topWallHeight > 0.01f) + { + 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(); + if (controller == null) controller = doorGo.AddComponent(); + + 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()); + } + } + + 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; Quaternion rot; Vector3 scale; - switch (run.Facing) + switch (facing) { - case WallFacing.ZP: // идёт вдоль X, нормаль +Z - pos = new Vector3(sx + len / 2f, y, sz); + case WallFacing.ZP: + pos = new Vector3(sx + len / 2f, y, sz + forwardOffset); rot = Quaternion.Euler(90f, 0f, 0f); - scale = new Vector3(len / planeBaseSize, 1f, wallHeight / planeBaseSize); + scale = new Vector3(len / planeBaseSize, 1f, pieceHeight / planeBaseSize); break; - case WallFacing.ZN: // идёт вдоль X, нормаль -Z - pos = new Vector3(sx + len / 2f, y, sz); + case WallFacing.ZN: + pos = new Vector3(sx + len / 2f, y, sz - forwardOffset); rot = Quaternion.Euler(-90f, 0f, 0f); - scale = new Vector3(len / planeBaseSize, 1f, wallHeight / planeBaseSize); + scale = new Vector3(len / planeBaseSize, 1f, pieceHeight / planeBaseSize); break; - case WallFacing.XP: // идёт вдоль Z, нормаль +X - pos = new Vector3(sx, y, sz + len / 2f); + case WallFacing.XP: + pos = new Vector3(sx + forwardOffset, y, sz + len / 2f); rot = Quaternion.Euler(0f, 0f, -90f); - scale = new Vector3(wallHeight / planeBaseSize, 1f, len / planeBaseSize); + scale = new Vector3(pieceHeight / planeBaseSize, 1f, len / planeBaseSize); break; - default: // XN: идёт вдоль Z, нормаль -X - pos = new Vector3(sx, y, sz + len / 2f); + default: // XN + pos = new Vector3(sx - forwardOffset, y, sz + len / 2f); rot = Quaternion.Euler(0f, 0f, 90f); - scale = new Vector3(wallHeight / planeBaseSize, 1f, len / planeBaseSize); + scale = new Vector3(pieceHeight / planeBaseSize, 1f, len / planeBaseSize); 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()); } @@ -135,12 +246,10 @@ namespace _Project.Scripts.LevelGenerating go.name = name; go.transform.localScale = scale; - // коллайдеры префаба не используем: у плоскости нет толщины foreach (var c in go.GetComponents()) Destroy(c); if (withCollider) { - // Box прячем за видимой стороной (локальный -Y), чтобы он не съедал место внутри комнаты var box = go.AddComponent(); box.size = new Vector3(planeBaseSize, colliderThickness, planeBaseSize); box.center = new Vector3(0f, -colliderThickness / 2f, 0f); diff --git a/Assets/_Project/Scripts/Player.cs b/Assets/_Project/Scripts/Player.cs index 0e513cc..5b87090 100644 --- a/Assets/_Project/Scripts/Player.cs +++ b/Assets/_Project/Scripts/Player.cs @@ -12,7 +12,8 @@ namespace _Project.Scripts public PlayerCamera CameraController { get; private set; } public PlayerCombat Combat { 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() { @@ -24,7 +25,9 @@ namespace _Project.Scripts CameraController = GetComponent(); Combat = GetComponent(); Sound = GetComponent(); - UI = GetComponent(); + UI = GetComponent(); + Possession = GetComponent(); + if (Possession == null) Possession = gameObject.AddComponent(); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; diff --git a/Assets/_Project/Scripts/PlayerUtils/BodyProfile.cs b/Assets/_Project/Scripts/PlayerUtils/BodyProfile.cs new file mode 100644 index 0000000..d3997dd --- /dev/null +++ b/Assets/_Project/Scripts/PlayerUtils/BodyProfile.cs @@ -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(); + 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; + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Scripts/PlayerUtils/BodyProfile.cs.meta b/Assets/_Project/Scripts/PlayerUtils/BodyProfile.cs.meta new file mode 100644 index 0000000..359bb53 --- /dev/null +++ b/Assets/_Project/Scripts/PlayerUtils/BodyProfile.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8addb03ef12f4e9eb6834129b77b5969 +timeCreated: 1792605123 \ No newline at end of file diff --git a/Assets/_Project/Scripts/PlayerUtils/PlayerCamera.cs b/Assets/_Project/Scripts/PlayerUtils/PlayerCamera.cs index 84548a8..4e263dc 100644 --- a/Assets/_Project/Scripts/PlayerUtils/PlayerCamera.cs +++ b/Assets/_Project/Scripts/PlayerUtils/PlayerCamera.cs @@ -1,5 +1,4 @@ using UnityEngine; -using UnityEngine.InputSystem; namespace _Project.Scripts.PlayerUtils { @@ -24,6 +23,8 @@ namespace _Project.Scripts.PlayerUtils [SerializeField] private float sprintBobAmount = 0.07f; [SerializeField] private float impactRecoverySpeed = 6f; + public Transform CameraTransform => cameraPosition; + private PlayerControls controls; private PlayerMovement movement; @@ -47,6 +48,23 @@ namespace _Project.Scripts.PlayerUtils 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() { HandleMouseLook(); @@ -56,12 +74,13 @@ namespace _Project.Scripts.PlayerUtils private void HandleMouseLook() { Vector2 lookInput = controls.Player.Look.ReadValue(); + float dt = Time.unscaledDeltaTime; cameraPitch -= lookInput.y * mouseSensitivity; cameraPitch = Mathf.Clamp(cameraPitch, -maxLookAngle, maxLookAngle); 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); @@ -71,9 +90,10 @@ namespace _Project.Scripts.PlayerUtils private void HandleCameraAndBobbing() { + float dt = Time.unscaledDeltaTime; bool isLowered = movement.IsCrouching || movement.IsSliding; 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; @@ -82,13 +102,12 @@ namespace _Project.Scripts.PlayerUtils float speed = movement.IsSprinting ? sprintBobSpeed : walkBobSpeed; float amount = movement.IsSprinting ? sprintBobAmount : walkBobAmount; - bobTimer += Time.deltaTime * speed; + bobTimer += dt * speed; bobOffset.x = Mathf.Cos(bobTimer * 0.5f) * amount; bobOffset.y = Mathf.Sin(bobTimer) * amount; if (Mathf.Sin(bobTimer) <= -0.9f && !stepTaken) { - // ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ Player.Instance.Sound.PlayFootstep(movement.IsSprinting); stepTaken = true; } @@ -98,10 +117,10 @@ namespace _Project.Scripts.PlayerUtils { bobTimer = 0f; 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); } diff --git a/Assets/_Project/Scripts/PlayerUtils/PlayerCombat.cs b/Assets/_Project/Scripts/PlayerUtils/PlayerCombat.cs index 5fb1901..10cfde7 100644 --- a/Assets/_Project/Scripts/PlayerUtils/PlayerCombat.cs +++ b/Assets/_Project/Scripts/PlayerUtils/PlayerCombat.cs @@ -5,13 +5,9 @@ namespace _Project.Scripts.PlayerUtils { public class PlayerCombat : MonoBehaviour { - [Header("Оружие и Стрельба (Hitscan)")] - [SerializeField] private float damage = 25f; - [SerializeField] private float fireRate = 0.12f; - [SerializeField] private float weaponRange = 100f; + [Header("Оружие и Стрельба (Projectiles)")] + [SerializeField] private bool canShoot = true; [SerializeField] private LayerMask hitLayers = ~0; - [SerializeField] private bool isAutomatic = true; - [SerializeField] private float recoilKick = 1.2f; [Header("Эффекты (без звука)")] [SerializeField] private ParticleSystem muzzleFlash; @@ -21,6 +17,7 @@ namespace _Project.Scripts.PlayerUtils [SerializeField] private Transform cameraPosition; private PlayerControls controls; + private BodyProfile currentProfile; private float shootTimer = 0f; private bool isShootingInput = false; @@ -32,45 +29,51 @@ namespace _Project.Scripts.PlayerUtils controls.Player.Attack.canceled += _ => isShootingInput = false; } + public void ApplyProfile(BodyProfile profile) + { + currentProfile = profile; + canShoot = profile.canShoot; + shootTimer = 0f; + } + 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) { Shoot(); + if (!isAuto) isShootingInput = false; } } private void Shoot() { - shootTimer = fireRate; + shootTimer = currentProfile.fireRate; - // ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ Player.Instance.Sound.PlayShoot(); - if (muzzleFlash != null) muzzleFlash.Play(); - Player.Instance.CameraController.ApplyRecoil(recoilKick); + Player.Instance.CameraController.ApplyRecoil(currentProfile.recoilKick); - Ray ray = new Ray(cameraPosition.position, cameraPosition.forward); - if (Physics.Raycast(ray, out RaycastHit hit, weaponRange, hitLayers, QueryTriggerInteraction.Ignore)) + int pellets = Mathf.Max(1, currentProfile.pelletsPerShot); + 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(out var damageable)) + Vector3 dir = cameraPosition.forward; + if (spread > 0.01f) { - damageable.TakeDamage(damage); - } - else if (hit.rigidbody != null) - { - hit.rigidbody.AddForceAtPosition(-hit.normal * (damage * 10f), hit.point, ForceMode.Impulse); + dir = Quaternion.Euler( + Random.Range(-spread, spread), + Random.Range(-spread, spread), 0f) * dir; } - if (impactPrefab != null) - { - GameObject impact = Instantiate(impactPrefab, hit.point + (hit.normal * 0.001f), Quaternion.LookRotation(hit.normal)); - Destroy(impact, 3f); - } + Projectile.Spawn(spawnPos, dir, currentProfile, true, gameObject, hitLayers, impactPrefab); } } } diff --git a/Assets/_Project/Scripts/PlayerUtils/PlayerMovement.cs b/Assets/_Project/Scripts/PlayerUtils/PlayerMovement.cs index c33418c..382c67f 100644 --- a/Assets/_Project/Scripts/PlayerUtils/PlayerMovement.cs +++ b/Assets/_Project/Scripts/PlayerUtils/PlayerMovement.cs @@ -12,6 +12,7 @@ namespace _Project.Scripts.PlayerUtils [SerializeField] private float crouchSpeed = 3f; [Header("Параметры Подката (Slide)")] + [SerializeField] private bool canSlide = true; [SerializeField] private float slideInitialSpeed = 15f; [SerializeField] private float slideDuration = 0.85f; [SerializeField] private float slideFriction = 2.8f; @@ -22,7 +23,6 @@ namespace _Project.Scripts.PlayerUtils [SerializeField] private float groundAcceleration = 10f; [SerializeField] private float airAcceleration = 80f; [SerializeField] private float airCap = 2.0f; - [SerializeField] private bool showSpeedometer = true; [Header("Гравитация и Прыжок")] [SerializeField] private float jumpHeight = 1.35f; @@ -47,6 +47,7 @@ namespace _Project.Scripts.PlayerUtils public bool IsSliding { get; private set; } public Vector2 MoveInput { get; private set; } public float CurrentSpeed => horizontalVelocity.magnitude; + private bool wasGrounded; private float jumpBufferTimer = 0f; private Vector3 horizontalVelocity = Vector3.zero; @@ -57,15 +58,16 @@ namespace _Project.Scripts.PlayerUtils private Vector3 slideDirection = Vector3.zero; private float slideCooldownTimer = 0f; - private void Start() + private void Awake() { rb = GetComponent(); col = GetComponent(); - rb.useGravity = false; rb.freezeRotation = true; - rb.interpolation = RigidbodyInterpolation.None; + } + private void Start() + { controls = Player.Instance.Controls; controls.Player.Sprint.started += _ => IsSprinting = true; @@ -77,12 +79,35 @@ namespace _Project.Scripts.PlayerUtils 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() { MoveInput = controls.Player.Move.ReadValue(); - if (jumpBufferTimer > 0f) jumpBufferTimer -= Time.deltaTime; - if (slideCooldownTimer > 0f) slideCooldownTimer -= Time.deltaTime; + float dt = Time.unscaledDeltaTime; + if (jumpBufferTimer > 0f) jumpBufferTimer -= dt; + if (slideCooldownTimer > 0f) slideCooldownTimer -= dt; if (Mouse.current != null && Mathf.Abs(Mouse.current.scroll.y.ReadValue()) > 0.1f) QueueJump(); @@ -100,7 +125,11 @@ namespace _Project.Scripts.PlayerUtils 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; } @@ -108,7 +137,7 @@ namespace _Project.Scripts.PlayerUtils { bool isLowered = IsCrouching || IsSliding; 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); } @@ -126,8 +155,6 @@ namespace _Project.Scripts.PlayerUtils jumpBufferTimer = 0f; Player.Instance.CameraController.TriggerJumpImpact(); - - // ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ Player.Instance.Sound.PlayJump(); } @@ -201,7 +228,6 @@ namespace _Project.Scripts.PlayerUtils if (!wasGrounded && IsGrounded) { - // ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ Player.Instance.Sound.PlayLand(); } @@ -217,7 +243,7 @@ namespace _Project.Scripts.PlayerUtils 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; } @@ -235,7 +261,6 @@ namespace _Project.Scripts.PlayerUtils slideDirection = (transform.forward * MoveInput.y + transform.right * MoveInput.x).normalized; if (slideDirection.sqrMagnitude < 0.01f) slideDirection = transform.forward; - // ВЫЗОВ ЗВУКА ИЗ НОВОГО МОДУЛЯ Player.Instance.Sound.PlaySlide(); } @@ -244,6 +269,5 @@ namespace _Project.Scripts.PlayerUtils IsSliding = false; slideCooldownTimer = slideCooldown; } - } } \ No newline at end of file diff --git a/Assets/_Project/Scripts/PlayerUtils/PlayerPossession.cs b/Assets/_Project/Scripts/PlayerUtils/PlayerPossession.cs new file mode 100644 index 0000000..bee67df --- /dev/null +++ b/Assets/_Project/Scripts/PlayerUtils/PlayerPossession.cs @@ -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(); + if (col != null) Destroy(col); + + _zoneRenderer = _zoneSphere.GetComponent(); + _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(); + 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; + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Scripts/PlayerUtils/PlayerPossession.cs.meta b/Assets/_Project/Scripts/PlayerUtils/PlayerPossession.cs.meta new file mode 100644 index 0000000..bd8f613 --- /dev/null +++ b/Assets/_Project/Scripts/PlayerUtils/PlayerPossession.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 246649c648e14696bc2cac61522a8d66 +timeCreated: 1792605158 \ No newline at end of file diff --git a/Assets/_Project/Scripts/PlayerUtils/PlayerSound.cs b/Assets/_Project/Scripts/PlayerUtils/PlayerSound.cs index abfe195..270be1b 100644 --- a/Assets/_Project/Scripts/PlayerUtils/PlayerSound.cs +++ b/Assets/_Project/Scripts/PlayerUtils/PlayerSound.cs @@ -17,25 +17,25 @@ namespace _Project.Scripts.PlayerUtils [Header("Звуки Оружия")] [SerializeField] private AudioClip shootSound; + private float _baseFootstepPitch = 1f; + private void Reset() { - // Автоматически подцепит AudioSource при добавлении скрипта на объект audioSource = GetComponent(); } + public void SetFootstepPitch(float pitch) => _baseFootstepPitch = pitch; + public void PlayFootstep(bool isSprinting) { if (footstepSounds == null || footstepSounds.Length == 0) return; int randomIndex = Random.Range(0, footstepSounds.Length); - - // Немного меняем высоту звука для разнообразия - audioSource.pitch = Random.Range(0.9f, 1.1f); + audioSource.pitch = _baseFootstepPitch * Random.Range(0.92f, 1.08f); float volume = isSprinting ? 0.6f : 0.4f; audioSource.PlayOneShot(footstepSounds[randomIndex], volume); - - audioSource.pitch = 1f; // Сбрасываем питч обратно + audioSource.pitch = 1f; } public void PlayJump() diff --git a/Assets/_Project/Scripts/PlayerUtils/PlayerUI.cs b/Assets/_Project/Scripts/PlayerUtils/PlayerUI.cs index 846167f..44bf221 100644 --- a/Assets/_Project/Scripts/PlayerUtils/PlayerUI.cs +++ b/Assets/_Project/Scripts/PlayerUtils/PlayerUI.cs @@ -5,49 +5,56 @@ namespace _Project.Scripts.PlayerUtils public class PlayerUI : MonoBehaviour { [Header("Настройки Интерфейса")] - [SerializeField] private bool showSpeedometer = true; + [SerializeField] private bool showHUD = true; private PlayerMovement movement; + private PlayerPossession possession; private void Start() { - // Берем ссылку на компонент передвижения через фасад Player movement = Player.Instance.Movement; + possession = Player.Instance.Possession; } private void OnGUI() { - if (!showSpeedometer || movement == null) return; + if (!showHUD || movement == null) return; - // Читаем публичное свойство скорости (мы добавим его ниже) float speed = movement.CurrentSpeed; float csUnits = speed * 38.5f; - GUIStyle style = new GUIStyle - { - fontSize = 24, - fontStyle = FontStyle.Bold - }; + GUIStyle style = new GUIStyle { fontSize = 22, fontStyle = FontStyle.Bold }; 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; - // Настраиваем цвет и текст состояния - 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); - 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); + } + } + } } } } \ No newline at end of file diff --git a/Assets/_Project/Scripts/Utilities/Projectile.cs b/Assets/_Project/Scripts/Utilities/Projectile.cs new file mode 100644 index 0000000..39cda5e --- /dev/null +++ b/Assets/_Project/Scripts/Utilities/Projectile.cs @@ -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 _hitTargets = new HashSet(); + + // Фабрика: создаёт красивый светящийся снаряд со шлейфом прямо из кода! + 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(); + if (col != null) Destroy(col); + + // Делаем снаряд ярко светящимся (хорошо видно в полёте для уворотов!) + var rend = go.GetComponent(); + 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(); + 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(); + 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(); + 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(); + 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() != 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); + } + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Scripts/Utilities/Projectile.cs.meta b/Assets/_Project/Scripts/Utilities/Projectile.cs.meta new file mode 100644 index 0000000..0289ef5 --- /dev/null +++ b/Assets/_Project/Scripts/Utilities/Projectile.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5a79c15e1a66487d8ccb763a8a0af922 +timeCreated: 1792606090 \ No newline at end of file diff --git a/Assets/_Project/Shaders/TextureTilingParallaxFloorNCeiling.shadergraph b/Assets/_Project/Shaders/TextureTilingParallaxFloorNCeiling.shadergraph index 33d4039..5791eb2 100644 --- a/Assets/_Project/Shaders/TextureTilingParallaxFloorNCeiling.shadergraph +++ b/Assets/_Project/Shaders/TextureTilingParallaxFloorNCeiling.shadergraph @@ -2333,7 +2333,7 @@ "useTexelSize": true, "isHDR": false, "m_Modifiable": true, - "m_DefaultType": 0 + "m_DefaultType": 1 } { @@ -3232,7 +3232,7 @@ "m_SerializableColors": [] }, "m_TextureType": 0, - "m_NormalMapSpace": 1, + "m_NormalMapSpace": 0, "m_EnableGlobalMipBias": true, "m_MipSamplingMode": 0 } diff --git a/Assets/_Project/Shaders/TextureTilingParallaxFloorNCeilingWithMetallicMap.shadergraph b/Assets/_Project/Shaders/TextureTilingParallaxFloorNCeilingWithMetallicMap.shadergraph index a7429cb..9574b37 100644 --- a/Assets/_Project/Shaders/TextureTilingParallaxFloorNCeilingWithMetallicMap.shadergraph +++ b/Assets/_Project/Shaders/TextureTilingParallaxFloorNCeilingWithMetallicMap.shadergraph @@ -1192,7 +1192,7 @@ "m_SerializableColors": [] }, "m_TextureType": 0, - "m_NormalMapSpace": 1, + "m_NormalMapSpace": 0, "m_EnableGlobalMipBias": true, "m_MipSamplingMode": 0 } @@ -3159,7 +3159,7 @@ "useTexelSize": true, "isHDR": false, "m_Modifiable": true, - "m_DefaultType": 0 + "m_DefaultType": 1 } { @@ -4410,7 +4410,7 @@ "m_SerializableColors": [] }, "m_TextureType": 0, - "m_NormalMapSpace": 1, + "m_NormalMapSpace": 0, "m_EnableGlobalMipBias": true, "m_MipSamplingMode": 0 } diff --git a/Assets/_Project/Shaders/TextureTilingParallaxWall.shadergraph b/Assets/_Project/Shaders/TextureTilingParallaxWall.shadergraph index 9395c09..c53f0f7 100644 --- a/Assets/_Project/Shaders/TextureTilingParallaxWall.shadergraph +++ b/Assets/_Project/Shaders/TextureTilingParallaxWall.shadergraph @@ -2076,7 +2076,7 @@ "useTexelSize": true, "isHDR": false, "m_Modifiable": true, - "m_DefaultType": 0 + "m_DefaultType": 1 } { diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 9c23c84..fc9e54e 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -12,7 +12,7 @@ TagManager: - Water - UI - Ceiling - - + - Wall - - -