Commit 62b560f5 authored by 13정준영's avatar 13정준영

Merge remote-tracking branch 'origin/notemovement'

parents 1b6d4c2b 0b60d17a
fileFormatVersion: 2
guid: d9a533cec04e2124e9c31541b4f63e72
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -13,10 +13,7 @@ public class CameraController : MonoBehaviour ...@@ -13,10 +13,7 @@ public class CameraController : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
if (Input.GetMouseButtonDown(0))
{
CameraShake(0.2f, 0.1f);
}
} }
private void OnDrawGizmos() private void OnDrawGizmos()
......
...@@ -28,7 +28,7 @@ public class EdgeNoteObject : NoteObject ...@@ -28,7 +28,7 @@ public class EdgeNoteObject : NoteObject
{ {
PlayJudgeSfx(type); PlayJudgeSfx(type);
PlayEngine.inst.HandleNoteJudge(type.type); PlayEngine.inst.HandleNoteJudge(type);
BlinkLight light = Instantiate(PlayEngine.inst.edgeHitEffectPrefab, -5 * direction, Quaternion.identity); BlinkLight light = Instantiate(PlayEngine.inst.edgeHitEffectPrefab, -5 * direction, Quaternion.identity);
light.transform.LookAt(Vector3.zero); light.transform.LookAt(Vector3.zero);
light.Init(type.type); light.Init(type.type);
......
...@@ -77,7 +77,7 @@ public abstract class NoteObject : MonoBehaviour ...@@ -77,7 +77,7 @@ public abstract class NoteObject : MonoBehaviour
if (trailRenderer) trailRenderer.enabled = false; if (trailRenderer) trailRenderer.enabled = false;
PlayEngine.inst.HandleNoteJudge(judge.type); PlayEngine.inst.HandleNoteJudge(judge);
} }
} }
......
...@@ -41,8 +41,10 @@ public class PlayEngine : SingletonBehaviour<PlayEngine> ...@@ -41,8 +41,10 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
private MotionTracker leftHandTracker = new MotionTracker(); private MotionTracker leftHandTracker = new MotionTracker();
private MotionTracker rightHandTracker = new MotionTracker(); private MotionTracker rightHandTracker = new MotionTracker();
private int combo; public int maxCombo;
private int score; public int combo;
public int score;
public int perfect, hit, miss;
[SerializeField] [SerializeField]
private Transform HitEffectObjects; private Transform HitEffectObjects;
...@@ -74,6 +76,8 @@ public class PlayEngine : SingletonBehaviour<PlayEngine> ...@@ -74,6 +76,8 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
audioSource.clip = audioFile; audioSource.clip = audioFile;
audioSource.PlayScheduled(playOffset + dspTime); audioSource.PlayScheduled(playOffset + dspTime);
Debug.Log(playOffset); Debug.Log(playOffset);
combo = maxCombo = score = miss = perfect = hit = 0;
} }
void OnEnable() void OnEnable()
...@@ -157,6 +161,13 @@ public class PlayEngine : SingletonBehaviour<PlayEngine> ...@@ -157,6 +161,13 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
throw e; throw e;
} }
} }
if (!audioSource.isPlaying)
{
level = null;
IngameUIManager.inst.UpdateResultUIs(perfect, hit, miss, score, combo);
IngameUIManager.inst.ChangeUISet(UISetType.RESULT);
}
} }
if (Input.GetKeyDown(KeyCode.LeftArrow)) if (Input.GetKeyDown(KeyCode.LeftArrow))
...@@ -236,17 +247,32 @@ public class PlayEngine : SingletonBehaviour<PlayEngine> ...@@ -236,17 +247,32 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
// Simple implementations of Combo, Score UIs // Simple implementations of Combo, Score UIs
// It needs to be changed if PlayEngine don't have any responsibilities of score & combo // It needs to be changed if PlayEngine don't have any responsibilities of score & combo
public void HandleNoteJudge(JudgeType type) public void HandleNoteJudge(JudgeResult result)
{ {
JudgeType type = result.type;
if (type == JudgeType.Ignore) if (type == JudgeType.Ignore)
return; return;
combo = type != JudgeType.Miss ? combo + 1 : 0; combo = type != JudgeType.Miss ? combo + 1 : 0;
score += (int)type; maxCombo = Mathf.Max(maxCombo, combo);
score += (int)type * (result.correctHand ? 2 : 1) + combo;
IngameUIManager.inst.UpdateComboUI(combo); IngameUIManager.inst.UpdateComboUI(combo);
IngameUIManager.inst.UpdateScoreUI(score); IngameUIManager.inst.UpdateScoreUI(score);
foreach (var renderer in HitEffectObjects.GetComponentsInChildren<MeshRenderer>()) switch (type)
{
case JudgeType.Miss:
miss++;
break;
case JudgeType.Hit:
hit++;
break;
case JudgeType.Perfect:
perfect++;
break;
}
foreach (var renderer in HitEffectObjects.GetComponentsInChildren<MeshRenderer>())
{ {
Color col = Color.white; Color col = Color.white;
switch (type) switch (type)
......
...@@ -34,7 +34,7 @@ public class ReloadNoteObject : NoteObject ...@@ -34,7 +34,7 @@ public class ReloadNoteObject : NoteObject
Instantiate(hitEffect, transform.position, Quaternion.identity); Instantiate(hitEffect, transform.position, Quaternion.identity);
StartCoroutine(DissolveRoutine()); StartCoroutine(DissolveRoutine());
PlayEngine.inst.HandleNoteJudge(judge.type); PlayEngine.inst.HandleNoteJudge(judge);
} }
} }
......
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