ADD : 의자 프랍 추가 및 스무스 카메라 추가
This commit is contained in:
parent
5142652b19
commit
500565f2b9
8
Assets/ResourcesData/Prop/게이밍 의자.meta
Normal file
8
Assets/ResourcesData/Prop/게이밍 의자.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9ed501768137a4a40b1e1a1773767c98
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/ResourcesData/Prop/게이밍 의자/Model.meta
Normal file
8
Assets/ResourcesData/Prop/게이밍 의자/Model.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 69d44bf962467384faf0c3d79ceda154
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9dbfddd6036f8ba4ab143df35dcc5fa5
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a7e598e1742bc8b46adbfe0abfdd5cfa
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b3a1a54dc0e224d4d89b598bf6582825
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.Textures/Image_0.png
(Stored with Git LFS)
Normal file
BIN
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.Textures/Image_0.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,117 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a417b3809e4729743bac0ba321b0369e
|
||||||
|
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: 2
|
||||||
|
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
|
||||||
|
spriteTessellationDetail: -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: 1
|
||||||
|
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:
|
||||||
BIN
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.Textures/Image_1.standard.png
(Stored with Git LFS)
Normal file
BIN
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.Textures/Image_1.standard.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,117 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 707807c523e9e5947aae1b39f5ed3868
|
||||||
|
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: 2
|
||||||
|
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
|
||||||
|
spriteTessellationDetail: -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: 1
|
||||||
|
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:
|
||||||
BIN
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.Textures/Image_2.normal.png
(Stored with Git LFS)
Normal file
BIN
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.Textures/Image_2.normal.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,117 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c15c08be1ef384d4ba799830d395eb12
|
||||||
|
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: 2
|
||||||
|
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
|
||||||
|
spriteTessellationDetail: -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: 1
|
||||||
|
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:
|
||||||
BIN
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.glb
(Stored with Git LFS)
Normal file
BIN
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.glb
(Stored with Git LFS)
Normal file
Binary file not shown.
32
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.glb.meta
Normal file
32
Assets/ResourcesData/Prop/게이밍 의자/Model/게이밍의자.glb.meta
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 78ab509a6983f4046a3fcce0dc51c7ab
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects:
|
||||||
|
- first:
|
||||||
|
type: UnityEngine:Material
|
||||||
|
assembly: UnityEngine.CoreModule
|
||||||
|
name: 01___Default
|
||||||
|
second: {fileID: 2100000, guid: a7e598e1742bc8b46adbfe0abfdd5cfa, type: 2}
|
||||||
|
- first:
|
||||||
|
type: UnityEngine:Texture
|
||||||
|
assembly: UnityEngine.CoreModule
|
||||||
|
name: Image_0
|
||||||
|
second: {fileID: 2800000, guid: a417b3809e4729743bac0ba321b0369e, type: 3}
|
||||||
|
- first:
|
||||||
|
type: UnityEngine:Texture
|
||||||
|
assembly: UnityEngine.CoreModule
|
||||||
|
name: Image_1.standard
|
||||||
|
second: {fileID: 2800000, guid: 707807c523e9e5947aae1b39f5ed3868, type: 3}
|
||||||
|
- first:
|
||||||
|
type: UnityEngine:Texture
|
||||||
|
assembly: UnityEngine.CoreModule
|
||||||
|
name: Image_2.normal
|
||||||
|
second: {fileID: 2800000, guid: c15c08be1ef384d4ba799830d395eb12, type: 3}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: cc45016b844e7624dae3aec10fb443ea, type: 3}
|
||||||
|
reverseAxis: 2
|
||||||
|
renderPipeline: 1
|
||||||
8
Assets/ResourcesData/Prop/게이밍 의자/Prefab.meta
Normal file
8
Assets/ResourcesData/Prop/게이밍 의자/Prefab.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4a111207d20df8540abb5f168824cc65
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/ResourcesData/Prop/게이밍 의자/Thumbnail.meta
Normal file
8
Assets/ResourcesData/Prop/게이밍 의자/Thumbnail.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: aa686f92d92611e40baca84a3be01a92
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/Streamingle/Utils.meta
Normal file
8
Assets/Scripts/Streamingle/Utils.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5cd2a7f475d8b9c43b30bcb2116fcafc
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
152
Assets/Scripts/Streamingle/Utils/SmoothFollow.cs
Normal file
152
Assets/Scripts/Streamingle/Utils/SmoothFollow.cs
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Streamingle.Utils
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 타겟 오브젝트를 부드럽게 따라가는 컴포넌트
|
||||||
|
/// </summary>
|
||||||
|
public class SmoothFollow : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("Target")]
|
||||||
|
[Tooltip("따라갈 대상 Transform")]
|
||||||
|
public Transform target;
|
||||||
|
|
||||||
|
[Header("Follow Settings")]
|
||||||
|
[Tooltip("위치 따라가기 활성화")]
|
||||||
|
public bool followPosition = true;
|
||||||
|
|
||||||
|
[Tooltip("회전 따라가기 활성화")]
|
||||||
|
public bool followRotation = false;
|
||||||
|
|
||||||
|
[Header("Smoothing")]
|
||||||
|
[Tooltip("위치 보간 속도 (낮을수록 더 부드럽게)")]
|
||||||
|
[Range(0.01f, 20f)]
|
||||||
|
public float positionSmoothSpeed = 5f;
|
||||||
|
|
||||||
|
[Tooltip("회전 보간 속도 (낮을수록 더 부드럽게)")]
|
||||||
|
[Range(0.01f, 20f)]
|
||||||
|
public float rotationSmoothSpeed = 5f;
|
||||||
|
|
||||||
|
[Header("Offset")]
|
||||||
|
[Tooltip("타겟으로부터의 위치 오프셋 (로컬 기준)")]
|
||||||
|
public Vector3 positionOffset = Vector3.zero;
|
||||||
|
|
||||||
|
[Tooltip("타겟으로부터의 회전 오프셋")]
|
||||||
|
public Vector3 rotationOffset = Vector3.zero;
|
||||||
|
|
||||||
|
[Header("Constraints")]
|
||||||
|
[Tooltip("X축 위치 고정")]
|
||||||
|
public bool freezePositionX = false;
|
||||||
|
[Tooltip("Y축 위치 고정")]
|
||||||
|
public bool freezePositionY = false;
|
||||||
|
[Tooltip("Z축 위치 고정")]
|
||||||
|
public bool freezePositionZ = false;
|
||||||
|
|
||||||
|
private Vector3 _initialPosition;
|
||||||
|
private Quaternion _initialRotation;
|
||||||
|
private Vector3 _velocity = Vector3.zero;
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
_initialPosition = transform.position;
|
||||||
|
_initialRotation = transform.rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LateUpdate()
|
||||||
|
{
|
||||||
|
if (target == null) return;
|
||||||
|
|
||||||
|
if (followPosition)
|
||||||
|
{
|
||||||
|
UpdatePosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (followRotation)
|
||||||
|
{
|
||||||
|
UpdateRotation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdatePosition()
|
||||||
|
{
|
||||||
|
// 타겟 위치 + 로컬 오프셋 계산
|
||||||
|
Vector3 targetPosition = target.TransformPoint(positionOffset);
|
||||||
|
|
||||||
|
// 부드러운 보간
|
||||||
|
Vector3 smoothedPosition = Vector3.Lerp(
|
||||||
|
transform.position,
|
||||||
|
targetPosition,
|
||||||
|
positionSmoothSpeed * Time.deltaTime
|
||||||
|
);
|
||||||
|
|
||||||
|
// 축 고정 적용
|
||||||
|
if (freezePositionX) smoothedPosition.x = _initialPosition.x;
|
||||||
|
if (freezePositionY) smoothedPosition.y = _initialPosition.y;
|
||||||
|
if (freezePositionZ) smoothedPosition.z = _initialPosition.z;
|
||||||
|
|
||||||
|
transform.position = smoothedPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateRotation()
|
||||||
|
{
|
||||||
|
Quaternion targetRotation = target.rotation * Quaternion.Euler(rotationOffset);
|
||||||
|
|
||||||
|
transform.rotation = Quaternion.Slerp(
|
||||||
|
transform.rotation,
|
||||||
|
targetRotation,
|
||||||
|
rotationSmoothSpeed * Time.deltaTime
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 타겟을 런타임에 변경
|
||||||
|
/// </summary>
|
||||||
|
public void SetTarget(Transform newTarget)
|
||||||
|
{
|
||||||
|
target = newTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 즉시 타겟 위치로 이동 (보간 없이)
|
||||||
|
/// </summary>
|
||||||
|
public void SnapToTarget()
|
||||||
|
{
|
||||||
|
if (target == null) return;
|
||||||
|
|
||||||
|
if (followPosition)
|
||||||
|
{
|
||||||
|
Vector3 targetPosition = target.TransformPoint(positionOffset);
|
||||||
|
if (freezePositionX) targetPosition.x = _initialPosition.x;
|
||||||
|
if (freezePositionY) targetPosition.y = _initialPosition.y;
|
||||||
|
if (freezePositionZ) targetPosition.z = _initialPosition.z;
|
||||||
|
transform.position = targetPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (followRotation)
|
||||||
|
{
|
||||||
|
transform.rotation = target.rotation * Quaternion.Euler(rotationOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 초기 위치로 복귀
|
||||||
|
/// </summary>
|
||||||
|
public void ResetToInitial()
|
||||||
|
{
|
||||||
|
transform.position = _initialPosition;
|
||||||
|
transform.rotation = _initialRotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
private void OnDrawGizmosSelected()
|
||||||
|
{
|
||||||
|
if (target == null) return;
|
||||||
|
|
||||||
|
Gizmos.color = Color.cyan;
|
||||||
|
Vector3 targetPos = target.TransformPoint(positionOffset);
|
||||||
|
Gizmos.DrawLine(transform.position, targetPos);
|
||||||
|
Gizmos.DrawWireSphere(targetPos, 0.1f);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/Streamingle/Utils/SmoothFollow.cs.meta
Normal file
2
Assets/Scripts/Streamingle/Utils/SmoothFollow.cs.meta
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 53b895a2741ab0c4db91ec0dcb7c1a06
|
||||||
Loading…
x
Reference in New Issue
Block a user