보스 완
This commit is contained in:
@@ -16,13 +16,13 @@ namespace Unicorn.Boss
|
||||
private UnicornPhase _unicornPhase = UnicornPhase.Start;
|
||||
private Queue<GameObject> _p1Ps = new Queue<GameObject>();
|
||||
private SpriteRenderer _renderer;
|
||||
private const float P1PC = 12;
|
||||
private const float P1PC = 50;
|
||||
|
||||
public Transform projContainer;
|
||||
public GameObject phase1Proj;
|
||||
|
||||
|
||||
private void Start()
|
||||
private new void Start()
|
||||
{
|
||||
_renderer = GetComponent<SpriteRenderer>();
|
||||
StartCoroutine(Started());
|
||||
@@ -31,7 +31,8 @@ namespace Unicorn.Boss
|
||||
|
||||
private IEnumerator Started()
|
||||
{
|
||||
const float target = 360*5/P1PC;
|
||||
Invulnerable = true;
|
||||
const float target = P1PC*5;
|
||||
while (_p1Ps.Count < target)
|
||||
{
|
||||
for (var i = 0; i < 5 && _p1Ps.Count < target; i++) //프레임당 5개씩 생성
|
||||
@@ -45,26 +46,21 @@ namespace Unicorn.Boss
|
||||
StartCoroutine(Phase1());
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 수정된 Phase1 로직
|
||||
private IEnumerator Phase1()
|
||||
{
|
||||
Invulnerable = false;
|
||||
_unicornPhase = UnicornPhase.P1;
|
||||
float angleStep = 360f / P1PC; // 각도 간격 (30도)
|
||||
const float angleStep = 360f / P1PC; // 각도 간격 (30도)
|
||||
|
||||
for (int i = 0; i < P1PC; i++)
|
||||
for (var i = 0; i < P1PC; i++)
|
||||
{
|
||||
var dequeue = _p1Ps.Dequeue();
|
||||
dequeue.SetActive(true);
|
||||
dequeue.transform.position = transform.position;
|
||||
float targetAngle = transform.rotation.eulerAngles.z + (angleStep * i);
|
||||
var targetAngle = transform.rotation.eulerAngles.z + (angleStep * i);
|
||||
dequeue.transform.rotation = Quaternion.Euler(0, 0, targetAngle);
|
||||
_p1Ps.Enqueue(dequeue);
|
||||
yield return new WaitForSeconds(.2f);
|
||||
}
|
||||
yield return new WaitForSeconds(1);
|
||||
StartCoroutine(Phase1());
|
||||
|
||||
@@ -8,8 +8,11 @@ namespace Unicorn
|
||||
public float maxHealth = 20.0f;
|
||||
public float health = 20.0f;
|
||||
public GameObject hpBarPrefab;
|
||||
|
||||
|
||||
protected bool Invulnerable = false;
|
||||
|
||||
private Rigidbody2D Rb { get; set; }
|
||||
private bool _invulnerable = false;
|
||||
private HpBar _hpBar;
|
||||
|
||||
protected void Start()
|
||||
@@ -21,7 +24,7 @@ namespace Unicorn
|
||||
|
||||
public void Damage(DamageInfo info)
|
||||
{
|
||||
if (_invulnerable) return;
|
||||
if (Invulnerable) return;
|
||||
health -= info.Damage;
|
||||
OnDamaged(info);
|
||||
OnKnockback(info);
|
||||
|
||||
Reference in New Issue
Block a user