This commit is contained in:
aube.lee
2025-02-28 09:09:26 +09:00
18 changed files with 856 additions and 156 deletions

View File

@@ -636,8 +636,10 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 0}
_spriteRenderer: {fileID: 5120407950894233432}
_textState: {fileID: 0}
id: 5
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 2428847018852956998}
Gold: 0
Exp: 0
Score: 0

View File

@@ -555,11 +555,13 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 898726376241471782}
_spriteRenderer: {fileID: 4428022325186423475}
_textState: {fileID: 0}
id: 6
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 671635317572395929}
Gold: 0
Exp: 0
Score: 0
--- !u!1 &7570151098365513060
GameObject:
m_ObjectHideFlags: 0

View File

@@ -221,11 +221,13 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 0}
_spriteRenderer: {fileID: 453936598381272866}
_textState: {fileID: 0}
id: 3
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 6410629102132267825}
Gold: 0
Exp: 0
Score: 0
--- !u!1 &3020795925047894191
GameObject:
m_ObjectHideFlags: 0

View File

@@ -221,11 +221,13 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 3873838448514641420}
_spriteRenderer: {fileID: 1884691218758219349}
_textState: {fileID: 0}
id: 2
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 1425971833131969348}
Gold: 0
Exp: 0
Score: 0
--- !u!1 &1425971833131969348
GameObject:
m_ObjectHideFlags: 0
@@ -470,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
@@ -627,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

@@ -561,11 +561,13 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 0}
_spriteRenderer: {fileID: 6858484445723671200}
_textState: {fileID: 0}
id: 7
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 8136905868517816863}
Gold: 0
Exp: 0
Score: 0
--- !u!1 &8136905868517816863
GameObject:
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}
@@ -636,8 +636,10 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 8798441981702176517}
_spriteRenderer: {fileID: 6907519990020749312}
_textState: {fileID: 0}
id: 0
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 4582095749182668327}
Gold: 0
Exp: 0
Score: 0

View File

@@ -1,5 +1,81 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2620622173049349003
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5305821414761520028}
- component: {fileID: 5368854248725422238}
- component: {fileID: 3735916234529001561}
m_Layer: 3
m_Name: HpBackground
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5305821414761520028
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2620622173049349003}
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: 4768675179799189835}
m_Father: {fileID: 4691849320710172637}
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 &5368854248725422238
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2620622173049349003}
m_CullTransparentMesh: 1
--- !u!114 &3735916234529001561
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2620622173049349003}
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 &3667660097767351871
GameObject:
m_ObjectHideFlags: 0
@@ -38,6 +114,7 @@ Transform:
m_Children:
- {fileID: 859937797990690648}
- {fileID: 4718048797233105620}
- {fileID: 4691849320710172637}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &8612529477884142844
@@ -220,11 +297,13 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 0}
_spriteRenderer: {fileID: 8612529477884142844}
_textState: {fileID: 0}
id: 9
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 6911953821671608018}
Gold: 0
Exp: 0
Score: 0
--- !u!1 &5762289934519905782
GameObject:
m_ObjectHideFlags: 0
@@ -306,6 +385,81 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_monsterBase: {fileID: 172749484477612116}
--- !u!1 &6911953821671608018
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4768675179799189835}
- component: {fileID: 4863404600193043284}
- component: {fileID: 5072682033945079209}
m_Layer: 3
m_Name: Hp
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4768675179799189835
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6911953821671608018}
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: 5305821414761520028}
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 &4863404600193043284
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6911953821671608018}
m_CullTransparentMesh: 1
--- !u!114 &5072682033945079209
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6911953821671608018}
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 &7319362805679258941
GameObject:
m_ObjectHideFlags: 0
@@ -387,3 +541,105 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_monsterBase: {fileID: 172749484477612116}
--- !u!1 &8298484779810340319
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4691849320710172637}
- component: {fileID: 7350421173189792326}
- component: {fileID: 5091238516079776250}
- component: {fileID: 6401972150142589055}
m_Layer: 3
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4691849320710172637
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8298484779810340319}
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: 5305821414761520028}
m_Father: {fileID: 1842826254400309060}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: -0.08, y: 0.39005613}
m_SizeDelta: {x: 1895.1191, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!223 &7350421173189792326
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8298484779810340319}
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 &5091238516079776250
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8298484779810340319}
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 &6401972150142589055
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8298484779810340319}
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

