Commit 6c2bbddd authored by 16도재형's avatar 16도재형

구조는 대충 짠듯? 이제 찐&쭈만 넣으면 된다

parent afdabc0c
...@@ -2,21 +2,26 @@ ...@@ -2,21 +2,26 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class Boss : MonoBehaviour { public class Boss : Enemy {
public BossRoomInGame bossRoom; public BossRoomInGame bossRoom;
protected virtual void Awake() protected override IEnumerator OnIce(float duration) { yield return null; }
protected override IEnumerator OnStun(float duration) { yield return null; }
protected override IEnumerator Knockback(float knockbackDist, float knockbackTime) { yield return null; }
protected override void Awake()
{ {
; base.Awake();
} }
// Use this for initialization // Use this for initialization
void Start () { protected override void Start()
{
base.Start();
} }
// Update is called once per frame protected override void FixedUpdate()
void Update () { {
base.FixedUpdate();
} }
} }
fileFormatVersion: 2
guid: 4c4bf7e2f72d3664bbe31de39b9cf256
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ji : Boss {
protected override void Awake()
{
base.Awake();
}
// Use this for initialization
protected override void Start()
{
base.Start();
}
protected override void FixedUpdate()
{
base.FixedUpdate();
}
}
fileFormatVersion: 2
guid: 04d5fb659b30a0c4a839ebf5ec951491
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Joo : Boss {
protected override void Awake()
{
base.Awake();
}
// Use this for initialization
protected override void Start()
{
base.Start();
}
protected override void FixedUpdate()
{
base.FixedUpdate();
}
}
fileFormatVersion: 2
guid: 08e33121b29e7a941b4ea5f390a61ffb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -13,8 +13,10 @@ public class JiJooRoom : BossRoomInGame { ...@@ -13,8 +13,10 @@ public class JiJooRoom : BossRoomInGame {
protected override void Start () protected override void Start ()
{ {
base.Start(); base.Start();
transitionAction[0] += Phase0Transition; phaseAction[0] += Phase1;
transitionAction[1] += Phase1Transition; phaseAction[1] += Phase2;
transitionAction[0] += Phase1Transition;
transitionAction[1] += Phase2Transition;
} }
// Update is called once per frame // Update is called once per frame
...@@ -23,11 +25,11 @@ public class JiJooRoom : BossRoomInGame { ...@@ -23,11 +25,11 @@ public class JiJooRoom : BossRoomInGame {
base.Update(); base.Update();
} }
protected void Phase0Transition() protected void Phase1Transition()
{ {
} }
protected void Phase1Transition() protected void Phase2Transition()
{ {
} }
......
...@@ -30,19 +30,20 @@ public class BossRoomInGame : RoomInGame { ...@@ -30,19 +30,20 @@ public class BossRoomInGame : RoomInGame {
} }
} }
public bool isTransitionFinished; public bool isTransitionFinished;
// phaseAction 전(isTransitionFinished == false 일때) 매 프레임 호출됨; Update 대응 // phaseUpdate 전(isTransitionFinished == false 일때) 매 프레임 호출됨; Update 대응
public Action[] transitionAction; public Action[] transitionUpdate;
// 진행중인 phase coroutine에서 매 프레임 호출됨; Update 대용 // 진행중인 phase coroutine에서 매 프레임 호출됨; Update 대용
public Action[] phaseAction; public Action[] phaseUpdate;
// 현재 진행중인 phase coroutine // 현재 진행중인 phase coroutine
private IEnumerator phaseCoroutine; private IEnumerator phaseCoroutine;
protected bool attackStart; protected bool attackStart = false;
protected bool attackTrigger = false;
protected virtual void Awake() protected virtual void Awake()
{ {
transitionAction = new Action[totalPhase]; transitionUpdate = new Action[totalPhase];
phaseAction = new Action[totalPhase]; phaseUpdate = new Action[totalPhase];
} }
// Use this for initialization // Use this for initialization
...@@ -54,10 +55,10 @@ public class BossRoomInGame : RoomInGame { ...@@ -54,10 +55,10 @@ public class BossRoomInGame : RoomInGame {
// Update is called once per frame // Update is called once per frame
protected virtual void Update() protected virtual void Update()
{ {
if (attackStart) if (!attackStart && attackTrigger)
{ {
StartCoroutine(BeforeBossFight()); StartCoroutine(BeforeBossFight());
attackStart = false; attackStart = true;
} }
} }
...@@ -75,12 +76,12 @@ public class BossRoomInGame : RoomInGame { ...@@ -75,12 +76,12 @@ public class BossRoomInGame : RoomInGame {
isTransitionFinished = false; isTransitionFinished = false;
while (!isTransitionFinished) while (!isTransitionFinished)
{ {
transitionAction[phase](); transitionUpdate[phase]();
yield return null; yield return null;
} }
while (CurPhase == phase) while (CurPhase == phase)
{ {
phaseAction[phase](); phaseUpdate[phase]();
yield return null; yield return null;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment