2026-05-21 버그 수정
This commit is contained in:
BIN
Assets/01_Scenes/BossScene.unity
LFS
BIN
Assets/01_Scenes/BossScene.unity
LFS
Binary file not shown.
@@ -12,7 +12,6 @@ private void Awake()
|
|||||||
{
|
{
|
||||||
_collider = GetComponent<Collider2D>();
|
_collider = GetComponent<Collider2D>();
|
||||||
_collider.isTrigger = true;
|
_collider.isTrigger = true;
|
||||||
_collider.enabled = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTriggerStay2D(Collider2D other)
|
private void OnTriggerStay2D(Collider2D other)
|
||||||
|
|||||||
@@ -21,9 +21,8 @@ public class HazardSkill : BossSkill
|
|||||||
[SerializeField] private float _windup = 0.5f; // 애니 시작 ~ 피해 판정 ON
|
[SerializeField] private float _windup = 0.5f; // 애니 시작 ~ 피해 판정 ON
|
||||||
[SerializeField] private float _activeDuration = 1.5f; // 피해 판정 유지 시간
|
[SerializeField] private float _activeDuration = 1.5f; // 피해 판정 유지 시간
|
||||||
[SerializeField] private float _recovery = 0.6f; // 판정 OFF 후 후딜
|
[SerializeField] private float _recovery = 0.6f; // 판정 OFF 후 후딜
|
||||||
[SerializeField] private Transform[] _downHazardFirePos; // 위에서 아래로 포격
|
|
||||||
[SerializeField] private Transform[] _rightHazardFirePos; // 왼쪽에서 오른쪽으로 포격
|
|
||||||
[SerializeField] private GameObject _hazardHitboxOrigin;
|
[SerializeField] private GameObject _hazardHitboxOrigin;
|
||||||
|
private SkillSupport support;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
@@ -31,6 +30,11 @@ private void Awake()
|
|||||||
_animator = GetComponentInChildren<Animator>();
|
_animator = GetComponentInChildren<Animator>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
support = Object.FindFirstObjectByType<SkillSupport>();
|
||||||
|
}
|
||||||
|
|
||||||
protected override async Awaitable RunSkill(CancellationToken token)
|
protected override async Awaitable RunSkill(CancellationToken token)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -64,7 +68,7 @@ protected override async Awaitable RunSkill(CancellationToken token)
|
|||||||
|
|
||||||
private void FireHazards(int dirChoice)
|
private void FireHazards(int dirChoice)
|
||||||
{
|
{
|
||||||
Transform[] _hazardPoss = dirChoice switch { 0 => _downHazardFirePos, 1=>_rightHazardFirePos, _=> null};
|
Transform[] _hazardPoss = dirChoice switch { 0 => support.DownHazardFirePos, 1=> support.RightHazardFirePos, _=> null};
|
||||||
Vector2 attackDir = dirChoice switch {0 => Vector2.down,1=>Vector2.right,_=>Vector2.left};
|
Vector2 attackDir = dirChoice switch {0 => Vector2.down,1=>Vector2.right,_=>Vector2.left};
|
||||||
|
|
||||||
if (_hazardPoss == null) return;
|
if (_hazardPoss == null) return;
|
||||||
@@ -75,7 +79,7 @@ private void FireHazards(int dirChoice)
|
|||||||
Rigidbody2D hitbox_rb = hitbox.GetComponent<Rigidbody2D>();
|
Rigidbody2D hitbox_rb = hitbox.GetComponent<Rigidbody2D>();
|
||||||
if(hitbox_rb != null)
|
if(hitbox_rb != null)
|
||||||
{
|
{
|
||||||
hitbox_rb.linearVelocity = attackDir*5.0f;
|
hitbox_rb.linearVelocity = attackDir*50.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
Destroy(hitbox,5f);
|
Destroy(hitbox,5f);
|
||||||
|
|||||||
23
Assets/02_Scripts/Enemy/Skills/SkillSupport.cs
Normal file
23
Assets/02_Scripts/Enemy/Skills/SkillSupport.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class SkillSupport : MonoBehaviour
|
||||||
|
{
|
||||||
|
[HideInInspector] public Transform[] DownHazardFirePos; // 위에서 아래로 포격
|
||||||
|
[HideInInspector] public Transform[] RightHazardFirePos; // 왼쪽에서 오른쪽으로 포격
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
GameObject[] shineDownStartPoss = GameObject.FindGameObjectsWithTag("ShineDownStartPos");
|
||||||
|
GameObject[] shineRightStartPoss = GameObject.FindGameObjectsWithTag("ShineRightStartPos");
|
||||||
|
|
||||||
|
DownHazardFirePos = new Transform[shineDownStartPoss.Length];
|
||||||
|
RightHazardFirePos = new Transform[shineRightStartPoss.Length];
|
||||||
|
|
||||||
|
for(int i=0;i<DownHazardFirePos.Length;i++)
|
||||||
|
DownHazardFirePos[i] = shineDownStartPoss[i].transform;
|
||||||
|
|
||||||
|
for(int i=0;i<RightHazardFirePos.Length;i++)
|
||||||
|
RightHazardFirePos[i] = shineRightStartPoss[i].transform;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/02_Scripts/Enemy/Skills/SkillSupport.cs.meta
Normal file
2
Assets/02_Scripts/Enemy/Skills/SkillSupport.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dbd0de93dbf5f0f4699171d0a909b4b5
|
||||||
Binary file not shown.
Binary file not shown.
BIN
Assets/08_Objects/BossSkills/HazardSkill/HazardSkill.prefab
LFS
Normal file
BIN
Assets/08_Objects/BossSkills/HazardSkill/HazardSkill.prefab
LFS
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 2661c3fd528b72b46b2236fd0f53c4a6
|
guid: a9e66d0ddb9a69d45be17f4fd4cf54cc
|
||||||
PrefabImporter:
|
PrefabImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
BIN
ProjectSettings/TagManager.asset
LFS
BIN
ProjectSettings/TagManager.asset
LFS
Binary file not shown.
Reference in New Issue
Block a user