몬스터 스포너 추가

This commit is contained in:
Mingu Kim
2025-02-26 21:42:37 +09:00
parent 934709ce19
commit 7dcd603a7d
33 changed files with 150 additions and 795 deletions

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 616d067a52513694ca481247f775bc62
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 538007106005a574b8912e62f777d038
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 27727760c76785949b436fd33685fd86
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 94b015ea725e5da4096da41df540ac8d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,643 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1342664882880856222
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8588915526847560493}
- component: {fileID: 7341249599799714319}
- component: {fileID: 8316546459892616994}
m_Layer: 3
m_Name: Hp
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8588915526847560493
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1342664882880856222}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3806437718625476131}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: -0.00000023841858, y: 0.00000023841858}
m_SizeDelta: {x: 2.9522, y: 0.3064}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &7341249599799714319
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1342664882880856222}
m_CullTransparentMesh: 1
--- !u!114 &8316546459892616994
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1342664882880856222}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &1824938196022665753
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8233097455695040023}
- component: {fileID: 6768085599137241520}
- component: {fileID: 2777078016143330253}
m_Layer: 3
m_Name: Eyesight
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8233097455695040023
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1824938196022665753}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 9, y: 1, z: 11}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4522428252352058427}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!58 &6768085599137241520
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1824938196022665753}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 1
--- !u!114 &2777078016143330253
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1824938196022665753}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0eeefb865ea9d4749bbb4de3d1100f3e, type: 3}
m_Name:
m_EditorClassIdentifier:
_monsterBase: {fileID: 4707985683249688333}
--- !u!1 &3369157119847235756
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3806437718625476131}
- component: {fileID: 3280851039149585887}
- component: {fileID: 32222485337476293}
m_Layer: 3
m_Name: HpBackground
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3806437718625476131
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3369157119847235756}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8588915526847560493}
m_Father: {fileID: 2494811353512019803}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0.3355, y: 3.26}
m_SizeDelta: {x: 2.9522, y: 0.3064}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3280851039149585887
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3369157119847235756}
m_CullTransparentMesh: 1
--- !u!114 &32222485337476293
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3369157119847235756}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4212413503337481881
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4522428252352058427}
- component: {fileID: 5636364246843047355}
- component: {fileID: 6630971208790554073}
- component: {fileID: 1937602755592253170}
- component: {fileID: 8193311856622011356}
- component: {fileID: 3755389356996766134}
- component: {fileID: 4593226769141903835}
- component: {fileID: 4707985683249688333}
m_Layer: 3
m_Name: BlackTroll
m_TagString: Monster
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4522428252352058427
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4212413503337481881}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 12.15, y: -8.27, z: 0.060982164}
m_LocalScale: {x: 0.7, y: 0.7, z: 0.7}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8233097455695040023}
- {fileID: 8768173046820514165}
- {fileID: 2494811353512019803}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &5636364246843047355
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4212413503337481881}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 4723107735738678597, guid: bcbbef56a1b541009f884abefb133b11, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 1
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 8, y: 8}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &6630971208790554073
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4212413503337481881}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c29cff538c195c249b69c6f2236de67b, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Library: []
m_SpriteLibraryAsset: {fileID: 7108339969198208228, guid: 74d9c7111be66834895cd23526f9bc77, type: 3}
--- !u!114 &1937602755592253170
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4212413503337481881}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ed8b1ae4e4e52b34ea557c1c11e076fc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_CategoryHash: 0.009161512
m_labelHash: 1.3971405e-28
m_SpriteKey: 0
m_SpriteHash: 163368403
--- !u!70 &8193311856622011356
CapsuleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4212413503337481881}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 1.5}
m_Size: {x: 3, y: 3.2}
m_Direction: 0
--- !u!50 &3755389356996766134
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4212413503337481881}
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 10
m_GravityScale: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 4
--- !u!95 &4593226769141903835
Animator:
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4212413503337481881}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: c2be6a32c13b7d24fb2d789462ff8e2f, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!114 &4707985683249688333
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4212413503337481881}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3}
m_Name:
m_EditorClassIdentifier:
_target: {fileID: 0}
_collider: {fileID: 6768085599137241520}
_spriteRenderer: {fileID: 5636364246843047355}
_textState: {fileID: 0}
id: 0
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
--- !u!1 &5517639527144806737
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8768173046820514165}
- component: {fileID: 8111482399369284950}
- component: {fileID: 534568266464302360}
m_Layer: 3
m_Name: AttackRange
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8768173046820514165
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5517639527144806737}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 9, y: 1, z: 11}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4522428252352058427}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!58 &8111482399369284950
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5517639527144806737}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.5
--- !u!114 &534568266464302360
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5517639527144806737}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0913d8f50c531ce4585705c1366b8351, type: 3}
m_Name:
m_EditorClassIdentifier:
_monsterBase: {fileID: 4707985683249688333}
--- !u!1 &6961622495070510740
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2494811353512019803}
- component: {fileID: 4511828911534615108}
- component: {fileID: 6868299405778376069}
- component: {fileID: 2547895694325741063}
m_Layer: 3
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2494811353512019803
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6961622495070510740}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.060982164}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3806437718625476131}
m_Father: {fileID: 4522428252352058427}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: -0.49759865, y: 0}
m_SizeDelta: {x: 1895.1191, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!223 &4511828911534615108
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6961622495070510740}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 0
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!114 &6868299405778376069
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6961622495070510740}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 1
--- !u!114 &2547895694325741063
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6961622495070510740}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 55

