From a27bb7d6d11687a591c4758e03796ef47c7bd13d Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Thu, 20 Feb 2025 05:21:58 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=AC=EC=8A=A4=ED=84=B0=20=EC=8A=A4?= =?UTF-8?q?=ED=8F=AC=EB=84=88=20=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 몬스터 상태 Hit, Death 추가 2. 몬스터 스킬 정리 --- .../Resources/GameData/MonsterSkills.json | 4 +- .../MonsterSkillPrefabs/IceBlast.prefab | 2 +- .../Personal Scenes/dev_mingu/Ingame.unity | 907 ++++++++---------- .../Assets/Gameton/Scenes/Stage 1.unity | 149 ++- .../Gameton/Scripts/Monster/AttackPattern.cs | 82 -- .../Scripts/Monster/MonsterBase.Debug.cs | 22 + .../Scripts/Monster/MonsterBase.Debug.cs.meta | 11 + .../Gameton/Scripts/Monster/MonsterBase.cs | 117 +-- .../Gameton/Scripts/Monster/MonsterSpawner.cs | 153 +++ .../Scripts/Monster/MonsterSpawner.cs.meta | 11 + .../Gameton/Scripts/Monster/SkillPattern.cs | 133 +++ ...ckPattern.cs.meta => SkillPattern.cs.meta} | 0 .../Gameton/Scripts/Monster/StateMachine.cs | 40 +- Gameton-06/ProjectSettings/TagManager.asset | 4 +- 14 files changed, 926 insertions(+), 709 deletions(-) delete mode 100644 Gameton-06/Assets/Gameton/Scripts/Monster/AttackPattern.cs create mode 100644 Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.Debug.cs create mode 100644 Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.Debug.cs.meta create mode 100644 Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs create mode 100644 Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs.meta create mode 100644 Gameton-06/Assets/Gameton/Scripts/Monster/SkillPattern.cs rename Gameton-06/Assets/Gameton/Scripts/Monster/{AttackPattern.cs.meta => SkillPattern.cs.meta} (100%) diff --git a/Gameton-06/Assets/Gameton/Resources/GameData/MonsterSkills.json b/Gameton-06/Assets/Gameton/Resources/GameData/MonsterSkills.json index b99f0660..be1b8a3c 100644 --- a/Gameton-06/Assets/Gameton/Resources/GameData/MonsterSkills.json +++ b/Gameton-06/Assets/Gameton/Resources/GameData/MonsterSkills.json @@ -5,7 +5,7 @@ "damage": 50, "cooldown": 5, "range": 5, - "prefabName": "IceBlastPrefab" + "prefabName": "IceBlast" }, { "skillId": 1, @@ -13,6 +13,6 @@ "damage": 50, "cooldown": 5, "range": 5, - "prefabName": "smallFirePrefab" + "prefabName": "smallFire" } ] \ No newline at end of file diff --git a/Gameton-06/Assets/Gameton/Resources/MonsterSkillPrefabs/IceBlast.prefab b/Gameton-06/Assets/Gameton/Resources/MonsterSkillPrefabs/IceBlast.prefab index 3e45b63d..e2623bd4 100644 --- a/Gameton-06/Assets/Gameton/Resources/MonsterSkillPrefabs/IceBlast.prefab +++ b/Gameton-06/Assets/Gameton/Resources/MonsterSkillPrefabs/IceBlast.prefab @@ -32,7 +32,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 9.6, y: -6.82, z: 0} - m_LocalScale: {x: 2, y: 2, z: 2} + m_LocalScale: {x: 3, y: 3, z: 2} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} diff --git a/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity b/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity index c12d06b3..7eab3965 100644 --- a/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity +++ b/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity @@ -5110,112 +5110,6 @@ MonoBehaviour: m_InstancedGameObject: {fileID: 0} m_Flags: 3 m_ColliderType: 1 ---- !u!1 &131450190 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 131450193} - - component: {fileID: 131450192} - - component: {fileID: 131450191} - m_Layer: 0 - m_Name: Projectile_0 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!95 &131450191 -Animator: - serializedVersion: 5 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 131450190} - m_Enabled: 1 - m_Avatar: {fileID: 0} - m_Controller: {fileID: 9100000, guid: 60a2c26e8d29d3a4582106c63f4a4794, type: 2} - m_CullingMode: 0 - m_UpdateMode: 0 - m_ApplyRootMotion: 0 - m_LinearVelocityBlending: 0 - m_StabilizeFeet: 0 - m_WarningMessage: - m_HasTransformHierarchy: 1 - m_AllowConstantClipSamplingOptimization: 1 - m_KeepAnimatorStateOnDisable: 0 - m_WriteDefaultValuesOnDisable: 0 ---- !u!212 &131450192 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 131450190} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 0 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: -341134305, guid: 8c818873fb8d4ad3bb40ebb62d906a1d, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 8, y: 8} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 - m_SpriteSortPoint: 0 ---- !u!4 &131450193 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 131450190} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 6.902977, y: -6.2595706, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!213 &132320736 Sprite: m_ObjectHideFlags: 0 @@ -6183,20 +6077,10 @@ MonoBehaviour: id: 0 defencePower: 10 _spriteRenderer: {fileID: 135546803} + _textState: {fileID: 0} _target: {fileID: 0} _collider: {fileID: 0} _hpBarImage: {fileID: 0} - smallFirePrefab: {fileID: 0} - DragonBreathPrefab: {fileID: 0} - IceBlastPrefab: {fileID: 0} - PumpkinCrashPrefab: {fileID: 0} - TrollChargePrefab: {fileID: 0} - TrollCrashPrefab: {fileID: 0} - TrollThundePrefab: {fileID: 0} - WolfEnergyWavePrefab: {fileID: 0} - WolfPunchPrefab: {fileID: 0} - DragonShockWavePrefab: {fileID: 0} - FireImpactPrefab: {fileID: 0} --- !u!4 &141676838 stripped Transform: m_CorrespondingSourceObject: {fileID: 866829735663616565, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3} @@ -13097,81 +12981,6 @@ MonoBehaviour: m_InstancedGameObject: {fileID: 0} m_Flags: 3 m_ColliderType: 1 ---- !u!1 &309509379 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 309509380} - - component: {fileID: 309509382} - - component: {fileID: 309509381} - m_Layer: 3 - m_Name: Hp - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &309509380 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 309509379} - 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: 745690810} - 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: 3.9811, y: 0.3064} - m_Pivot: {x: 0, y: 0.5} ---- !u!114 &309509381 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 309509379} - 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!222 &309509382 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 309509379} - m_CullTransparentMesh: 1 --- !u!213 &319544776 Sprite: m_ObjectHideFlags: 0 @@ -17716,20 +17525,10 @@ MonoBehaviour: id: 0 defencePower: 10 _spriteRenderer: {fileID: 431020305} + _textState: {fileID: 1599963990} _target: {fileID: 1333310376} _collider: {fileID: 2147245667} - _hpBarImage: {fileID: 309509381} - smallFirePrefab: {fileID: 4487626989189845864, guid: 0cc74a53f6c5c944b86daaa75d4bc576, type: 3} - DragonBreathPrefab: {fileID: 1270587839958746621, guid: a7b411323f70c6c4db9d2cab98824bd2, type: 3} - IceBlastPrefab: {fileID: 5091201270221039787, guid: e0e47ef64af779949aef813fbc15f1b5, type: 3} - PumpkinCrashPrefab: {fileID: 6551207428356273061, guid: 4f642f085df0b924f895a1d23e67ad3f, type: 3} - TrollChargePrefab: {fileID: 5657264052368507626, guid: cc6826c2c28719f429e890d46db2808d, type: 3} - TrollCrashPrefab: {fileID: 7081223340028307245, guid: 6c84a8d8ff561714585abaed48ffb6b9, type: 3} - TrollThundePrefab: {fileID: 7017780489100943411, guid: c8c646b21c23a3340a14ddd62ce673b5, type: 3} - WolfEnergyWavePrefab: {fileID: 6602113715180894997, guid: 99c6c681f7d601445b6f970ee9b77109, type: 3} - WolfPunchPrefab: {fileID: 123878659603861660, guid: bdee23ac65f6d2b4bafefc94600190c8, type: 3} - DragonShockWavePrefab: {fileID: 3715909542404085769, guid: 358f073558c5daa4185d8950938ae415, type: 3} - FireImpactPrefab: {fileID: 6470166121172466421, guid: b12ab214fbad9a449bc80119f185111e, type: 3} + _hpBarImage: {fileID: 774788050} --- !u!95 &431020300 Animator: serializedVersion: 5 @@ -17920,7 +17719,7 @@ Transform: m_Children: - {fileID: 2147245669} - {fileID: 1944913878} - - {fileID: 457398684} + - {fileID: 817880258} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &436356700 @@ -18201,108 +18000,6 @@ Sprite: m_PhysicsShape: [] m_Bones: [] m_SpriteID: ---- !u!1 &457398683 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 457398684} - - component: {fileID: 457398687} - - component: {fileID: 457398686} - - component: {fileID: 457398685} - m_Layer: 3 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &457398684 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 457398683} - 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: 745690810} - m_Father: {fileID: 431020306} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: -0.4976, y: 0} - m_SizeDelta: {x: 1895.1191, y: 1080} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &457398685 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 457398683} - 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!114 &457398686 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 457398683} - 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!223 &457398687 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 457398683} - 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: 25 - m_UpdateRectTransformForStandalone: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 --- !u!114 &459636395 MonoBehaviour: m_ObjectHideFlags: 0 @@ -25640,6 +25337,82 @@ MonoBehaviour: m_InstancedGameObject: {fileID: 0} m_Flags: 3 m_ColliderType: 1 +--- !u!1 &707399533 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 707399534} + - component: {fileID: 707399536} + - component: {fileID: 707399535} + m_Layer: 5 + m_Name: HpBackground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &707399534 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 707399533} + 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: 774788053} + m_Father: {fileID: 817880258} + 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: 716, y: -250} + m_SizeDelta: {x: 191.466, y: 18.1851} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &707399535 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 707399533} + 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!222 &707399536 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 707399533} + m_CullTransparentMesh: 1 --- !u!213 &708547322 Sprite: m_ObjectHideFlags: 0 @@ -26762,82 +26535,6 @@ MonoBehaviour: m_InstancedGameObject: {fileID: 0} m_Flags: 3 m_ColliderType: 1 ---- !u!1 &745690809 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 745690810} - - component: {fileID: 745690812} - - component: {fileID: 745690811} - m_Layer: 3 - m_Name: HpBackground - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &745690810 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 745690809} - 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: 309509380} - m_Father: {fileID: 457398684} - 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.85, y: 3.26} - m_SizeDelta: {x: 3.9811, y: 0.3064} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &745690811 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 745690809} - 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!222 &745690812 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 745690809} - m_CullTransparentMesh: 1 --- !u!213 &752420920 Sprite: m_ObjectHideFlags: 0 @@ -34050,6 +33747,81 @@ Tilemap: e31: 0 e32: 0 e33: 1 +--- !u!1 &774788050 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 774788053} + - component: {fileID: 774788052} + - component: {fileID: 774788051} + m_Layer: 5 + m_Name: Hp + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &774788051 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 774788050} + 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!222 &774788052 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 774788050} + m_CullTransparentMesh: 1 +--- !u!224 &774788053 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 774788050} + 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: 707399534} + 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: 96.000046, y: 0.0000077784} + m_SizeDelta: {x: 185.0602, y: 12.1787} + m_Pivot: {x: 0.5, y: 0.5} --- !u!213 &780172177 Sprite: m_ObjectHideFlags: 0 @@ -35270,6 +35042,109 @@ Sprite: m_PhysicsShape: [] m_Bones: [] m_SpriteID: +--- !u!1 &817880257 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 817880258} + - component: {fileID: 817880261} + - component: {fileID: 817880260} + - component: {fileID: 817880259} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &817880258 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 817880257} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 707399534} + - {fileID: 1599963988} + m_Father: {fileID: 431020306} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &817880259 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 817880257} + 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: 63 +--- !u!114 &817880260 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 817880257} + 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: 0 +--- !u!223 &817880261 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 817880257} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + 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: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!114 &819655907 MonoBehaviour: m_ObjectHideFlags: 0 @@ -48863,20 +48738,10 @@ MonoBehaviour: id: 0 defencePower: 10 _spriteRenderer: {fileID: 1254298208} + _textState: {fileID: 0} _target: {fileID: 1333310376} _collider: {fileID: 199081697} _hpBarImage: {fileID: 0} - smallFirePrefab: {fileID: 0} - DragonBreathPrefab: {fileID: 0} - IceBlastPrefab: {fileID: 0} - PumpkinCrashPrefab: {fileID: 0} - TrollChargePrefab: {fileID: 0} - TrollCrashPrefab: {fileID: 0} - TrollThundePrefab: {fileID: 0} - WolfEnergyWavePrefab: {fileID: 0} - WolfPunchPrefab: {fileID: 0} - DragonShockWavePrefab: {fileID: 0} - FireImpactPrefab: {fileID: 0} --- !u!95 &1254298203 Animator: serializedVersion: 5 @@ -57238,112 +57103,6 @@ Rigidbody2D: m_SleepingMode: 1 m_CollisionDetection: 0 m_Constraints: 0 ---- !u!1 &1494770071 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1494770074} - - component: {fileID: 1494770073} - - component: {fileID: 1494770072} - m_Layer: 0 - m_Name: Projectile_0 (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!95 &1494770072 -Animator: - serializedVersion: 5 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1494770071} - m_Enabled: 1 - m_Avatar: {fileID: 0} - m_Controller: {fileID: 9100000, guid: 711bd6c54203e7941bb30411c0fdf64d, type: 2} - m_CullingMode: 0 - m_UpdateMode: 0 - m_ApplyRootMotion: 0 - m_LinearVelocityBlending: 0 - m_StabilizeFeet: 0 - m_WarningMessage: - m_HasTransformHierarchy: 1 - m_AllowConstantClipSamplingOptimization: 1 - m_KeepAnimatorStateOnDisable: 0 - m_WriteDefaultValuesOnDisable: 0 ---- !u!212 &1494770073 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1494770071} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 0 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: -341134305, guid: 0e0c49562085468e8b180291b8414bf8, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 8, y: 8} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 - m_SpriteSortPoint: 0 ---- !u!4 &1494770074 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1494770071} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10.324039, y: -7.0236945, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1497397681 MonoBehaviour: m_ObjectHideFlags: 0 @@ -62137,6 +61896,140 @@ Tilemap: e31: 0 e32: 0 e33: 1 +--- !u!1 &1599963987 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1599963988} + - component: {fileID: 1599963989} + - component: {fileID: 1599963990} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1599963988 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1599963987} + 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: 817880258} + 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: 736, y: -199.3} + m_SizeDelta: {x: 200, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1599963989 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1599963987} + m_CullTransparentMesh: 1 +--- !u!114 &1599963990 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1599963987} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: New Text + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!213 &1600387022 Sprite: m_ObjectHideFlags: 0 @@ -73813,20 +73706,10 @@ MonoBehaviour: id: 0 defencePower: 10 _spriteRenderer: {fileID: 2041544010} + _textState: {fileID: 0} _target: {fileID: 1333310376} _collider: {fileID: 483107484} _hpBarImage: {fileID: 0} - smallFirePrefab: {fileID: 0} - DragonBreathPrefab: {fileID: 0} - IceBlastPrefab: {fileID: 0} - PumpkinCrashPrefab: {fileID: 0} - TrollChargePrefab: {fileID: 0} - TrollCrashPrefab: {fileID: 0} - TrollThundePrefab: {fileID: 0} - WolfEnergyWavePrefab: {fileID: 0} - WolfPunchPrefab: {fileID: 0} - DragonShockWavePrefab: {fileID: 0} - FireImpactPrefab: {fileID: 0} --- !u!95 &2041544005 Animator: serializedVersion: 5 @@ -77681,8 +77564,6 @@ SceneRoots: - {fileID: 720822433} - {fileID: 1396440215} - {fileID: 2026225658} - - {fileID: 131450193} - - {fileID: 1494770074} - {fileID: 431020306} - {fileID: 1932526043} - {fileID: 3167224815861714609} diff --git a/Gameton-06/Assets/Gameton/Scenes/Stage 1.unity b/Gameton-06/Assets/Gameton/Scenes/Stage 1.unity index d233653c..0f945ed7 100644 --- a/Gameton-06/Assets/Gameton/Scenes/Stage 1.unity +++ b/Gameton-06/Assets/Gameton/Scenes/Stage 1.unity @@ -2313,6 +2313,37 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: ab2e507b20e5dc844a1ea24b5619f656, type: 3} +--- !u!1 &340342490 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 340342491} + m_Layer: 0 + m_Name: Monster1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &340342491 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 340342490} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 6.4799995, y: 2.25, z: -0.10636908} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1253934486} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &391267027 GameObject: m_ObjectHideFlags: 0 @@ -58772,6 +58803,59 @@ MonoBehaviour: m_CameraActivatedEvent: m_PersistentCalls: m_Calls: [] +--- !u!1 &1253934484 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1253934486} + - component: {fileID: 1253934485} + m_Layer: 0 + m_Name: Spanwer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1253934485 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1253934484} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 481676f31fc794c4b93848b442416f2c, type: 3} + m_Name: + m_EditorClassIdentifier: + _monsterLocations: + - {fileID: 340342491} + - {fileID: 1721288851} + - {fileID: 1695686502} + _monsterId: 01000000010000000100000004000000 + _spawnDistance: 10 +--- !u!4 &1253934486 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1253934484} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 15.07, y: -6.5, z: 1.0991049} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 340342491} + - {fileID: 1721288851} + - {fileID: 1695686502} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1342711675 GameObject: m_ObjectHideFlags: 0 @@ -84036,7 +84120,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3656570700648378249, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 8528093570479225059, guid: f92c93d0d7d455d40b84e993e40acfca, type: 3} propertyPath: m_LocalPosition.x @@ -94630,6 +94714,68 @@ Rigidbody2D: m_SleepingMode: 1 m_CollisionDetection: 0 m_Constraints: 0 +--- !u!1 &1695686501 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1695686502} + m_Layer: 0 + m_Name: Monster3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1695686502 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1695686501} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 6.25, y: 2.26, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1253934486} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1721288850 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1721288851} + m_Layer: 0 + m_Name: Monster2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1721288851 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1721288850} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 8.26, y: 3.17, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1253934486} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1906030825 GameObject: m_ObjectHideFlags: 0 @@ -112802,3 +112948,4 @@ SceneRoots: - {fileID: 535565209} - {fileID: 1423029865} - {fileID: 1441848035} + - {fileID: 1253934486} diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/AttackPattern.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/AttackPattern.cs deleted file mode 100644 index 4d62d5fc..00000000 --- a/Gameton-06/Assets/Gameton/Scripts/Monster/AttackPattern.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -namespace TON -{ - public class AttackPattern - { - protected MonsterBase _monsterBase; - - public AttackPattern(MonsterBase monsterBase) - { - _monsterBase = monsterBase; - } - - public virtual void Attack() - { - } - } - - public class Monster1AttackPattern : AttackPattern - { - public Monster1AttackPattern(MonsterBase monsterBase) : base(monsterBase) - { - } - - public override void Attack() - { - - Skill1(); - - MeleeAttack(); - - } - - private void Skill1() - { - _monsterBase.MonsterSkillLaunch(); - } - - private void MeleeAttack() - { - _monsterBase.PlayerAttack(); - } - } - - 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(); - } - } -} diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.Debug.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.Debug.cs new file mode 100644 index 00000000..e4b624b5 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.Debug.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace TON +{ + public partial class MonsterBase + { + private void OnGUI() + { + if (GUILayout.Button("Hit")) + { + ApplyDamage(1); + } + + if (GUILayout.Button("Dead")) + { + ApplyDamage(1000000000); + } + } + } +} diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.Debug.cs.meta b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.Debug.cs.meta new file mode 100644 index 00000000..5eb5c706 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.Debug.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be351d22396005d4bbcd8a3e72592f75 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.cs index 0495eb05..d30c0199 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.cs @@ -1,22 +1,13 @@ -using System; -using System.Collections; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Numerics; -using Assets.PixelFantasy.PixelMonsters.Common.Scripts; -using Unity.VisualScripting; +using TMPro; using UnityEngine; using UnityEngine.UI; -using DamageCalculator = TON.DamageCalculator; using Vector2 = UnityEngine.Vector2; using Vector3 = UnityEngine.Vector3; namespace TON { - public class MonsterBase : MonoBehaviour, IDamage + public partial class MonsterBase : MonoBehaviour, IDamage { - [SerializeField] public int id; // 몬스터의 ID public float defencePower; @@ -30,15 +21,16 @@ namespace TON StateMachine _stateMachine; - private AttackPattern _attackPattern; + private SkillPattern _skillPattern; + + // [SerializeField] private TextMeshProUGUI _textState; private Vector3 _direction; // 몬스터의 이동 방향 public bool IsDetect { get; set; } // 몬스터가 대상을 인식했는지 여부 public bool IsAttacking { get; set; } // 몬스터가 공격했는지 여부 public bool IsFisnishAttack { get; set; } // 몬스터 공격 모션이 끝났는지 여부 - public bool IsHit { get; set; } // 몬스터 공격 모션이 끝났는지 여부 - public bool IsDead { get; set; } // 몬스터 공격 모션이 끝났는지 여부 - + public bool IsSkillAttackable => _skillPattern.IsAttackable; + [SerializeField] private GameObject _target; // 몬스터의 타겟 [SerializeField] private Collider2D _collider; // 몬스터의 콜라이더 @@ -47,37 +39,23 @@ namespace TON private string currentAnimationState; // 현재 애니메이션 상태 // hp바 - [SerializeField] private Image _hpBarImage; // HP 바 이미지 + public GameObject _hpBarImage; // HP 바 이미지 private float _maxHP; private float currentHP; - - // 몬스터 스킬 프리팹 - public GameObject smallFirePrefab; - public GameObject DragonBreathPrefab; - public GameObject IceBlastPrefab; - public GameObject PumpkinCrashPrefab; - public GameObject TrollChargePrefab; - public GameObject TrollCrashPrefab; - public GameObject TrollThundePrefab; - public GameObject WolfEnergyWavePrefab; - public GameObject WolfPunchPrefab; - public GameObject DragonShockWavePrefab; - public GameObject FireImpactPrefab; + private float hpMaxWidth; // 첫 번째 프레임 전에 호출됩니다. private void Start() - { // 전략 패턴 - // TODO : 수정중 - // _attackPattern = new Monster1AttackPattern(); - // _attackPattern = new Monster2AttackPattern(); - + { _animator = GetComponent(); // 애니메이터 컴포넌트 초기화 + // _stateMachine = new StateMachine(new IdleState(), this, _textState); _stateMachine = new StateMachine(new IdleState(), this); // 몬스터 데이터 로드 및 적용 InitializeMonsterData(); - InitializeMonsterSkillData(); + + _skillPattern = new Monster1SkillPattern(_monsterData, this); id = _monsterData.id; @@ -86,6 +64,8 @@ namespace TON _spriteRenderer.flipX = !(_direction.x > 0); // 이동 방향에 따라 스프라이트 플립 _collider = GetComponent(); // 콜라이더 컴포넌트 초기화 + + // hpMaxWidth = _hpBarImage.GetComponent().sizeDelta.x; } // TODO : 불러온 값 변수에 대응하게 수정 @@ -95,11 +75,9 @@ namespace TON if (_monsterData != null) { - _maxHP = _monsterData.hp; - currentHP = _maxHP; - + currentHP = _monsterData.hp; defencePower = _monsterData.defencePower; - + Debug.Log($"몬스터 {_monsterData.name} 데이터 로드 완료"); } else @@ -108,29 +86,6 @@ namespace TON } } - // TODO : 불러온 값 변수에 대응하게 수정 - private void InitializeMonsterSkillData() - { - _monsterSkillData = MonsterSkillDataManager.Singleton.GetMonsterSkillData(_monsterData.monsterSkillID); - if (_monsterData.monsterSkillIDTwo > -1) - { - _monsterSkillDataTwo = MonsterSkillDataManager.Singleton.GetMonsterSkillData(_monsterData.monsterSkillIDTwo); - } - - if (_monsterSkillData != null && _monsterSkillDataTwo != null) - { - - Debug.Log($"몬스터 {_monsterSkillData.skillName} 데이터 로드 완료"); - Debug.Log($"몬스터 {_monsterSkillDataTwo.skillName} 데이터 로드 완료"); - } - else - { - Debug.LogError($"몬스터 스킬 ID {_monsterSkillData.skillId}에 대한 데이터를 찾을 수 없습니다."); - Debug.LogError($"몬스터 스킬 ID {_monsterSkillDataTwo.skillId}에 대한 데이터를 찾을 수 없습니다."); - } - } - - // 애니메이션 상태를 변경하는 메서드 public void ChangeAnimationState(string newState) { @@ -143,7 +98,7 @@ namespace TON private void Update() { _stateMachine.Update(); - + _skillPattern.Update(); } public void FinishAttack() @@ -163,13 +118,11 @@ namespace TON if (prevHP > 0 && currentHP <= 0) { - // 몬스터가 죽었을 때 처리 (죽는 애니메이션은 주석 처리됨) - // Destroy(gameObject); // 몬스터 파괴 - DestroyMonster(); + _stateMachine.SetTransition(new DeathState()); } else if (prevHP > 0 && currentHP > 0) { - // 피격 애니메이션은 주석 처리됨 (필요시 활성화) + _stateMachine.SetTransition(new HitState()); } } @@ -178,9 +131,10 @@ namespace TON { if (_hpBarImage != null) { - // 현재 체력 비율 계산 (0.0 ~ 1.0) - float hpRatio = currentHP / _maxHP; - _hpBarImage.fillAmount = hpRatio; // 이미지 크기를 체력 비율에 맞게 조절 + float minHPBarWidth = 5f; // 최소 HP 바 길이 (원하는 값으로 설정) + float hpBarWidth = Mathf.Max(currentHP / _maxHP * hpMaxWidth, minHPBarWidth); // 최소 길이 적용 + + _hpBarImage.GetComponent().sizeDelta = new Vector2(hpBarWidth, _hpBarImage.GetComponent().sizeDelta.y); } } @@ -231,25 +185,12 @@ namespace TON public void MonsterSkillLaunch() { + + // _spriteRenderer.flipX = target.transform.position.x < transform.position.x; + // newSkill.transform.position = transform.position + new Vector3(0, 1f, 0); + // newSkill.GetComponent().Direction = new Vector2(0, 1); var target = GameObject.FindGameObjectWithTag("Player"); - _spriteRenderer.flipX = target.transform.position.x < transform.position.x; - - // TODO : 몬스터가 가지고 있는 스킬에 따라 분기되는 조건 추가 - // GameObject newSkill = Instantiate(smallFirePrefab); - // GameObject newSkill = Instantiate(DragonBreathPrefab); - GameObject newSkill = Instantiate(IceBlastPrefab); - // GameObject newSkill = Instantiate(PumpkinCrashPrefab); - // GameObject newSkill = Instantiate(TrollChargePrefab); - // GameObject newSkill = Instantiate(TrollCrashPrefab); - // GameObject newSkill = Instantiate(TrollThundePrefab); - // GameObject newSkill = Instantiate(WolfEnergyWavePrefab); - // GameObject newSkill = Instantiate(WolfPunchPrefab); - // GameObject newSkill = Instantiate(DragonShockWavePrefab); - // GameObject newSkill = Instantiate(FireImpactPrefab); - - - newSkill.transform.position = transform.position + new Vector3(0, 1f, 0); - newSkill.GetComponent().Direction = new Vector2(0, 1); + _skillPattern.Attack(target); } public void DestroyMonster() diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs new file mode 100644 index 00000000..2d02f921 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs @@ -0,0 +1,153 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace TON +{ + public class MonsterSpawner : MonoBehaviour + { + [SerializeField] + private List _monsterLocations = new List(); + [SerializeField] + private List _monsterId = new List(); + [SerializeField] + private float _spawnDistance = 10f; + + private CharacterBase _player; + private List _spawnedMonsters = new List(); + private Dictionary _spawnPoints = new Dictionary(); + + private void Start() + { + InitializeSpawner(); + } + + private void InitializeSpawner() + { + // 플레이어 찾기 + GameObject playerObj = GameObject.FindGameObjectWithTag("Player"); + if (playerObj != null) + { + _player = playerObj.GetComponent(); + Debug.Log("플레이어 찾음: " + playerObj.name); + } + + // 스폰 포인트 초기화 + foreach (var location in _monsterLocations) + { + if (location != null) + { + _spawnPoints[location] = false; + Debug.Log($"스폰 포인트 초기화: {location.name}"); + } + } + } + + private void Update() + { + if (_player == null) return; + + CheckSpawnConditions(); + } + + private void CheckSpawnConditions() + { + for (int i = 0; i < _monsterLocations.Count; i++) + { + Transform spawnPoint = _monsterLocations[i]; + if (spawnPoint == null || _spawnPoints[spawnPoint]) continue; + + float distance = Vector2.Distance(_player.transform.position, spawnPoint.position); + if (distance <= _spawnDistance) + { + SpawnMonster(i); + _spawnPoints[spawnPoint] = true; + } + } + } + + private void SpawnMonster(int index) + { + if (index >= _monsterId.Count) + { + Debug.LogError($"유효하지 않은 인덱스: {index}"); + return; + } + + try + { + int monsterId = _monsterId[index]; + + // MonsterDataManager에서 데이터 가져오기 + MonsterData monsterData = MonsterDataManager.Singleton.GetMonsterData(monsterId); + if (monsterData == null) + { + Debug.LogError($"몬스터 ID {monsterId}에 대한 데이터를 찾을 수 없습니다."); + return; + } + + // 몬스터 프리팹 경로 결정 + string prefabPath = GetMonsterPrefabPath(monsterData); + + // 프리팹 로드 + MonsterBase monsterPrefab = Resources.Load(prefabPath); + if (monsterPrefab == null) + { + Debug.LogError($"몬스터 프리팹을 찾을 수 없습니다: {prefabPath}"); + return; + } + + // 몬스터 생성 + Vector3 spawnPosition = _monsterLocations[index].position; + MonsterBase newMonster = Instantiate(monsterPrefab, spawnPosition, Quaternion.identity); + + // 몬스터 초기화 + newMonster.id = monsterId; + _spawnedMonsters.Add(newMonster); + + Debug.Log($"몬스터 생성 완료: ID {monsterId}, 위치 {spawnPosition}"); + } + catch (System.Exception e) + { + Debug.LogError($"몬스터 생성 중 오류 발생: {e.Message}"); + } + } + + private string GetMonsterPrefabPath(MonsterData monsterData) + { + // 몬스터 데이터에 따른 프리팹 경로 결정 + string basePath = "MonsterPrefabs/"; + + // 일반 몬스터인 경우 + if (monsterData.id == 6) + { + return basePath + "Nomal/BlackTroll"; + } + + // 기타 몬스터들 + Dictionary monsterNames = new Dictionary + { + { 1, "BlueDragon" }, + { 2, "BrownWerewolf" }, + { 3, "GreenDragon" }, + { 4, "PurpleOgre" }, + { 5, "RedWerewolf" } + }; + + if (monsterNames.TryGetValue(monsterData.id, out string monsterName)) + { + return basePath + monsterName; + } + + throw new System.Exception($"알 수 없는 몬스터 ID: {monsterData.id}"); + } + + public void OnMonsterDestroyed(MonsterBase monster) + { + if (_spawnedMonsters.Contains(monster)) + { + _spawnedMonsters.Remove(monster); + } + } + } +} diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs.meta b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs.meta new file mode 100644 index 00000000..1bd86f0a --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 481676f31fc794c4b93848b442416f2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/SkillPattern.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/SkillPattern.cs new file mode 100644 index 00000000..73fa913a --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/SkillPattern.cs @@ -0,0 +1,133 @@ +using System.Collections; +using System.Collections.Generic; +using Assets.PixelFantasy.PixelMonsters.Common.Scripts; +using UnityEngine; + +namespace TON +{ + public abstract class SkillPattern + { + protected MonsterData _monsterData; + protected MonsterBase _monsterBase; + + protected SkillPattern(MonsterData monsterData, MonsterBase monsterBase) + { + _monsterData = monsterData; + _monsterBase = monsterBase; + } + + public bool IsAttackable { get; set; } + + public abstract void Attack(GameObject target); + + + public abstract void Update(); + } + + public class Monster1SkillPattern : SkillPattern + { + private float _skill1CoolTime; + private float _skill2CoolTime; + + private MonsterSkillData _monsterSkillData; + private MonsterSkillData _monsterSkillDataTwo; + + private MonsterSkill _skill1; + private MonsterSkill _skill2; + + private Vector3 _skillOffset = new Vector3(0, -0.5f, 0); // 스킬 생성 위치 조정값 + + public Monster1SkillPattern(MonsterData monsterData, MonsterBase monsterBase) : base(monsterData, monsterBase) + { + _monsterSkillData = MonsterSkillDataManager.Singleton.GetMonsterSkillData(_monsterData.monsterSkillID); + if (_monsterData.monsterSkillIDTwo > -1) + { + _monsterSkillDataTwo = MonsterSkillDataManager.Singleton.GetMonsterSkillData(_monsterData.monsterSkillIDTwo); + } + + if (_monsterSkillData != null && _monsterSkillDataTwo != null) + { + + Debug.Log($"몬스터 {_monsterSkillData.skillName} 데이터 로드 완료"); + Debug.Log($"몬스터 {_monsterSkillDataTwo.skillName} 데이터 로드 완료"); + + // 프리팹을 연결한 코드 + _skill1 = Resources.Load($"MonsterSkillPrefabs/{_monsterSkillData.skillName}"); + _skill2 = Resources.Load($"MonsterSkillPrefabs/{_monsterSkillDataTwo.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().flipX = target.transform.position.x < _monsterBase.transform.position.x; + // 몬스터의 현재 위치에서 offset만큼 아래에 스킬 생성 + Vector3 spawnPosition = _monsterBase.transform.position - _skillOffset; + + // 프리팹을 지정된 위치에 생성 + Object.Instantiate(_skill1, spawnPosition, Quaternion.identity); + } + + public override void Update() + { + if (Time.realtimeSinceStartup - _skill1CoolTime >= _monsterSkillData.cooldown) + { + // TODO : 범위 체크 + 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(); + // } + // } +} diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/AttackPattern.cs.meta b/Gameton-06/Assets/Gameton/Scripts/Monster/SkillPattern.cs.meta similarity index 100% rename from Gameton-06/Assets/Gameton/Scripts/Monster/AttackPattern.cs.meta rename to Gameton-06/Assets/Gameton/Scripts/Monster/SkillPattern.cs.meta diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/StateMachine.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/StateMachine.cs index 182e87cc..65e7e075 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Monster/StateMachine.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/StateMachine.cs @@ -1,3 +1,4 @@ +using TMPro; using UnityEngine; namespace TON @@ -8,6 +9,9 @@ namespace TON private IState _state; private MonsterBase _monsterBase; + private TextMeshProUGUI _textState; + + // public StateMachine(IState state, MonsterBase monsterBase, TextMeshProUGUI textState) public StateMachine(IState state, MonsterBase monsterBase) { // 초기 상태 객체 생성 @@ -15,6 +19,9 @@ namespace TON _state = state; _state.Enter(_monsterBase); + + // _textState = textState; + // _textState.text = _state.ToString(); } public void Update() @@ -30,13 +37,13 @@ namespace TON } } - private void SetTransition(IState state) + public void SetTransition(IState state) { // 다음음 상태로 전환 _state = state; _state.Enter(_monsterBase); - Debug.Log($"State : {_state}"); + // _textState.text = _state.ToString(); } } @@ -167,6 +174,11 @@ namespace TON // Idle로 변경 if(_monsterBase.IsDetect== false) return new IdleState(); + + if (_monsterBase.IsSkillAttackable) + { + return new MonsterSkillState(); + } // Attack으로 변경 if (_monsterBase.IsAttacking) @@ -177,9 +189,7 @@ namespace TON } } - - // 몬스터 1의 어택(스킬 1개를 가진 중보스) - // 몬스터 2의 어택(스킬 2개를 가진 보스) + public class AttackState : IState { private const string AniAttack = "Attack"; // 공격 애니메이션 @@ -188,7 +198,6 @@ namespace TON private float _lastAttackTime; // 마지막 공격 시간 private float _attackAnimationDuration = 0.5f; // 공격 애니메이션 지속 시간 private bool _isAttacking = false; - private bool _completAttck; public void Enter(MonsterBase monsterBase) { @@ -215,7 +224,6 @@ namespace TON if (_isAttacking && Time.time >= _lastAttackTime + _attackAnimationDuration) { _isAttacking = false; - _completAttck = true; } } @@ -238,11 +246,9 @@ namespace TON return this; } } - // TODO : HIT, Death 상태 추가 public class MonsterSkillState : IState { private const string AniAttack = "Attack"; // 공격 애니메이션 - private const string AniIdle = "Idle"; // 대기 애니메이션 private MonsterBase _monsterBase; private float _skillAttackAnimationDuration = 0.5f; // 공격 애니메이션 지속 시간 private float _skillAttackDelayTime = 2f; // 공격 딜레이 시간 @@ -269,7 +275,6 @@ namespace TON if (_isSkillAttacking && Time.time >= _lastSkillAttackTime + _skillAttackAnimationDuration) { _isSkillAttacking = false; - _monsterBase.ChangeAnimationState(AniIdle); } } @@ -288,6 +293,10 @@ namespace TON public IState CheckTransition() { + + if(_isSkillAttacking == false) + return new IdleState(); + return this; } } @@ -308,10 +317,7 @@ namespace TON public void Update() { - if (Time.time >= _hitStartTime + _hitDuration) - { - _monsterBase.IsHit = false; - } + } public void Exit() @@ -320,12 +326,6 @@ namespace TON public IState CheckTransition() { - if (_monsterBase.IsHit) - return new HitState(); - - if (_monsterBase.IsDead) - return new DeathState(); - if (Time.time >= _hitStartTime + _hitDuration) return new IdleState(); diff --git a/Gameton-06/ProjectSettings/TagManager.asset b/Gameton-06/ProjectSettings/TagManager.asset index adca1fa0..84d967d3 100644 --- a/Gameton-06/ProjectSettings/TagManager.asset +++ b/Gameton-06/ProjectSettings/TagManager.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aae850547f0ac77fb03b3a73510dc91648e024a5faee403dbd2d49c2dd7c5c75 -size 398 +oid sha256:f7e32960c3b504aa1facac85733f389688d7844f89ca6da62ce4527daf6463ca +size 478