몬스터가 플레이어를 체이싱 한 후 공격범위 안에 들어오면 공격하도록 수정

This commit is contained in:
Mingu Kim
2025-02-28 05:52:37 +09:00
parent 5e893a029f
commit 0bdfc0f544
7 changed files with 152 additions and 637 deletions

View File

@@ -472,7 +472,7 @@ CircleCollider2D:
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.5
m_Radius: 0.4
--- !u!114 &7019662158690775711
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -629,7 +629,7 @@ CircleCollider2D:
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 1
m_Radius: 6
--- !u!114 &7977788187953700221
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@@ -169,7 +169,7 @@ CircleCollider2D:
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 1
m_Radius: 6
--- !u!114 &6606915575002594920
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -325,7 +325,7 @@ CircleCollider2D:
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.5
m_Radius: 0.4
--- !u!114 &2632654723781966565
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -448,7 +448,7 @@ Transform:
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_LocalScale: {x: 0.4, y: 0.4, z: 0.4}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6939883456599254956}

View File

@@ -3788,63 +3788,6 @@ Sprite:
m_PhysicsShape: []
m_Bones: []
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
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -7508,63 +7451,6 @@ Sprite:
m_PhysicsShape: []
m_Bones: []
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
Sprite:
m_ObjectHideFlags: 0
@@ -12610,63 +12496,6 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0}
m_Flags: 3
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
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -17241,6 +17070,71 @@ Sprite:
m_PhysicsShape: []
m_Bones: []
m_SpriteID:
--- !u!1001 &426139349
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: 6811142484219723541, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_Radius
value: 6
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalPosition.x
value: 15.364559
objectReference: {fileID: 0}
- target: {fileID: 8864163214463241537, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_LocalPosition.y
value: -8.3512335
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}
- target: {fileID: 9070746266591933491, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
propertyPath: m_Radius
value: 0.4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 69c66b62d5d42aa48b34c97c6131188f, type: 3}
--- !u!213 &428450219
Sprite:
m_ObjectHideFlags: 0
@@ -18615,63 +18509,6 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0}
m_Flags: 3
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
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -20136,63 +19973,6 @@ Sprite:
m_PhysicsShape: []
m_Bones: []
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
Sprite:
m_ObjectHideFlags: 0
@@ -46271,63 +46051,6 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0}
m_Flags: 3
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
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -52274,63 +51997,6 @@ Sprite:
m_PhysicsShape: []
m_Bones: []
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
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -52779,63 +52445,6 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0}
m_Flags: 3
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
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -53529,63 +53138,6 @@ MonoBehaviour:
m_InstancedGameObject: {fileID: 0}
m_Flags: 3
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
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -75793,63 +75345,6 @@ Sprite:
m_PhysicsShape: []
m_Bones: []
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
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -77447,13 +76942,4 @@ SceneRoots:
- {fileID: 6994367162197659328}
- {fileID: 9115962474533691980}
- {fileID: 1043803241}
- {fileID: 1179696156}
- {fileID: 1393283644}
- {fileID: 176923650}
- {fileID: 528600923}
- {fileID: 2128441963}
- {fileID: 82556497}
- {fileID: 497096654}
- {fileID: 1355169652}
- {fileID: 290283583}
- {fileID: 1423548762}
- {fileID: 426139349}

View File

@@ -4,7 +4,6 @@ namespace TON
{
public class Attack : MonoBehaviour
{
[SerializeField]
private MonsterBase _monsterBase;
public void SetMonsterBase(MonsterBase monsterBase)
@@ -17,6 +16,7 @@ namespace TON
if (other.CompareTag("Player"))
{
_monsterBase.IsAttacking = true;
_monsterBase.IsFinishAttack = false; // 공격 시작 시 FinishAttack 초기화
}
}
@@ -25,7 +25,7 @@ namespace TON
if (other.CompareTag("Player"))
{
_monsterBase.IsAttacking = false;
_monsterBase.IsFinishAttack = true; // 공격 종료 상태로 설정
_monsterBase.IsFinishAttack = true;
}
}
}

View File