View File

@@ -18124,7 +18124,7 @@ GameObject:
- component: {fileID: 1057011346}
m_Layer: 9
m_Name: Tilemap untagged
m_TagString: Untagged
m_TagString: Ground
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@@ -19771,9 +19771,23 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 481676f31fc794c4b93848b442416f2c, type: 3}
m_Name:
m_EditorClassIdentifier:
_monsterLocations: []
_monsterId:
_spawnDistance: 10
spawnPoints:
- {fileID: 1877559506}
- {fileID: 897622737}
currentWave: 0
waveDataArray:
- monsterPrefabA: {fileID: 9096056522544909490, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
monsterPrefabB: {fileID: 5532926939721588456, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
bossPrefab: {fileID: 552750714948243596, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
- monsterPrefabA: {fileID: 1572774641510885509, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
monsterPrefabB: {fileID: 3763998402670485858, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
bossPrefab: {fileID: 8816565783318691943, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
- monsterPrefabA: {fileID: 5723786479962814242, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
monsterPrefabB: {fileID: 7872183108645210487, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
bossPrefab: {fileID: 4336427122757065448, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
- monsterPrefabA: {fileID: 0}
monsterPrefabB: {fileID: 0}
bossPrefab: {fileID: 3667660097767351871, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
--- !u!4 &1103604663
Transform:
m_ObjectHideFlags: 0

View File

@@ -99,6 +99,7 @@ namespace TON
if (prevHP > 0 && currentHP <= 0)
{
_stateMachine.SetTransition(new DeathState());
//TODO : 현재 웨이브 값, 경험치, 골드 MonsterSpawner.WaveData;
}
else if (prevHP > 0 && currentHP > 0)
{

View File

@@ -1,3 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -5,148 +6,162 @@ namespace TON
{
public class MonsterSpawner : MonoBehaviour
{
[SerializeField]
private List<Transform> _monsterLocations = new List<Transform>();
[SerializeField]
private List<int> _monsterId = new List<int>();
[SerializeField]
private float _spawnDistance = 10f;
public Transform[] spawnPoints; // 스폰 위치 배열
private CharacterBase _player;
private List<MonsterBase> _spawnedMonsters = new List<MonsterBase>();
private Dictionary<Transform, bool> _spawnPoints = new Dictionary<Transform, bool>();
private List<GameObject> monsterPool; // 몬스터 오브젝트 풀
private List<int> availableSpawnPoints; // 스폰 가능한 위치 인덱스 리스트
private void Start()
public int currentWave = 0;
private const int TOTAL_WAVES = 10;
private const int NORMAL_MONSTER_COUNT = 6;
private float nextWaveDelay = 5f; // 다음 웨이브 시작 전 대기 시간
private bool isWaitingForNextWave = false;
[System.Serializable]
public class WaveData
{
InitializeSpawner();
public GameObject monsterPrefabA; // 첫 번째 일반 몬스터 프리팹
public GameObject monsterPrefabB; // 두 번째 일반 몬스터 프리팹
public GameObject bossPrefab; // 보스 몬스터 프리팹
}
private void InitializeSpawner()
public WaveData[] waveDataArray; // 크기 4로 설정 (1-3웨이브, 4-6웨이브, 7-9웨이브, 10웨이브)
private List<GameObject> activeMonsters; // 현재 활성화된 몬스터 리스트
// Start is called before the first frame update
void Start()
{
// 플레이어 찾기
GameObject playerObj = GameObject.FindGameObjectWithTag("Player");
if (playerObj != null)
monsterPool = new List<GameObject>();
availableSpawnPoints = new List<int>();
activeMonsters = new List<GameObject>();
StartNextWave();
}
// Update is called once per frame
void Update()
{
_player = playerObj.GetComponent<CharacterBase>();
Debug.Log("플레이어 찾음: " + playerObj.name);
// 활성화된 몬스터 리스트에서 파괴된 몬스터 제거
activeMonsters.RemoveAll(monster => monster == null);
// 모든 몬스터가 죽었는지 확인하고 다음 웨이브 준비
if (activeMonsters.Count == 0 && currentWave > 0 && !isWaitingForNextWave)
{
isWaitingForNextWave = true;
StartCoroutine(StartNextWaveWithDelay());
}
}
private void SpawnBossMonster()
{
// 랜덤한 스폰 포인트 선택
int spawnPointIndex = Random.Range(0, spawnPoints.Length);
GameObject bossPrefab = GetBossPrefabForWave(currentWave);
GameObject boss = Instantiate(bossPrefab, spawnPoints[spawnPointIndex].position, Quaternion.identity);
monsterPool.Add(boss);
activeMonsters.Add(boss);
// 보스 웨이브에서는 자동으로 다음 웨이브로 넘어가지 않음
// 보스가 죽으면 Update에서 체크하여 다음 웨이브로 넘어감
}
private void StartNextWave()
{
currentWave++;
if (currentWave > TOTAL_WAVES)
{
// Debug.Log("모든 웨이브 완료!");
return;
}
// 스폰 포인트 초기화
foreach (var location in _monsterLocations)
availableSpawnPoints.Clear();
for (int i = 0; i < spawnPoints.Length; i++)
{
if (location != null)
availableSpawnPoints.Add(i);
}
// 현재 웨이브에 따른 몬스터 스폰
if (IsBossWave(currentWave))
{
_spawnPoints[location] = false;
Debug.Log($"스폰 포인트 초기화: {location.name}");
SpawnBossMonster();
}
else
{
SpawnNormalMonsters();
}
}
private bool IsBossWave(int wave)
{
return wave == 3 || wave == 6 || wave == 9 || wave == 10;
}
private GameObject GetBossPrefabForWave(int wave)
{
switch (wave)
{
case 3: return waveDataArray[0].bossPrefab; // 첫 번째 보스
case 6: return waveDataArray[1].bossPrefab; // 두 번째 보스
case 9: return waveDataArray[2].bossPrefab; // 세 번째 보스
case 10: return waveDataArray[3].bossPrefab; // 최종 보스
default: return null;
}
}
private void SpawnNormalMonsters()
{
if (currentWave == 7 || currentWave == 8)
{
for (int i = 0; i < NORMAL_MONSTER_COUNT + 2; i++)
{
foreach (Transform spawnPoint in spawnPoints)
{
GameObject normalMonster = Instantiate(GetNormalMonsterPrefab(), spawnPoint.position, Quaternion.identity);
monsterPool.Add(normalMonster);
activeMonsters.Add(normalMonster);
}
}
}
else
{
// 각 스폰 포인트에 일반 몬스터 6마리씩 한 번만 스폰
for (int i = 0; i < NORMAL_MONSTER_COUNT; i++)
{
foreach (Transform spawnPoint in spawnPoints)
{
GameObject normalMonster = Instantiate(GetNormalMonsterPrefab(), spawnPoint.position, Quaternion.identity);
monsterPool.Add(normalMonster);
activeMonsters.Add(normalMonster);
}
}
}
private void Update()
// 일반 웨이브에서는 자동으로 다음 웨이브로 넘어가지 않음
// 몬스터가 모두 죽으면 Update에서 체크하여 다음 웨이브로 넘어감
}
private GameObject GetNormalMonsterPrefab()
{
if (_player == null) return;
// 현재 웨이브에 해당하는 일반 몬스터 프리팹 반환
int waveSetIndex = (currentWave - 1) / 3; // 웨이브 세트 인덱스 (0-2)
CheckSpawnConditions();
// 각 세트의 두 번째 웨이브인 경우 monsterPrefabB 반환
bool isSecondWave = (currentWave % 3) == 2;
return isSecondWave ?
waveDataArray[waveSetIndex].monsterPrefabB :
waveDataArray[waveSetIndex].monsterPrefabA;
}
private void CheckSpawnConditions()
private IEnumerator StartNextWaveWithDelay()
{
for (int i = 0; i < _monsterLocations.Count; i++)
{
Transform spawnPoint = _monsterLocations[i];
if (spawnPoint == null || _spawnPoints[spawnPoint]) continue;
float distance = Vector2.Distance(_player.transform.position, spawnPoint.position);
if (distance <= _spawnDistance)
{
SpawnMonster(i);
_spawnPoints[spawnPoint] = true;
}
}
}
private void SpawnMonster(int index)
{
if (index >= _monsterId.Count)
{
Debug.LogError($"유효하지 않은 인덱스: {index}");
return;
}
try
{
int monsterId = _monsterId[index];
// MonsterDataManager에서 데이터 가져오기
MonsterData monsterData = MonsterDataManager.Singleton.GetMonsterData(monsterId);
if (monsterData == null)
{
Debug.LogError($"몬스터 ID {monsterId}에 대한 데이터를 찾을 수 없습니다.");
return;
}
// 몬스터 프리팹 경로 결정
string prefabPath = GetMonsterPrefabPath(monsterData);
// 프리팹 로드
MonsterBase monsterPrefab = Resources.Load<MonsterBase>(prefabPath);
if (monsterPrefab == null)
{
Debug.LogError($"몬스터 프리팹을 찾을 수 없습니다: {prefabPath}");
return;
}
// 몬스터 생성
Vector3 spawnPosition = _monsterLocations[index].position;
MonsterBase newMonster = Instantiate(monsterPrefab, spawnPosition, Quaternion.identity);
// 몬스터 초기화
newMonster.id = monsterId;
_spawnedMonsters.Add(newMonster);
Debug.Log($"몬스터 생성 완료: ID {monsterId}, 위치 {spawnPosition}");
}
catch (System.Exception e)
{
Debug.LogError($"몬스터 생성 중 오류 발생: {e.Message}");
}
}
private string GetMonsterPrefabPath(MonsterData monsterData)
{
// 몬스터 데이터에 따른 프리팹 경로 결정
string basePath = "MonsterPrefabs/";
// 일반 몬스터인 경우
if (monsterData.id == 6)
{
return basePath + "Nomal/BlackTroll";
}
// 기타 몬스터들
Dictionary<int, string> monsterNames = new Dictionary<int, string>
{
{ 1, "BlueDragon" },
{ 2, "BrownWerewolf" },
{ 3, "GreenDragon" },
{ 4, "PurpleOgre" },
{ 5, "RedWerewolf" }
};
if (monsterNames.TryGetValue(monsterData.id, out string monsterName))
{
return basePath + monsterName;
}
throw new System.Exception($"알 수 없는 몬스터 ID: {monsterData.id}");
}
public void OnMonsterDestroyed(MonsterBase monster)
{
if (_spawnedMonsters.Contains(monster))
{
_spawnedMonsters.Remove(monster);
}
yield return new WaitForSeconds(nextWaveDelay);
isWaitingForNextWave = false;
StartNextWave();
}
}
}