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

Short Motion Judge just WORKS

parent 9d2c6c23
fileFormatVersion: 2
guid: 85bafbe9b14b18b45b445b304b1f3efc
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 1
settings:
CPU: x86
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b65facb0c9c68b647b8ca7435b5f35c4
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
data:
first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 82e143d16729051459ae6a54b37e9eab
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86_64
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
data:
first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
...@@ -81,7 +81,7 @@ Transform: ...@@ -81,7 +81,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1892747765238962} m_GameObject: {fileID: 1892747765238962}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 4171896903265876} m_Father: {fileID: 4171896903265876}
...@@ -94,7 +94,7 @@ Transform: ...@@ -94,7 +94,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1531738911155356} m_GameObject: {fileID: 1531738911155356}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 4171896903265876} m_Father: {fileID: 4171896903265876}
......
fileFormatVersion: 2
guid: 5fa6fbae1b887c741847a319ae0ae7b5
folderAsset: yes
timeCreated: 1503591523
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: eaf650b1e6fa62148bca440563b186a6
timeCreated: 1503591523
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
...@@ -152,13 +153,14 @@ public class JudgeManager : MonoBehaviour ...@@ -152,13 +153,14 @@ public class JudgeManager : MonoBehaviour
smnote.MotionSampleDisplay = msd; smnote.MotionSampleDisplay = msd;
activatedNotes.Add(smnote); activatedNotes.Add(smnote);
} }
foreach (MotionNote note in activatedNotes) for(int i=activatedNotes.Count-1;i>=0;i--)
{ {
if(note.MotionSampleDisplay == null) MotionNote note = activatedNotes[i];
if (note.FinalJudgeAction() || elapsedTime > note.EndTiming + Judge.MISS.MotionTimingRange)
{ {
SetJudge(Judge.TestJudge(note, timing)); SetJudge(Judge.TestJudge(note, timing, true));
activatedNotes.Remove(note); activatedNotes.RemoveAt(i);
DeactivateNote(note); DeactivateNote(note);
} }
} }
...@@ -195,10 +197,13 @@ public class JudgeManager : MonoBehaviour ...@@ -195,10 +197,13 @@ public class JudgeManager : MonoBehaviour
{ {
if (!judge.IsBreak) if (!judge.IsBreak)
GameManager.Instance.Combo++; GameManager.Instance.Combo++;
else
GameManager.Instance.Combo = 0;
GameManager.Instance.Score += judge.Score; GameManager.Instance.Score += judge.Score;
GameManager.Instance.JudgeCount[judge]++; GameManager.Instance.JudgeCount[judge]++;
Debug.Log(judge.Name + (isMotion ? " Motion" : " Note")); Debug.Log(judge.Name + (isMotion ? " Motion" : " Note"));
Debug.Log(GameManager.Instance.Combo);
judgeText.SetActive(true); judgeText.SetActive(true);
judgeText.GetComponent<Text>().text = judge.Name; judgeText.GetComponent<Text>().text = judge.Name;
......
...@@ -2,39 +2,48 @@ ...@@ -2,39 +2,48 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class MotionSampleDisplay : MonoBehaviour { public class MotionSampleDisplay : MonoBehaviour
{
[SerializeField] [SerializeField]
GameObject left, right; GameObject left, right;
public Sprite sprite; public Sprite sprite;
public float timeout; public float timeout;
public MotionNote caller; public MotionNote caller;
private float elapsedTime; private float elapsedTime;
private float parameter; private float velocity;
private float acceleration;
private float distance = 2f;
// Use this for initialization // Use this for initialization
void Start() void Start()
{ {
elapsedTime = 0f; elapsedTime = 0f;
parameter = 0f; velocity = 0f;
acceleration = 2 * distance / Mathf.Pow(timeout, 2);
left.GetComponent<SpriteRenderer>().sprite = sprite; left.GetComponent<SpriteRenderer>().sprite = sprite;
right.GetComponent<SpriteRenderer>().sprite = sprite; right.GetComponent<SpriteRenderer>().sprite = sprite;
left.transform.Translate(-distance, 0, 0);
right.transform.Translate(distance, 0, 0);
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
elapsedTime += Time.deltaTime * 1000; float delta = Time.deltaTime * 1000f;
if (elapsedTime > timeout / 2f) elapsedTime += delta;
parameter = (elapsedTime - timeout / 2f) / timeout; velocity = acceleration * elapsedTime;
if (elapsedTime > timeout) if (elapsedTime > timeout)
{ {
Destroy(gameObject); Destroy(gameObject);
} }
left.transform.Translate(new Vector3(parameter, 0)); left.transform.Translate(new Vector3(velocity * delta, 0));
right.transform.Translate(new Vector3(-parameter, 0)); right.transform.Translate(new Vector3(-velocity * delta, 0));
} }
} }
\ No newline at end of file
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