@@ -33,7 +33,7 @@ namespace TON
public bool IsDetect { get; set; } // 몬스터가 대상을 인식했는지 여부
public bool IsAttacking { get; set; } // 몬스터가 공격했는지 여부
public bool IsFinishAttack { get; set; } // 몬스터 공격 모션이 끝났는지 여부
public bool IsSkillAttackable => _skillPattern.IsAttackable;
public bool IsSkillAttackable;
public int Gold = 0;
public int Exp = 0;
@@ -51,7 +51,11 @@ namespace TON
InitializeMonsterData(); // 몬스터 데이터 로드 및 적용
_skillPattern = new Monster1SkillPattern(_monsterData, this);
if (_monsterData.monsterSkillID != 0)
{
_skillPattern = new MonsterSkillPattern(_monsterData, this);
IsSkillAttackable = _skillPattern.IsAttackable;
}
_direction = new Vector3(1, 0, 0); // 초기 이동 방향 (x 축 양의 방향)
@@ -62,7 +66,6 @@ namespace TON
// CharacterBase 참조 설정
_characterBase = GameObject.Find("TON.Player").GetComponentInChildren<CharacterBase>();
// HP 바 초기화
// HP 바 초기화
if (_hpBarImage != null)
{
@@ -70,8 +73,6 @@ namespace TON
hpMaxWidth = rectTransform.sizeDelta.x; // 초기 최대 너비 저장
_maxHP = _monsterData.hp;
currentHP = _maxHP;
Debug.Log($"Initial HP Bar Width: {hpMaxWidth}, Max HP: {_maxHP}");
}
}
@@ -162,12 +163,6 @@ namespace TON
// 변경된 크기 적용
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!");
}
}
@@ -185,7 +180,7 @@ namespace TON
_characterBase.ApplyDamage(damage);
Debug.Log($" 몬스터 공격! 최종 데미지: {damage}"); // 데미지 출력
// Debug.Log($" 몬스터 공격! 최종 데미지: {damage}"); // 데미지 출력
}
public void SetOppositionDirection()
@@ -201,8 +196,8 @@ namespace TON
public void Chasing()
{
var target = GameObject.FindGameObjectWithTag("Player");
UnityEngine.Vector2 direction = target.transform.position - transform.position; // 타겟과의 방향 계산
var target = GameObject.Find("TON.Player").GetComponentInChildren<CharacterBase>();
Vector2 direction = target.transform.position - transform.position; // 타겟과의 방향 계산
_spriteRenderer.flipX = target.transform.position.x < transform.position.x; // 타겟이 왼쪽에 있으면 스프라이트를 왼쪽으로, 오른쪽에 있으면 오른쪽으로 바라보도록 설정
transform.Translate(direction.normalized * moveSpeed * Time.deltaTime); // 타겟 방향으로 이동
@@ -222,5 +217,10 @@ namespace TON
RewardData();
Destroy(gameObject); // 몬스터 파괴
}
public SkillPattern GetSkillPattern()
{
return _skillPattern;
}
}
}

View File

