Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
ButtonPusher
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Button Pusher
ButtonPusher
Commits
c218ccaa
Commit
c218ccaa
authored
Aug 25, 2017
by
16서원빈
Committed by
Chae Ho Shin
Aug 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Short Motion Judge just WORKS
parent
9d2c6c23
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
343 additions
and
19 deletions
+343
-19
KinectUnityAddin.dll.meta
Assets/Plugins/Metro/KinectUnityAddin.dll.meta
+33
-0
KinectUnityAddin.dll.meta
Assets/Plugins/x86/KinectUnityAddin.dll.meta
+97
-0
KinectUnityAddin.dll.meta
Assets/Plugins/x86_64/KinectUnityAddin.dll.meta
+97
-0
Motion Sample Display.prefab
Assets/Resources/Motion Sample Display.prefab
+2
-2
MotionNotes.meta
Assets/Resources/MotionNotes.meta
+9
-0
HOS.png
Assets/Resources/MotionNotes/HOS.png
+0
-0
HOS.png.meta
Assets/Resources/MotionNotes/HOS.png.meta
+74
-0
JudgeManager.cs
Assets/Script/JudgeManager.cs
+10
-5
MotionSampleDisplay.cs
Assets/Script/MotionSampleDisplay.cs
+21
-12
No files found.
Assets/Plugins/Metro/KinectUnityAddin.dll.meta
0 → 100644
View file @
c218ccaa
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:
Assets/Plugins/x86/KinectUnityAddin.dll.meta
0 → 100644
View file @
c218ccaa
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:
Assets/Plugins/x86_64/KinectUnityAddin.dll.meta
0 → 100644
View file @
c218ccaa
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:
Assets/Resources/Motion Sample Display.prefab
View file @
c218ccaa
...
...
@@ -81,7 +81,7 @@ Transform:
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1892747765238962
}
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_Children
:
[]
m_Father
:
{
fileID
:
4171896903265876
}
...
...
@@ -94,7 +94,7 @@ Transform:
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1531738911155356
}
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_Children
:
[]
m_Father
:
{
fileID
:
4171896903265876
}
...
...
Assets/Resources/MotionNotes.meta
0 → 100644
View file @
c218ccaa
fileFormatVersion: 2
guid: 5fa6fbae1b887c741847a319ae0ae7b5
folderAsset: yes
timeCreated: 1503591523
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
Assets/Resources/MotionNotes/HOS.png
0 → 100644
View file @
c218ccaa
20.2 KB
Assets/Resources/MotionNotes/HOS.png.meta
0 → 100644
View file @
c218ccaa
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:
Assets/Script/JudgeManager.cs
View file @
c218ccaa
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Linq
;
using
UnityEngine
;
using
UnityEngine.UI
;
...
...
@@ -152,13 +153,14 @@ public class JudgeManager : MonoBehaviour
smnote
.
MotionSampleDisplay
=
msd
;
activatedNotes
.
Add
(
smnote
);
}
for
each
(
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
));
activatedNotes
.
Remove
(
note
);
SetJudge
(
Judge
.
TestJudge
(
note
,
timing
,
true
));
activatedNotes
.
Remove
At
(
i
);
DeactivateNote
(
note
);
}
}
...
...
@@ -195,10 +197,13 @@ public class JudgeManager : MonoBehaviour
{
if
(!
judge
.
IsBreak
)
GameManager
.
Instance
.
Combo
++;
else
GameManager
.
Instance
.
Combo
=
0
;
GameManager
.
Instance
.
Score
+=
judge
.
Score
;
GameManager
.
Instance
.
JudgeCount
[
judge
]++;
Debug
.
Log
(
judge
.
Name
+
(
isMotion
?
" Motion"
:
" Note"
));
Debug
.
Log
(
GameManager
.
Instance
.
Combo
);
judgeText
.
SetActive
(
true
);
judgeText
.
GetComponent
<
Text
>().
text
=
judge
.
Name
;
...
...
Assets/Script/MotionSampleDisplay.cs
View file @
c218ccaa
...
...
@@ -2,39 +2,48 @@
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
MotionSampleDisplay
:
MonoBehaviour
{
public
class
MotionSampleDisplay
:
MonoBehaviour
{
[
SerializeField
]
GameObject
left
,
right
;
public
Sprite
sprite
;
public
float
timeout
;
public
MotionNote
caller
;
private
float
elapsedTime
;
private
float
parameter
;
private
float
velocity
;
private
float
acceleration
;
private
float
distance
=
2f
;
// Use this for initialization
void
Start
()
{
elapsedTime
=
0f
;
parameter
=
0f
;
velocity
=
0f
;
acceleration
=
2
*
distance
/
Mathf
.
Pow
(
timeout
,
2
);
left
.
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
void
Update
()
void
Update
()
{
elapsedTime
+=
Time
.
deltaTime
*
1000
;
if
(
elapsedTime
>
timeout
/
2f
)
parameter
=
(
elapsedTime
-
timeout
/
2f
)
/
timeout
;
float
delta
=
Time
.
deltaTime
*
1000f
;
elapsedTime
+=
delta
;
velocity
=
acceleration
*
elapsedTime
;
if
(
elapsedTime
>
timeout
)
{
Destroy
(
gameObject
);
}
left
.
transform
.
Translate
(
new
Vector3
(
parameter
,
0
));
right
.
transform
.
Translate
(
new
Vector3
(-
parameter
,
0
));
left
.
transform
.
Translate
(
new
Vector3
(
velocity
*
delta
,
0
));
right
.
transform
.
Translate
(
new
Vector3
(-
velocity
*
delta
,
0
));
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment