몬스터 공격시 캐릭터 데미지 대상 지정 및 몬스터 피격 시 HP바 감소

This commit is contained in:
Mingu Kim
2025-02-28 02:15:32 +09:00
parent b96aac99f7
commit 5e893a029f
7 changed files with 750 additions and 93 deletions

View File

@@ -3788,6 +3788,63 @@ Sprite:
m_PhysicsShape: [] m_PhysicsShape: []
m_Bones: [] m_Bones: []
m_SpriteID: m_SpriteID:
--- !u!1001 &82556497
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalPosition.x
value: 11.76
objectReference: {fileID: 0}
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalPosition.y
value: -8.61
objectReference: {fileID: 0}
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7108907486717331319, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7872183108645210487, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
propertyPath: m_Name
value: GreenTroll
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a1014c89b622fee45b5d0bf0db78b302, type: 3}
--- !u!114 &87909817 --- !u!114 &87909817
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -6074,13 +6131,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3} m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
id: 0
defencePower: 10
_spriteRenderer: {fileID: 135546803}
_textState: {fileID: 0}
_target: {fileID: 0} _target: {fileID: 0}
_collider: {fileID: 0} _collider: {fileID: 0}
_spriteRenderer: {fileID: 135546803}
id: 0
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0} _hpBarImage: {fileID: 0}
Gold: 0
Exp: 0
Score: 0
--- !u!4 &141676838 stripped --- !u!4 &141676838 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 866829735663616565, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3} m_CorrespondingSourceObject: {fileID: 866829735663616565, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3}
@@ -7448,6 +7508,63 @@ Sprite:
m_PhysicsShape: [] m_PhysicsShape: []
m_Bones: [] m_Bones: []
m_SpriteID: m_SpriteID:
--- !u!1001 &176923650
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3763998402670485858, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_Name
value: RedOgre
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalPosition.x
value: -0.55
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalPosition.y
value: -1.48
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7438065038316332652, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2151274950f0a5848b4a51f328ef6a76, type: 3}
--- !u!213 &180436636 --- !u!213 &180436636
Sprite: Sprite:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -12493,6 +12610,63 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0} m_InstancedGameObject: {fileID: 0}
m_Flags: 3 m_Flags: 3
m_ColliderType: 1 m_ColliderType: 1
--- !u!1001 &290283583
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalPosition.x
value: 9.05
objectReference: {fileID: 0}
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalPosition.y
value: -8.66
objectReference: {fileID: 0}
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4702461567519613494, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5723786479962814242, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
propertyPath: m_Name
value: GreenOgre
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 32e162a1c8f5e97418bfde9de9a34472, type: 3}
--- !u!114 &293544350 --- !u!114 &293544350
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -18441,6 +18615,63 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0} m_InstancedGameObject: {fileID: 0}
m_Flags: 3 m_Flags: 3
m_ColliderType: 1 m_ColliderType: 1
--- !u!1001 &497096654
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 552750714948243596, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_Name
value: GreenRex
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalPosition.x
value: 1.45
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalPosition.y
value: -8.99
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 783986106382903823, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: b5a25c8b3779cf64fb2ce4137b923934, type: 3}
--- !u!114 &498519155 --- !u!114 &498519155
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -19905,6 +20136,63 @@ Sprite:
m_PhysicsShape: [] m_PhysicsShape: []
m_Bones: [] m_Bones: []
m_SpriteID: m_SpriteID:
--- !u!1001 &528600923
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalPosition.x
value: -3.69
objectReference: {fileID: 0}
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalPosition.y
value: 6.49
objectReference: {fileID: 0}
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1842826254400309060, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3667660097767351871, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
propertyPath: m_Name
value: RedDragon (2)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ef14281ca23119941b755a7bff7ff6c8, type: 3}
--- !u!213 &529414279 --- !u!213 &529414279
Sprite: Sprite:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -45983,6 +46271,63 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0} m_InstancedGameObject: {fileID: 0}
m_Flags: 3 m_Flags: 3
m_ColliderType: 1 m_ColliderType: 1
--- !u!1001 &1179696156
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 5532926939721588456, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_Name
value: YellowPumpkin
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalPosition.x
value: 14.72
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalPosition.y
value: 1.12
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6350789727210486896, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: b4cf92d97c6e476458cfc19779d644d0, type: 3}
--- !u!114 &1181599274 --- !u!114 &1181599274
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -48251,13 +48596,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3} m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
id: 0
defencePower: 10
_spriteRenderer: {fileID: 1254298208}
_textState: {fileID: 0}
_target: {fileID: 1333310376} _target: {fileID: 1333310376}
_collider: {fileID: 199081697} _collider: {fileID: 199081697}
_spriteRenderer: {fileID: 1254298208}
id: 0
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0} _hpBarImage: {fileID: 0}
Gold: 0
Exp: 0
Score: 0
--- !u!95 &1254298203 --- !u!95 &1254298203
Animator: Animator:
serializedVersion: 5 serializedVersion: 5
@@ -51926,6 +52274,63 @@ Sprite:
m_PhysicsShape: [] m_PhysicsShape: []
m_Bones: [] m_Bones: []
m_SpriteID: m_SpriteID:
--- !u!1001 &1355169652
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1572774641510885509, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_Name
value: GreenPumpkin
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalPosition.x
value: -9.58
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalPosition.y
value: -2.18
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2098035876610685192, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9e33f09b69def354b97c2dab989ff5a0, type: 3}
--- !u!114 &1365688280 --- !u!114 &1365688280
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -52374,6 +52779,63 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0} m_InstancedGameObject: {fileID: 0}
m_Flags: 3 m_Flags: 3
m_ColliderType: 1 m_ColliderType: 1
--- !u!1001 &1393283644
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4336427122757065448, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_Name
value: RedRex
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalPosition.x
value: 7.3
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalPosition.y
value: 3.59
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
--- !u!114 &1393456201 --- !u!114 &1393456201
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -53067,6 +53529,63 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0} m_InstancedGameObject: {fileID: 0}
m_Flags: 3 m_Flags: 3
m_ColliderType: 1 m_ColliderType: 1
--- !u!1001 &1423548762
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalPosition.x
value: 5.33
objectReference: {fileID: 0}
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalPosition.y
value: -9.16
objectReference: {fileID: 0}
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8244087370906109303, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8816565783318691943, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
propertyPath: m_Name
value: BlueRex
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6aa4e890ef61e8340a0913d21ef8b769, type: 3}
--- !u!114 &1425460697 --- !u!114 &1425460697
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -72636,7 +73155,7 @@ PrefabInstance:
m_Modifications: m_Modifications:
- target: {fileID: 3656570700648378249, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3} - target: {fileID: 3656570700648378249, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: TON.Player_W value: TON.Player
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3656570700648378249, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3} - target: {fileID: 3656570700648378249, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
@@ -72648,11 +73167,11 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3} - target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: -2.06 value: -13.83
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3} - target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: -7.82 value: -7.52
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3} - target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
@@ -73004,13 +73523,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3} m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
id: 0
defencePower: 10
_spriteRenderer: {fileID: 2041544010}
_textState: {fileID: 0}
_target: {fileID: 1333310376} _target: {fileID: 1333310376}
_collider: {fileID: 483107484} _collider: {fileID: 483107484}
_spriteRenderer: {fileID: 2041544010}
id: 0
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0} _hpBarImage: {fileID: 0}
Gold: 0
Exp: 0
Score: 0
--- !u!95 &2041544005 --- !u!95 &2041544005
Animator: Animator:
serializedVersion: 5 serializedVersion: 5
@@ -75271,6 +75793,63 @@ Sprite:
m_PhysicsShape: [] m_PhysicsShape: []
m_Bones: [] m_Bones: []
m_SpriteID: m_SpriteID:
--- !u!1001 &2128441963
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalPosition.x
value: 16.15
objectReference: {fileID: 0}
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalPosition.y
value: -8.4
objectReference: {fileID: 0}
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalPosition.z
value: 0.060982164
objectReference: {fileID: 0}
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1135028580602688107, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9096056522544909490, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
propertyPath: m_Name
value: PurplePumpkin
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 53f5c583c440aa546bde473536a2ead1, type: 3}
--- !u!114 &2132150059 --- !u!114 &2132150059
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -76341,6 +76920,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: MonsterBase value: MonsterBase
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8877229262118324966, guid: 95a2a767cd0699c4aa3198f36305ac04, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
@@ -76864,3 +77447,13 @@ SceneRoots:
- {fileID: 6994367162197659328} - {fileID: 6994367162197659328}
- {fileID: 9115962474533691980} - {fileID: 9115962474533691980}
- {fileID: 1043803241} - {fileID: 1043803241}
- {fileID: 1179696156}
- {fileID: 1393283644}
- {fileID: 176923650}
- {fileID: 528600923}
- {fileID: 2128441963}
- {fileID: 82556497}
- {fileID: 497096654}
- {fileID: 1355169652}
- {fileID: 290283583}
- {fileID: 1423548762}

View File

@@ -7,6 +7,11 @@ namespace TON
[SerializeField] [SerializeField]
private MonsterBase _monsterBase; private MonsterBase _monsterBase;
public void SetMonsterBase(MonsterBase monsterBase)
{
_monsterBase = monsterBase;
}
private void OnTriggerEnter2D(Collider2D other) private void OnTriggerEnter2D(Collider2D other)
{ {
if (other.CompareTag("Player")) if (other.CompareTag("Player"))

View File

@@ -7,6 +7,11 @@ namespace TON
[SerializeField] [SerializeField]
private MonsterBase _monsterBase; private MonsterBase _monsterBase;
public void SetMonsterBase(MonsterBase monsterBase)
{
_monsterBase = monsterBase;
}
private void OnTriggerEnter2D(Collider2D other) private void OnTriggerEnter2D(Collider2D other)
{ {
if (other.CompareTag("Player")) if (other.CompareTag("Player"))

View File

@@ -39,6 +39,8 @@ namespace TON
public int Exp = 0; public int Exp = 0;
public int Score = 0; public int Score = 0;
private CharacterBase _characterBase;
private void Start() private void Start()
{ {
_animator = GetComponent<Animator>(); // 애니메이터 컴포넌트 초기화 _animator = GetComponent<Animator>(); // 애니메이터 컴포넌트 초기화
@@ -56,6 +58,21 @@ namespace TON
_spriteRenderer.flipX = !(_direction.x > 0); // 이동 방향에 따라 스프라이트 플립 _spriteRenderer.flipX = !(_direction.x > 0); // 이동 방향에 따라 스프라이트 플립
_collider = GetComponent<Collider2D>(); // 콜라이더 컴포넌트 초기화 _collider = GetComponent<Collider2D>(); // 콜라이더 컴포넌트 초기화
// CharacterBase 참조 설정
_characterBase = GameObject.Find("TON.Player").GetComponentInChildren<CharacterBase>();
// HP 바 초기화
// HP 바 초기화
if (_hpBarImage != null)
{
RectTransform rectTransform = _hpBarImage.GetComponent<RectTransform>();
hpMaxWidth = rectTransform.sizeDelta.x; // 초기 최대 너비 저장
_maxHP = _monsterData.hp;
currentHP = _maxHP;
Debug.Log($"Initial HP Bar Width: {hpMaxWidth}, Max HP: {_maxHP}");
}
} }
private void InitializeMonsterData() private void InitializeMonsterData()
@@ -64,7 +81,8 @@ namespace TON
if (_monsterData != null) if (_monsterData != null)
{ {
currentHP = _monsterData.hp; _maxHP = _monsterData.hp;
currentHP = _maxHP;
defencePower = _monsterData.defencePower; defencePower = _monsterData.defencePower;
Gold = _monsterData.Gold; Gold = _monsterData.Gold;
Exp = _monsterData.Exp; Exp = _monsterData.Exp;
@@ -93,7 +111,11 @@ namespace TON
private void Update() private void Update()
{ {
_stateMachine.Update(); _stateMachine.Update();
_skillPattern.Update();
if (_monsterData.monsterSkillID != 0)
{
_skillPattern.Update();
}
} }
public void FinishAttack() public void FinishAttack()
@@ -123,10 +145,29 @@ namespace TON
{ {
if (_hpBarImage != null) if (_hpBarImage != null)
{ {
float minHPBarWidth = 5f; // 최소 HP 바 길이 (원하는 값으로 설정) // 현재 HP가 0 이하로 내려가지 않도록 보정
float hpBarWidth = Mathf.Max(currentHP / _maxHP * hpMaxWidth, minHPBarWidth); // 최소 길이 적용 currentHP = Mathf.Max(0, currentHP);
_hpBarImage.GetComponent<RectTransform>().sizeDelta = new Vector2(hpBarWidth, _hpBarImage.GetComponent<RectTransform>().sizeDelta.y); // HP 비율 계산 (0~1 사이 값)
float hpRatio = currentHP / _maxHP;
// RectTransform 컴포넌트 가져오기
RectTransform rectTransform = _hpBarImage.GetComponent<RectTransform>();
// 현재 크기 가져오기
Vector2 sizeDelta = rectTransform.sizeDelta;
// x 크기를 HP 비율에 따라 조정
sizeDelta.x = hpMaxWidth * hpRatio;
// 변경된 크기 적용
rectTransform.sizeDelta = sizeDelta;
Debug.Log($"Current HP: {currentHP}, Max HP: {_maxHP}, Ratio: {hpRatio}, Bar Width: {sizeDelta.x}");
}
else
{
Debug.LogWarning("HP Bar Image is not assigned!");
} }
} }
@@ -142,6 +183,8 @@ namespace TON
// 기본 데미지 계산 (치명타 없음) // 기본 데미지 계산 (치명타 없음)
float damage = damageCalculator.CalculateBaseDamage(baseAttack, equipmentAttack, defense); float damage = damageCalculator.CalculateBaseDamage(baseAttack, equipmentAttack, defense);
_characterBase.ApplyDamage(damage);
Debug.Log($" 몬스터 공격! 최종 데미지: {damage}"); // 데미지 출력 Debug.Log($" 몬스터 공격! 최종 데미지: {damage}"); // 데미지 출력
} }

View File

@@ -19,6 +19,9 @@ namespace TON
private const int TOTAL_WAVES = 10; private const int TOTAL_WAVES = 10;
private const int NORMAL_MONSTER_COUNT = 6; private const int NORMAL_MONSTER_COUNT = 6;
private float initialDelay = 5f; // 게임 시작 후 첫 웨이브 시작까지의 대기 시간
private bool gameStarted = false;
private float nextWaveDelay = 5f; // 다음 웨이브 시작 전 대기 시간 private float nextWaveDelay = 5f; // 다음 웨이브 시작 전 대기 시간
private bool isWaitingForNextWave = false; private bool isWaitingForNextWave = false;
@@ -44,12 +47,39 @@ namespace TON
availableSpawnPoints = new List<int>(); availableSpawnPoints = new List<int>();
activeMonsters = new List<GameObject>(); activeMonsters = new List<GameObject>();
// 5초 후에 첫 웨이브 시작
StartCoroutine(StartGameWithDelay());
}
private IEnumerator StartGameWithDelay()
{
// 초기 카운트다운 표시
float timer = initialDelay;
while (timer > 0)
{
if (waveCounter != null)
{
waveCounter.text = Mathf.CeilToInt(timer).ToString();
}
timer -= Time.deltaTime;
yield return null;
}
if (waveCounter != null)
{
waveCounter.text = null;
}
gameStarted = true;
StartNextWave(); StartNextWave();
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
// 게임이 시작되지 않았다면 업데이트 건너뛰기
if (!gameStarted) return;
// 활성화된 몬스터 리스트에서 파괴된 몬스터 제거 // 활성화된 몬스터 리스트에서 파괴된 몬스터 제거
activeMonsters.RemoveAll(monster => monster == null); activeMonsters.RemoveAll(monster => monster == null);
@@ -77,10 +107,10 @@ namespace TON
private void StartNextWave() private void StartNextWave()
{ {
currentWave++;
StageManager.Singleton.SetWaveData(currentWave); // 웨이브 정보 전달. StageManager.Singleton.SetWaveData(currentWave); // 웨이브 정보 전달.
currentWave++;
if (currentWave > TOTAL_WAVES) if (currentWave > TOTAL_WAVES)
{ {
// Debug.Log("모든 웨이브 완료!"); // Debug.Log("모든 웨이브 완료!");
@@ -130,9 +160,26 @@ namespace TON
{ {
foreach (Transform spawnPoint in spawnPoints) foreach (Transform spawnPoint in spawnPoints)
{ {
GameObject normalMonster = Instantiate(GetNormalMonsterPrefab(), spawnPoint.position, Quaternion.identity); GameObject monsterPrefab = GetNormalMonsterPrefab();
monsterPool.Add(normalMonster); Vector3 spawnPosition = spawnPoint.position;
activeMonsters.Add(normalMonster);
GameObject monster = Instantiate(monsterPrefab, spawnPosition, Quaternion.identity);
monster.transform.parent = transform;
// MonsterBase 컴포넌트 가져오기
MonsterBase monsterBase = monster.GetComponent<MonsterBase>();
// Attack과 Eyesight 컴포넌트 찾아서 MonsterBase 참조 설정
Attack attackComponent = monster.GetComponentInChildren<Attack>();
Eyesight eyesightComponent = monster.GetComponentInChildren<Eyesight>();
if (attackComponent != null)
attackComponent.SetMonsterBase(monsterBase);
if (eyesightComponent != null)
eyesightComponent.SetMonsterBase(monsterBase);
monsterPool.Add(monster);
activeMonsters.Add(monster);
} }
} }
} }
@@ -143,9 +190,26 @@ namespace TON
{ {
foreach (Transform spawnPoint in spawnPoints) foreach (Transform spawnPoint in spawnPoints)
{ {
GameObject normalMonster = Instantiate(GetNormalMonsterPrefab(), spawnPoint.position, Quaternion.identity); GameObject monsterPrefab = GetNormalMonsterPrefab();
monsterPool.Add(normalMonster); Vector3 spawnPosition = spawnPoint.position;
activeMonsters.Add(normalMonster);
GameObject monster = Instantiate(monsterPrefab, spawnPosition, Quaternion.identity);
monster.transform.parent = transform;
// MonsterBase 컴포넌트 가져오기
MonsterBase monsterBase = monster.GetComponent<MonsterBase>();
// Attack과 Eyesight 컴포넌트 찾아서 MonsterBase 참조 설정
Attack attackComponent = monster.GetComponentInChildren<Attack>();
Eyesight eyesightComponent = monster.GetComponentInChildren<Eyesight>();
if (attackComponent != null)
attackComponent.SetMonsterBase(monsterBase);
if (eyesightComponent != null)
eyesightComponent.SetMonsterBase(monsterBase);
monsterPool.Add(monster);
activeMonsters.Add(monster);
} }
} }
} }

View File

@@ -23,45 +23,34 @@ namespace TON
public class Monster1SkillPattern : SkillPattern public class Monster1SkillPattern : SkillPattern
{ {
private float _skill1CoolTime; private float _skillCoolTime;
// private float _skill2CoolTime;
private MonsterSkillData _monsterSkillData; private MonsterSkillData _monsterSkillData;
// private MonsterSkillData _monsterSkillDataTwo;
private MonsterSkill _skill1; private MonsterSkill _skill;
// private MonsterSkill _skill2;
private Vector3 _skillOffset = new Vector3(0, -0.5f, 0); // 스킬 생성 위치 조정값 private Vector3 _skillOffset = new Vector3(0, -0.5f, 0); // 스킬 생성 위치 조정값
public Monster1SkillPattern(MonsterData monsterData, MonsterBase monsterBase) : base(monsterData, monsterBase) public Monster1SkillPattern(MonsterData monsterData, MonsterBase monsterBase) : base(monsterData, monsterBase)
{ {
_monsterSkillData = MonsterSkillDataManager.Singleton.GetMonsterSkillData(_monsterData.monsterSkillID); _monsterSkillData = MonsterSkillDataManager.Singleton.GetMonsterSkillData(_monsterData.monsterSkillID);
// if (_monsterData.monsterSkillIDTwo > -1)
// {
// _monsterSkillDataTwo = MonsterSkillDataManager.Singleton.GetMonsterSkillData(_monsterData.monsterSkillIDTwo);
// }
// if (_monsterSkillData != null && _monsterSkillDataTwo != null)
if (_monsterSkillData != null) if (_monsterSkillData != null)
{ {
Debug.Log($"몬스터 {_monsterSkillData.skillName} 데이터 로드 완료"); Debug.Log($"몬스터 {_monsterSkillData.skillName} 데이터 로드 완료");
// Debug.Log($"몬스터 {_monsterSkillDataTwo.skillName} 데이터 로드 완료");
// 프리팹을 연결한 코드 // 프리팹을 연결한 코드
_skill1 = Resources.Load<MonsterSkill>($"MonsterSkillPrefabs/{_monsterSkillData.skillName}"); _skill = Resources.Load<MonsterSkill>($"MonsterSkillPrefabs/{_monsterSkillData.skillName}");
// _skill2 = Resources.Load<MonsterSkill>($"MonsterSkillPrefabs/{_monsterSkillDataTwo.skillName}");
} }
else else
{ {
Debug.LogError($"몬스터 스킬 ID {_monsterSkillData.skillId}에 대한 데이터를 찾을 수 없습니다."); Debug.LogError($"몬스터 스킬 ID {_monsterSkillData.skillId}에 대한 데이터를 찾을 수 없습니다.");
// Debug.LogError($"몬스터 스킬 ID {_monsterSkillDataTwo.skillId}에 대한 데이터를 찾을 수 없습니다.");
} }
_skill1CoolTime = Time.realtimeSinceStartup; _skillCoolTime = _monsterSkillData.cooldown;
// _skill2CoolTime = Time.realtimeSinceStartup;
} }
public override void Attack(GameObject target) public override void Attack(GameObject target)
@@ -74,58 +63,16 @@ namespace TON
Vector3 spawnPosition = _monsterBase.transform.position - _skillOffset; Vector3 spawnPosition = _monsterBase.transform.position - _skillOffset;
// 프리팹을 지정된 위치에 생성 // 프리팹을 지정된 위치에 생성
Object.Instantiate(_skill1, spawnPosition, Quaternion.identity); Object.Instantiate(_skill, spawnPosition, Quaternion.identity);
} }
public override void Update() public override void Update()
{ {
if (Time.realtimeSinceStartup - _skill1CoolTime >= _monsterSkillData.cooldown) if (Time.realtimeSinceStartup - _skillCoolTime >= _monsterSkillData.cooldown)
{ {
// TODO : 범위 체크 // TODO : 범위 체크
IsAttackable = true; IsAttackable = true;
} }
// if (Time.realtimeSinceStartup - _skill2CoolTime >= _monsterSkillDataTwo.cooldown)
// {
// // TODO : 범위 체크
// IsAttackable = true;
// }
} }
} }
// public class Monster2AttackPattern : AttackPattern
// {
//
//
// public Monster2AttackPattern(MonsterBase monsterBase) : base(monsterBase)
// {
//
// }
//
// public override void Attack()
// {
//
// Skill1();
//
// Skill2();
//
// MeleeAttack();
//
// }
//
// private void Skill1()
// {
//
// }
//
// private void Skill2()
// {
//
// }
//
// private void MeleeAttack()
// {
// _monsterBase.PlayerAttack();
// }
// }
} }

View File

@@ -245,7 +245,7 @@ namespace TON
private const string AniAttack = "Attack"; // 공격 애니메이션 private const string AniAttack = "Attack"; // 공격 애니메이션
private MonsterBase _monsterBase; private MonsterBase _monsterBase;
private float _skillAttackAnimationDuration = 0.5f; // 공격 애니메이션 지속 시간 private float _skillAttackAnimationDuration = 0.5f; // 공격 애니메이션 지속 시간
private float _skillAttackDelayTime = 2f; // 공격 딜레이 시간 private float _skillAttackDelayTime = 10f; // 공격 딜레이 시간
private float _lastSkillAttackTime; // 마지막 공격 시간 private float _lastSkillAttackTime; // 마지막 공격 시간
private bool _isSkillAttacking; private bool _isSkillAttacking;