Commit 79ee0063 authored by 16서원빈's avatar 16서원빈 Committed by Chae Ho Shin

Fix bug

parent d94eeb54
......@@ -20,37 +20,24 @@ public class Clap : MotionNote
{
}
private bool isChecked = false;
public override bool IsChecked
public override void Checkpoint()
{
get
{
return isChecked;
}
}
public override IEnumerator Checkpoint(MotionNote obj)
{
IsCoroutineExecuted = true;
var motion = InputManager.Instance.CurrentMotionState;
while ((motion & MotionState.CLAP_PREPARE) == 0)
{
yield return null;
}
isChecked = true;
if ((motion & MotionState.CLAP_PREPARE) == 0)
return;
yield break;
IsChecked = true;
}
public override bool FinalJudgeAction()
{
var motion = InputManager.Instance.CurrentMotionState;
if (isChecked && (motion & MotionState.CLAP_DONE) != 0)
if (IsChecked && (motion & MotionState.CLAP_DONE) != 0)
{
return true;
}
return false;
}
......
......@@ -90,7 +90,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
......@@ -117,7 +117,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
......@@ -144,7 +144,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
......@@ -219,7 +219,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 30, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 3, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224619449702362956
......@@ -237,8 +237,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 15, y: 0}
m_SizeDelta: {x: 30, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 3, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224834283073951364
RectTransform:
......
......@@ -117,6 +117,7 @@ GameObject:
m_Component:
- component: {fileID: 1829858}
- component: {fileID: 1829857}
- component: {fileID: 1829859}
m_Layer: 0
m_Name: Score Display Manager
m_TagString: Untagged
......@@ -154,6 +155,17 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1829859
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1829856}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6e697643158480b4ba850d906eac1bc2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &8282761
GameObject:
m_ObjectHideFlags: 0
......@@ -1102,7 +1114,7 @@ RectTransform:
- {fileID: 1667908251}
- {fileID: 1677681266}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
......@@ -1199,68 +1211,6 @@ CanvasRenderer:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1243499222}
--- !u!1 &1570306258
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1570306261}
- component: {fileID: 1570306260}
- component: {fileID: 1570306259}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1570306259
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1570306258}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &1570306260
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1570306258}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 5
--- !u!4 &1570306261
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1570306258}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1667908250
GameObject:
m_ObjectHideFlags: 0
......
......@@ -132,7 +132,7 @@ RectTransform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 236248255}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1741478284}
......
......@@ -24,6 +24,7 @@ public class JudgeManager : MonoBehaviour
float latency = 225f;
float scrollMultiplier = 1.0f;
float startOffset = -5f;
private GameObject offset;
private GameObject noteobj, smobj, lmobj;
......@@ -36,8 +37,6 @@ public class JudgeManager : MonoBehaviour
private float elapsedTime = 0;
private List<MotionNote> activatedNotes;
private float MsPerBeat
{
get
......@@ -96,10 +95,8 @@ public class JudgeManager : MonoBehaviour
judgeText.SetActive(false);
MotionGuageReset();
activatedNotes = new List<MotionNote>();
LoadNotes(GameManager.Instance.CurrentTrack.Notes);
// Instantiate(GameManager.Instance.CurrentTrack.BGM);
Instantiate(GameManager.Instance.CurrentTrack.BGM);
}
// Update is called once per frame
......@@ -138,7 +135,7 @@ public class JudgeManager : MonoBehaviour
}
if (InputManager.Instance.IsButtonReleased)
{
SetJudge(Judge.TestJudge(note, timing, true));
SetJudge(Judge.TestJudge(note, timing), true);
DeactivateNote(note);
return;
}
......@@ -176,10 +173,7 @@ public class JudgeManager : MonoBehaviour
GameObject smo = smobj.transform.GetChild(0).gameObject;
MotionNote smnote = (MotionNote)smo.GetComponent<Note.Controller>().Instance;
if (!smnote.IsCoroutineExecuted)
{
StartCoroutine(smnote.Checkpoint(smnote));
}
smnote.Checkpoint();
if (!smnote.Activated && timing >= (smnote.StartTiming - MsPerBeat))
{
......@@ -187,34 +181,33 @@ public class JudgeManager : MonoBehaviour
MotionSampleDisplay msd = motionSample.GetComponent<MotionSampleDisplay>();
msd.sprite = smnote.Image;
msd.timeout = MsPerBeat;
smnote.Activated = true;
smnote.MotionSampleDisplay = msd;
activatedNotes.Add(smnote);
smnote.Component.transform.SetParent(offset.transform);
smnote.Activated = true;
}
for(int i=activatedNotes.Count-1;i>=0;i--)
if(timing >= (smnote.StartTiming - Judge.MaxButtonTimingRange))
{
if((InputManager.Instance.CurrentMotionState & MotionState.CLAP_DONE) != 0)
if (smnote.FinalJudgeAction() || (timing > (smnote.EndTiming + Judge.MaxButtonTimingRange)))
{
foreach (MotionNote anote in activatedNotes)
{
Debug.Log(anote.IsChecked);
}
SetJudge(Judge.TestJudge(smnote, timing, true), true);
DeactivateNote(smnote);
}
}
// Debug.Log("T: " + timing + " nQ: " + activatedNotes.Count);
/*
for(int i=activatedNotes.Count-1;i>=0;i--)
{
MotionNote note = activatedNotes[i];
if (note.FinalJudgeAction() || (timing > (note.EndTiming + Judge.MaxButtonTimingRange)))
{
Debug.Log(note.IsChecked);
SetJudge(Judge.TestJudge(note, timing, false, true), true);
SetJudge(Judge.TestJudge(note, timing + 350, false), true);
activatedNotes.RemoveAt(i);
DeactivateNote(note);
}
}
}*/
})();
/*
new Action(() =>
{
if (lmobj.transform.childCount <= 0)
......@@ -223,7 +216,7 @@ public class JudgeManager : MonoBehaviour
GameObject lmo = lmobj.transform.GetChild(0).gameObject;
MotionNote lmnote = (MotionNote)lmo.GetComponent<Note.Controller>().Instance;
StartCoroutine(lmnote.Checkpoint(lmnote));
lmnote.Checkpoint();
if (!lmnote.Activated && elapsedTime >= (lmnote.StartTiming - MsPerBeat))
{
......@@ -251,6 +244,7 @@ public class JudgeManager : MonoBehaviour
}
}
})();
*/
}
private void DeactivateNote(Note note)
......
......@@ -13,12 +13,10 @@ public abstract class MotionNote : Note
public MotionNote(string key, float start, float end = 0f)
: this(start, end) { }
public abstract IEnumerator Checkpoint(MotionNote obj);
public abstract void Checkpoint();
public abstract bool FinalJudgeAction();
public abstract bool IsChecked { get; }
public bool IsCoroutineExecuted { get; protected set; }
public bool IsChecked { get; protected set; }
public MotionSampleDisplay MotionSampleDisplay { get; set; }
......@@ -26,45 +24,6 @@ public abstract class MotionNote : Note
= new Dictionary<string, Type>
{
{ "CP", typeof(Clap) },
{ "JP", typeof(Jump) },
{ "BP", typeof(PushUp) },
{ "LP", typeof(PushUp) },
{ "RP", typeof(PushUp) },
{ "BK", typeof(PushUp) },
{ "LK", typeof(PushUp) },
{ "RK", typeof(PushUp) },
{ "BI", typeof(Guard) },
{ "LI", typeof(Guard) },
{ "RI", typeof(Guard) },
{ "BG", typeof(Guard) },
{ "LG", typeof(Guard) },
{ "RG", typeof(Guard) },
{ "BL", typeof(Guard) },
{ "LL", typeof(Guard) },
{ "RL", typeof(Guard) },
// Long motion
{ "BU", typeof(Guard) },
{ "LU", typeof(Guard) },
{ "RU", typeof(Guard) },
{ "BD", typeof(Guard) },
{ "LD", typeof(Guard) },
{ "RD", typeof(Guard) },
{ "JS", typeof(Guard) },
{ "BH", typeof(Guard) },
{ "LH", typeof(Guard) },
{ "RH", typeof(Guard) },
{ "OT", typeof(Guard) },
};
protected static Sprite LoadNewSprite(string FilePath, float PixelsPerUnit = 100.0f)
......
......@@ -4,6 +4,8 @@
#BPM 128
#PLAYLEVEL 0
#WAV Test.wav
#TRACKLIST Something - Someone
#TRACKLIST Probably - Amumal
#TRACKLIST PARANOiA - Revolution
......
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