@@ -302,11 +302,13 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 8010211321467272694}
_spriteRenderer: {fileID: 4483099703633942840}
_textState: {fileID: 0}
id: 4
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 4890974773502705404}
Gold: 0
Exp: 0
Score: 0
--- !u!1 &4890974773502705404
GameObject:
m_ObjectHideFlags: 0

View File

@@ -1,5 +1,81 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1679884989919502275
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8076403279898435288}
- component: {fileID: 527168946961134067}
- component: {fileID: 7304796124252444850}
m_Layer: 3
m_Name: HpBackground
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8076403279898435288
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1679884989919502275}
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: 1733170871094025218}
m_Father: {fileID: 240529822205467168}
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 &527168946961134067
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1679884989919502275}
m_CullTransparentMesh: 1
--- !u!114 &7304796124252444850
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1679884989919502275}
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 &3491208656884522129
GameObject:
m_ObjectHideFlags: 0
@@ -119,6 +195,7 @@ Transform:
m_Children:
- {fileID: 1124561588393679421}
- {fileID: 6171479851988666703}
- {fileID: 240529822205467168}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &7017725869417428001
@@ -301,11 +378,115 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 0}
_spriteRenderer: {fileID: 7017725869417428001}
_textState: {fileID: 0}
id: 8
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 6804305924468228519}
Gold: 0
Exp: 0
Score: 0
--- !u!1 &5557906192929727440
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 240529822205467168}
- component: {fileID: 1306472789516467235}
- component: {fileID: 5256511107703411428}
- component: {fileID: 757087729161155728}
m_Layer: 3
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &240529822205467168
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5557906192929727440}
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: 8076403279898435288}
m_Father: {fileID: 8864163214463241537}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: -0.28, y: 0.39005613}
m_SizeDelta: {x: 1895.1191, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!223 &1306472789516467235
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5557906192929727440}
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 &5256511107703411428
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5557906192929727440}
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 &757087729161155728
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5557906192929727440}
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
--- !u!1 &6526698832639469074
GameObject:
m_ObjectHideFlags: 0
@@ -387,3 +568,78 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_monsterBase: {fileID: 705413505888271155}
--- !u!1 &6804305924468228519
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1733170871094025218}
- component: {fileID: 5350627246871859511}
- component: {fileID: 2594591090907456343}
m_Layer: 3
m_Name: Hp
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1733170871094025218
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6804305924468228519}
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: 8076403279898435288}
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 &5350627246871859511
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6804305924468228519}
m_CullTransparentMesh: 1
--- !u!114 &2594591090907456343
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6804305924468228519}
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

View File

