그 보스 페이즈? 노션 보고 잘 만들어주세요
TMP는 깃에서 없애야 하는데 저 할 줄 모르니까 알아서 잘 해보시고 어자피 프로젝트 크기 5메가바이트도 안 넘으니까 굳이굳이 할 필요 없으심 즐 전 자러감ㅋㅋ
This commit is contained in:
71
Assets/Scripts/Unicorn/Boss/Tuna.cs
Normal file
71
Assets/Scripts/Unicorn/Boss/Tuna.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unicorn.Hitbox;
|
||||
using UnityEngine;
|
||||
using NotImplementedException = System.NotImplementedException;
|
||||
|
||||
namespace Unicorn.Boss
|
||||
{
|
||||
internal enum UnicornPhase
|
||||
{
|
||||
Start, P1, P2, P3, End
|
||||
}
|
||||
public class Tuna : LivingEntity
|
||||
{
|
||||
|
||||
private UnicornPhase _unicornPhase = UnicornPhase.Start;
|
||||
private Queue<GameObject> _p1Ps = new Queue<GameObject>();
|
||||
private const float P1PC = 12;
|
||||
|
||||
public Transform projContainer;
|
||||
public GameObject phase1Proj;
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
StartCoroutine(Started());
|
||||
}
|
||||
|
||||
private IEnumerator Started()
|
||||
{
|
||||
while (_p1Ps.Count < 50)
|
||||
{
|
||||
for (var i = 0; i < 5 && _p1Ps.Count < 50; i++) //프레임당 5개씩 생성
|
||||
{
|
||||
var instantiate = Instantiate(phase1Proj, projContainer);
|
||||
_p1Ps.Enqueue(instantiate);
|
||||
instantiate.SetActive(false);
|
||||
}
|
||||
yield return new WaitForEndOfFrame();
|
||||
}
|
||||
StartCoroutine(Phase1());
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private IEnumerator Phase1()
|
||||
{
|
||||
_unicornPhase = UnicornPhase.P1;
|
||||
for (int i = 0; i < 360 / P1PC; i++)
|
||||
{
|
||||
var dequeue = _p1Ps.Dequeue();
|
||||
dequeue.SetActive(true);
|
||||
dequeue.transform.position = transform.position;
|
||||
var rotationEulerAngles = transform.rotation.eulerAngles;
|
||||
rotationEulerAngles.z += (360 / P1PC) * i;
|
||||
dequeue.transform.rotation = Quaternion.Euler(rotationEulerAngles);
|
||||
_p1Ps.Enqueue(dequeue);
|
||||
}
|
||||
yield return new WaitForSeconds(5);
|
||||
StartCoroutine(Phase1());
|
||||
}
|
||||
|
||||
protected override void OnKnockback(DamageInfo info)
|
||||
{
|
||||
//No KnockBack
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Unicorn/Boss/Tuna.cs.meta
Normal file
2
Assets/Scripts/Unicorn/Boss/Tuna.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f3078fdd3458bf459c4463291b07499
|
||||
Reference in New Issue
Block a user