feat: 스테이지 1,2 맵 내의 추락 dead zone 지정 및 캐릭터 사망 시 UI 노출 이벤트 추가
This commit is contained in:
@@ -2458,6 +2458,96 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &690060895
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 690060897}
|
||||||
|
- component: {fileID: 690060896}
|
||||||
|
- component: {fileID: 690060898}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Dead Zone
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!61 &690060896
|
||||||
|
BoxCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 690060895}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_ForceSendLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ForceReceiveLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ContactCaptureLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_CallbackLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_IsTrigger: 1
|
||||||
|
m_UsedByEffector: 0
|
||||||
|
m_UsedByComposite: 0
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_SpriteTilingProperty:
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
oldSize: {x: 0, y: 0}
|
||||||
|
newSize: {x: 0, y: 0}
|
||||||
|
adaptiveTilingThreshold: 0
|
||||||
|
drawMode: 0
|
||||||
|
adaptiveTiling: 0
|
||||||
|
m_AutoTiling: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Size: {x: 90, y: 5}
|
||||||
|
m_EdgeRadius: 0
|
||||||
|
--- !u!4 &690060897
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 690060895}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 47.76, y: -5.28, 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 &690060898
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 690060895}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 742e996d10bb93b4eab96a09af062282, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &718284630
|
--- !u!1 &718284630
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -58762,7 +58852,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 1185367601}
|
m_GameObject: {fileID: 1185367601}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 26.522308, y: -128.69121, z: -10.076585}
|
m_LocalPosition: {x: -80.44, y: -38.899998, z: -10.076585}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
@@ -112945,6 +113035,7 @@ SceneRoots:
|
|||||||
- {fileID: 718284631}
|
- {fileID: 718284631}
|
||||||
- {fileID: 2135657552}
|
- {fileID: 2135657552}
|
||||||
- {fileID: 2067632268}
|
- {fileID: 2067632268}
|
||||||
|
- {fileID: 690060897}
|
||||||
- {fileID: 535565209}
|
- {fileID: 535565209}
|
||||||
- {fileID: 1423029865}
|
- {fileID: 1423029865}
|
||||||
- {fileID: 1441848035}
|
- {fileID: 1441848035}
|
||||||
|
|||||||
@@ -358744,6 +358744,96 @@ Tilemap:
|
|||||||
e31: 0
|
e31: 0
|
||||||
e32: 0
|
e32: 0
|
||||||
e33: 1
|
e33: 1
|
||||||
|
--- !u!1 &1981947245
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1981947248}
|
||||||
|
- component: {fileID: 1981947247}
|
||||||
|
- component: {fileID: 1981947246}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Dead Zone
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1981947246
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1981947245}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 742e996d10bb93b4eab96a09af062282, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!61 &1981947247
|
||||||
|
BoxCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1981947245}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_LayerOverridePriority: 0
|
||||||
|
m_ForceSendLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ForceReceiveLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_ContactCaptureLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_CallbackLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_IsTrigger: 1
|
||||||
|
m_UsedByEffector: 0
|
||||||
|
m_UsedByComposite: 0
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_SpriteTilingProperty:
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
oldSize: {x: 0, y: 0}
|
||||||
|
newSize: {x: 0, y: 0}
|
||||||
|
adaptiveTilingThreshold: 0
|
||||||
|
drawMode: 0
|
||||||
|
adaptiveTiling: 0
|
||||||
|
m_AutoTiling: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Size: {x: 10, y: 5}
|
||||||
|
m_EdgeRadius: 0
|
||||||
|
--- !u!4 &1981947248
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1981947245}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 3.73, y: -39.07, 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!1 &1986734010
|
--- !u!1 &1986734010
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -374444,7 +374534,8 @@ SceneRoots:
|
|||||||
- {fileID: 1068442246}
|
- {fileID: 1068442246}
|
||||||
- {fileID: 718284631}
|
- {fileID: 718284631}
|
||||||
- {fileID: 2135657552}
|
- {fileID: 2135657552}
|
||||||
- {fileID: 535565209}
|
|
||||||
- {fileID: 2067632268}
|
- {fileID: 2067632268}
|
||||||
|
- {fileID: 1981947248}
|
||||||
|
- {fileID: 535565209}
|
||||||
- {fileID: 1355096343}
|
- {fileID: 1355096343}
|
||||||
- {fileID: 1487838324}
|
- {fileID: 1487838324}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ namespace TON
|
|||||||
// ingame UI의 캐릭터 stat 적용을 위한 이벤트
|
// ingame UI의 캐릭터 stat 적용을 위한 이벤트
|
||||||
public event System.Action<float, float> OnHPChanged;
|
public event System.Action<float, float> OnHPChanged;
|
||||||
public event System.Action<float, float> OnSPChanged;
|
public event System.Action<float, float> OnSPChanged;
|
||||||
|
public event System.Action OnDeathCompleted; // 사망 애니메이션 종료 이벤트
|
||||||
|
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
@@ -226,7 +227,7 @@ namespace TON
|
|||||||
// 체력이 0 아래로 떨어지고 현 상태가 IsAlive 일때만 동작하도록 함
|
// 체력이 0 아래로 떨어지고 현 상태가 IsAlive 일때만 동작하도록 함
|
||||||
if (currentHP <= 0f && prevHP > 0)
|
if (currentHP <= 0f && prevHP > 0)
|
||||||
{
|
{
|
||||||
animator.SetTrigger("Dead Trigger");
|
Dead();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 체력이 0 보다 클때만 피격 모션 실행
|
// 체력이 0 보다 클때만 피격 모션 실행
|
||||||
@@ -241,8 +242,13 @@ namespace TON
|
|||||||
|
|
||||||
public void Dead()
|
public void Dead()
|
||||||
{
|
{
|
||||||
gameObject.SetActive(false);
|
animator.SetTrigger("Dead Trigger");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DestroyDead()
|
||||||
|
{
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
OnDeathCompleted?.Invoke(); // 사망 애니메이션 종료 시점에 이벤트 호출
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace TON
|
|||||||
{
|
{
|
||||||
if (animator.TryGetComponent(out CharacterBase character))
|
if (animator.TryGetComponent(out CharacterBase character))
|
||||||
{
|
{
|
||||||
character.Dead();
|
character.DestroyDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
27
Gameton-06/Assets/Gameton/Scripts/GameStage/StageDeadZone.cs
Normal file
27
Gameton-06/Assets/Gameton/Scripts/GameStage/StageDeadZone.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace TON
|
||||||
|
{
|
||||||
|
public class StageDeadZone : MonoBehaviour
|
||||||
|
{
|
||||||
|
private void OnTriggerEnter2D(Collider2D collision)
|
||||||
|
{
|
||||||
|
if (collision.CompareTag("Player"))
|
||||||
|
{
|
||||||
|
CharacterBase character = collision.gameObject.GetComponentInChildren<CharacterBase>();
|
||||||
|
character.Dead();
|
||||||
|
|
||||||
|
character.OnDeathCompleted += ShowGameOverUI; // 이벤트 구독
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowGameOverUI()
|
||||||
|
{
|
||||||
|
UIManager.Show<GameoverUI>(UIList.GameOverUI);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 742e996d10bb93b4eab96a09af062282
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Reference in New Issue
Block a user