@@ -5,12 +5,13 @@ namespace TON
public class MonsterSkill : MonoBehaviour
{
public float speed = 5f;
public float damage = 1;
public float damage = 0f;
Vector2 direction;
Transform playerTransform; // 플레이어의 Transform을 저장할 변수
[SerializeField] private SpriteRenderer _spriteRenderer; // 스킬의 스프라이트 렌더러
private MonsterBase _monsterBase;
private CharacterBase _characterBase;
public Vector2 Direction
{
set { direction = value.normalized; }
@@ -20,11 +21,11 @@ namespace TON
{
_spriteRenderer = GetComponent<SpriteRenderer>();
GameObject player = GameObject.FindGameObjectWithTag("Player");
_characterBase = GameObject.Find("TON.Player").GetComponentInChildren<CharacterBase>();
if (player != null)
if (_characterBase != null)
{
playerTransform = player.transform;
playerTransform = _characterBase.transform;
}
else
{
@@ -42,10 +43,22 @@ namespace TON
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.CompareTag("Player") || collision.CompareTag("Ground"))
if (collision.CompareTag("Player"))
{
// 플레이어에게 직접 데미지 적용
_characterBase?.ApplyDamage(damage);
Destroy(gameObject);
}
else if (collision.CompareTag("Ground"))
{
// 지형에 부딪히면 스킬 오브젝트만 파괴
Destroy(gameObject);
}
}
public void SetSkillDamage(float skillDamage)
{
damage += skillDamage;
}
void SetDirection()

View File

@@ -15,64 +15,80 @@ namespace TON
public bool IsAttackable { get; set; }
public abstract void Attack(GameObject target);
public abstract bool IsSkillInCooldown();
public abstract void Attack(GameObject target);
public abstract void Update();
}
public class Monster1SkillPattern : SkillPattern
public class MonsterSkillPattern : SkillPattern
{
private float _skillCoolTime;
private float _lastSkillTime;
private MonsterSkillData _monsterSkillData;
private MonsterSkill _skill;
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 MonsterSkillPattern(MonsterData monsterData, MonsterBase monsterBase) : base(monsterData, monsterBase)
{
_monsterSkillData = MonsterSkillDataManager.Singleton.GetMonsterSkillData(_monsterData.monsterSkillID);
_lastSkillTime = -_monsterSkillData.cooldown; // 시작시 스킬 사용 가능하도록
IsAttackable = true;
if (_monsterSkillData != null)
{
Debug.Log($"몬스터 {_monsterSkillData.skillName} 데이터 로드 완료");
// 프리팹을 연결한 코드
// Debug.Log($"몬스터 {_monsterSkillData.skillName} 데이터 로드 완료");
_skill = Resources.Load<MonsterSkill>($"MonsterSkillPrefabs/{_monsterSkillData.skillName}");
}
else
{
Debug.LogError($"몬스터 스킬 ID {_monsterSkillData.skillId}에 대한 데이터를 찾을 수 없습니다.");
}
_skillCoolTime = _monsterSkillData.cooldown;
}
public override void Attack(GameObject target)
{
if (target == null) return;
// 스킬 스프라이트 방향 플레이어 바라보게
_monsterBase.GetComponent<SpriteRenderer>().flipX = target.transform.position.x < _monsterBase.transform.position.x;
// 몬스터의 현재 위치에서 offset만큼 아래에 스킬 생성
Vector3 spawnPosition = _monsterBase.transform.position - _skillOffset;
// 프리팹을 지정된 위치에 생성
Object.Instantiate(_skill, spawnPosition, Quaternion.identity);
SkillAttack(_monsterSkillData.damage);
// 스킬 사용 후 쿨다운 시작
_lastSkillTime = Time.time;
IsAttackable = false;
// Debug.Log($"스킬 사용, 쿨다운 시작: {_monsterSkillData.cooldown}초");
}
public void SkillAttack(float skillDamage)
{
// 데미지 계산 (현재 임시 값)
DamageCalculator damageCalculator = new DamageCalculator();
float baseAttack = _monsterData.attackPower * skillDamage; // 기본 공격력 * 스킬 데미지
float equipmentAttack = 0; // 장비 공격력
float defense = PlayerDataManager.Singleton.player.defensivePower / (PlayerDataManager.Singleton.player.defensivePower + PlayerDataManager.Singleton.defensiveIntention); // 캐릭터 방어력
// 기본 데미지 계산 (치명타 없음)
float damage = damageCalculator.CalculateBaseDamage(baseAttack, equipmentAttack, defense);
_skill.SetSkillDamage(damage);
// Debug.Log($" 몬스터 스킬 공격! 최종 데미지: {damage}"); // 데미지 출력
}
public override void Update()
{
if (Time.realtimeSinceStartup - _skillCoolTime >= _monsterSkillData.cooldown)
// 스킬 쿨다운 체크
if (!IsAttackable && Time.time - _lastSkillTime >= _monsterSkillData.cooldown)
{
// TODO : 범위 체크
IsAttackable = true;
// Debug.Log("스킬 쿨다운 완료");
}
}
public override bool IsSkillInCooldown()
{
return !IsAttackable;
}
}
}