Commit 94858f5a authored by 16도재형's avatar 16도재형

보스 및 보스방 하는 중, enemy 풀받아서 상속할생각

parent 926ba458
......@@ -3,6 +3,12 @@ using System.Collections.Generic;
using UnityEngine;
public class Boss : MonoBehaviour {
public BossRoomInGame bossRoom;
protected virtual void Awake()
{
;
}
// Use this for initialization
void Start () {
......
fileFormatVersion: 2
guid: 4c4bf7e2f72d3664bbe31de39b9cf256
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: de02c07fa96ee9a4db10a2e3e1f5815a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class JiJooRoom : BossRoomInGame {
protected override void Awake()
{
base.Awake();
}
// Use this for initialization
protected override void Start ()
{
base.Start();
transitionAction[0] += Phase0Transition;
transitionAction[1] += Phase1Transition;
}
// Update is called once per frame
protected override void Update ()
{
base.Update();
}
protected void Phase0Transition()
{
}
protected void Phase1Transition()
{
}
protected void Phase1()
{
}
protected void Phase2()
{
}
}
fileFormatVersion: 2
guid: f0bea638eed7b944780becb205ba4e03
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BossRoomInGame : RoomInGame {
public Boss[] bosses;
public int totalPhase;
private int curPhase = -1;
public int CurPhase
{
get { return curPhase; }
set
{
// 모든 페이즈가 끝났을때
if (value > totalPhase)
{
curPhase = -1;
RoomClear();
}
// 페이즈 이동
else if (value != curPhase)
{
if (phaseCoroutine != null)
StopCoroutine(phaseCoroutine);
curPhase = value;
phaseCoroutine = Phase(curPhase);
StartCoroutine(phaseCoroutine);
}
}
}
public bool isTransitionFinished;
// phaseAction 전(isTransitionFinished == false 일때) 매 프레임 호출됨; Update 대응
public Action[] transitionAction;
// 진행중인 phase coroutine에서 매 프레임 호출됨; Update 대용
public Action[] phaseAction;
// 현재 진행중인 phase coroutine
private IEnumerator phaseCoroutine;
protected bool attackStart;
protected virtual void Awake()
{
transitionAction = new Action[totalPhase];
phaseAction = new Action[totalPhase];
}
// Use this for initialization
protected virtual void Start()
{
}
// Update is called once per frame
protected virtual void Update()
{
if (attackStart)
{
StartCoroutine(BeforeBossFight());
attackStart = false;
}
}
protected virtual IEnumerator BeforeBossFight()
{
CurPhase++;
yield return null;
}
protected virtual IEnumerator AfterBossFight()
{
yield return null;
}
IEnumerator Phase(int phase)
{
isTransitionFinished = false;
while (!isTransitionFinished)
{
transitionAction[phase]();
yield return null;
}
while (CurPhase == phase)
{
phaseAction[phase]();
yield return null;
}
}
public override void RoomEnter()
{
......
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