@@ -142,7 +142,7 @@ CircleCollider2D:
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.5
m_Radius: 0.4
--- !u!114 &126644723770121961
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -377,11 +377,13 @@ MonoBehaviour:
_target: {fileID: 0}
_collider: {fileID: 7092071574192076242}
_spriteRenderer: {fileID: 7956262371853790530}
_textState: {fileID: 0}
id: 1
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
_hpBarImage: {fileID: 4532534059460578519}
Gold: 0
Exp: 0
Score: 0
--- !u!1 &6732329482384499360
GameObject:
m_ObjectHideFlags: 0
@@ -627,7 +629,7 @@ CircleCollider2D:
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 1
m_Radius: 6
--- !u!114 &4894791795414822076
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@@ -6074,13 +6074,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3}
m_Name:
m_EditorClassIdentifier:
id: 0
defencePower: 10
_spriteRenderer: {fileID: 135546803}
_textState: {fileID: 0}
_target: {fileID: 0}
_collider: {fileID: 0}
_spriteRenderer: {fileID: 135546803}
id: 0
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
Gold: 0
Exp: 0
Score: 0
--- !u!4 &141676838 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 866829735663616565, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3}
@@ -17067,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
@@ -48251,13 +48319,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3}
m_Name:
m_EditorClassIdentifier:
id: 0
defencePower: 10
_spriteRenderer: {fileID: 1254298208}
_textState: {fileID: 0}
_target: {fileID: 1333310376}
_collider: {fileID: 199081697}
_spriteRenderer: {fileID: 1254298208}
id: 0
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
Gold: 0
Exp: 0
Score: 0
--- !u!95 &1254298203
Animator:
serializedVersion: 5
@@ -72636,7 +72707,7 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 3656570700648378249, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_Name
value: TON.Player_W
value: TON.Player
objectReference: {fileID: 0}
- target: {fileID: 3656570700648378249, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_IsActive
@@ -72648,11 +72719,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_LocalPosition.x
value: -2.06
value: -13.83
objectReference: {fileID: 0}
- target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_LocalPosition.y
value: -7.82
value: -7.52
objectReference: {fileID: 0}
- target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3}
propertyPath: m_LocalPosition.z
@@ -73004,13 +73075,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3}
m_Name:
m_EditorClassIdentifier:
id: 0
defencePower: 10
_spriteRenderer: {fileID: 2041544010}
_textState: {fileID: 0}
_target: {fileID: 1333310376}
_collider: {fileID: 483107484}
_spriteRenderer: {fileID: 2041544010}
id: 0
defencePower: 10
defenceIntention: 30
_hpBarImage: {fileID: 0}
Gold: 0
Exp: 0
Score: 0
--- !u!95 &2041544005
Animator:
serializedVersion: 5
@@ -76341,6 +76415,10 @@ PrefabInstance:
propertyPath: m_Name
value: MonsterBase
objectReference: {fileID: 0}
- target: {fileID: 8877229262118324966, guid: 95a2a767cd0699c4aa3198f36305ac04, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -76864,3 +76942,4 @@ SceneRoots:
- {fileID: 6994367162197659328}
- {fileID: 9115962474533691980}
- {fileID: 1043803241}
- {fileID: 426139349}

View File

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

View File

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

View File

@@ -33,12 +33,14 @@ 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;
public int Score = 0;
private CharacterBase _characterBase;
private void Start()
{
_animator = GetComponent<Animator>(); // 애니메이터 컴포넌트 초기화
@@ -49,13 +51,29 @@ 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 축 양의 방향)
_spriteRenderer.flipX = !(_direction.x > 0); // 이동 방향에 따라 스프라이트 플립
_collider = GetComponent<Collider2D>(); // 콜라이더 컴포넌트 초기화
// CharacterBase 참조 설정
_characterBase = GameObject.Find("TON.Player").GetComponentInChildren<CharacterBase>();
// HP 바 초기화
if (_hpBarImage != null)
{
RectTransform rectTransform = _hpBarImage.GetComponent<RectTransform>();
hpMaxWidth = rectTransform.sizeDelta.x; // 초기 최대 너비 저장
_maxHP = _monsterData.hp;
currentHP = _maxHP;
}
}
private void InitializeMonsterData()
@@ -64,7 +82,8 @@ namespace TON
if (_monsterData != null)
{
currentHP = _monsterData.hp;
_maxHP = _monsterData.hp;
currentHP = _maxHP;
defencePower = _monsterData.defencePower;
Gold = _monsterData.Gold;
Exp = _monsterData.Exp;
@@ -93,7 +112,11 @@ namespace TON
private void Update()
{
_stateMachine.Update();
_skillPattern.Update();
if (_monsterData.monsterSkillID != 0)
{
_skillPattern.Update();
}
}
public void FinishAttack()
@@ -123,10 +146,23 @@ namespace TON
{
if (_hpBarImage != null)
{
float minHPBarWidth = 5f; // 최소 HP 바 길이 (원하는 값으로 설정)
float hpBarWidth = Mathf.Max(currentHP / _maxHP * hpMaxWidth, minHPBarWidth); // 최소 길이 적용
// 현재 HP가 0 이하로 내려가지 않도록 보정
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;
}
}
@@ -142,7 +178,9 @@ namespace TON
// 기본 데미지 계산 (치명타 없음)
float damage = damageCalculator.CalculateBaseDamage(baseAttack, equipmentAttack, defense);
Debug.Log($" 몬스터 공격! 최종 데미지: {damage}"); // 데미지 출력
_characterBase.ApplyDamage(damage);
// Debug.Log($" 몬스터 공격! 최종 데미지: {damage}"); // 데미지 출력
}
public void SetOppositionDirection()
@@ -158,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); // 타겟 방향으로 이동
@@ -179,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

@@ -19,6 +19,9 @@ namespace TON
private const int TOTAL_WAVES = 10;
private const int NORMAL_MONSTER_COUNT = 6;
private float initialDelay = 5f; // 게임 시작 후 첫 웨이브 시작까지의 대기 시간
private bool gameStarted = false;
private float nextWaveDelay = 5f; // 다음 웨이브 시작 전 대기 시간
private bool isWaitingForNextWave = false;
@@ -44,12 +47,39 @@ namespace TON
availableSpawnPoints = new List<int>();
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();
}
// Update is called once per frame
void Update()
{
// 게임이 시작되지 않았다면 업데이트 건너뛰기
if (!gameStarted) return;
// 활성화된 몬스터 리스트에서 파괴된 몬스터 제거
activeMonsters.RemoveAll(monster => monster == null);
@@ -77,10 +107,10 @@ namespace TON
private void StartNextWave()
{
currentWave++;
StageManager.Singleton.SetWaveData(currentWave); // 웨이브 정보 전달.
currentWave++;
if (currentWave > TOTAL_WAVES)
{
// Debug.Log("모든 웨이브 완료!");
@@ -130,9 +160,26 @@ namespace TON
{
foreach (Transform spawnPoint in spawnPoints)
{
GameObject normalMonster = Instantiate(GetNormalMonsterPrefab(), spawnPoint.position, Quaternion.identity);
monsterPool.Add(normalMonster);
activeMonsters.Add(normalMonster);
GameObject monsterPrefab = GetNormalMonsterPrefab();
Vector3 spawnPosition = spawnPoint.position;
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)
{
GameObject normalMonster = Instantiate(GetNormalMonsterPrefab(), spawnPoint.position, Quaternion.identity);
monsterPool.Add(normalMonster);
activeMonsters.Add(normalMonster);
GameObject monsterPrefab = GetNormalMonsterPrefab();
Vector3 spawnPosition = spawnPoint.position;
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

@@ -15,117 +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 _skill1CoolTime;
// private float _skill2CoolTime;
private float _lastSkillTime;
private MonsterSkillData _monsterSkillData;
// private MonsterSkillData _monsterSkillDataTwo;
private MonsterSkill _skill;
private Vector3 _skillOffset = new Vector3(0, -0.5f, 0);
private MonsterSkill _skill1;
// private MonsterSkill _skill2;
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);
// if (_monsterData.monsterSkillIDTwo > -1)
// {
// _monsterSkillDataTwo = MonsterSkillDataManager.Singleton.GetMonsterSkillData(_monsterData.monsterSkillIDTwo);
// }
_lastSkillTime = -_monsterSkillData.cooldown; // 시작시 스킬 사용 가능하도록
IsAttackable = true;
// if (_monsterSkillData != null && _monsterSkillDataTwo != null)
if (_monsterSkillData != null)
{
Debug.Log($"몬스터 {_monsterSkillData.skillName} 데이터 로드 완료");
// Debug.Log($"몬스터 {_monsterSkillDataTwo.skillName} 데이터 로드 완료");
// 프리팹을 연결한 코드
_skill1 = Resources.Load<MonsterSkill>($"MonsterSkillPrefabs/{_monsterSkillData.skillName}");
// _skill2 = Resources.Load<MonsterSkill>($"MonsterSkillPrefabs/{_monsterSkillDataTwo.skillName}");
// Debug.Log($"몬스터 {_monsterSkillData.skillName} 데이터 로드 완료");
_skill = Resources.Load<MonsterSkill>($"MonsterSkillPrefabs/{_monsterSkillData.skillName}");
}
else
{
Debug.LogError($"몬스터 스킬 ID {_monsterSkillData.skillId}에 대한 데이터를 찾을 수 없습니다.");
// Debug.LogError($"몬스터 스킬 ID {_monsterSkillDataTwo.skillId}에 대한 데이터를 찾을 수 없습니다.");
}
_skill1CoolTime = Time.realtimeSinceStartup;
// _skill2CoolTime = Time.realtimeSinceStartup;
}
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(_skill1, spawnPosition, Quaternion.identity);
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 - _skill1CoolTime >= _monsterSkillData.cooldown)
// 스킬 쿨다운 체크
if (!IsAttackable && Time.time - _lastSkillTime >= _monsterSkillData.cooldown)
{
// TODO : 범위 체크
IsAttackable = true;
// Debug.Log("스킬 쿨다운 완료");
}
}
// if (Time.realtimeSinceStartup - _skill2CoolTime >= _monsterSkillDataTwo.cooldown)
// {
// // TODO : 범위 체크
// IsAttackable = true;
// }
public override bool IsSkillInCooldown()
{
return !IsAttackable;
}
}
// 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 MonsterBase _monsterBase;
private float _skillAttackAnimationDuration = 0.5f; // 공격 애니메이션 지속 시간
private float _skillAttackDelayTime = 2f; // 공격 딜레이 시간
private float _skillAttackDelayTime = 10f; // 공격 딜레이 시간
private float _lastSkillAttackTime; // 마지막 공격 시간
private bool _isSkillAttacking;