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
22a291dc
Commit
22a291dc
authored
7 years ago
by
16서원빈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on Motions
parent
5c580308
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
8 deletions
+40
-8
Jump.cs
Assets/MotionNotes/Jump.cs
+23
-5
InputManager.cs
Assets/Script/InputManager.cs
+2
-0
JudgeManager.cs
Assets/Script/JudgeManager.cs
+1
-0
MotionView.cs
Assets/Script/MotionView.cs
+9
-3
TrackInfo.cs
Assets/Script/TrackInfo.cs
+5
-0
No files found.
Assets/MotionNotes/Jump.cs
View file @
22a291dc
...
...
@@ -18,23 +18,41 @@ public class Jump : MotionNote
}
public
Jump
(
float
timing
)
:
base
(
timing
)
{
downCount
=
0
;
}
private
float
spineHeight
;
private
int
downCount
;
public
override
IEnumerator
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
float
currentSpineHeight
=
InputManager
.
Instance
.
Joints
[
Windows
.
Kinect
.
JointType
.
SpineBase
].
Position
.
Y
;
while
(
downCount
<
10
&&
currentSpineHeight
<=
spineHeight
-
0.1f
)
{
spineHeight
=
currentSpineHeight
;
currentSpineHeight
=
InputManager
.
Instance
.
Joints
[
Windows
.
Kinect
.
JointType
.
SpineBase
].
Position
.
Y
;
while
(
motion
!=
MotionState
.
CLAP_PREPARE
)
downCount
++;
yield
return
false
;
}
Activated
=
true
;
if
(
downCount
>=
10
)
Activated
=
true
;
yield
break
;
}
public
override
bool
FinalJudgeAction
()
{
throw
new
NotImplementedException
();
float
currentSpineHeight
=
InputManager
.
Instance
.
Joints
[
Windows
.
Kinect
.
JointType
.
SpineBase
].
Position
.
Y
;
return
currentSpineHeight
>=
spineHeight
;
}
}
This diff is collapsed.
Click to expand it.
Assets/Script/InputManager.cs
View file @
22a291dc
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
Windows.Kinect
;
using
System.IO
;
using
UnityEngine.UI
;
...
...
@@ -29,6 +30,7 @@ public class InputManager : MonoBehaviour {
}
public
MotionState
CurrentMotionState
{
get
;
set
;
}
public
Dictionary
<
JointType
,
Windows
.
Kinect
.
Joint
>
Joints
{
get
;
set
;
}
public
bool
IsButtonPressed
{
...
...
This diff is collapsed.
Click to expand it.
Assets/Script/JudgeManager.cs
View file @
22a291dc
...
...
@@ -73,6 +73,7 @@ public class JudgeManager : MonoBehaviour
activatedNotes
=
new
List
<
MotionNote
>();
LoadNotes
(
GameManager
.
Instance
.
CurrentTrack
.
Notes
);
Instantiate
(
GameManager
.
Instance
.
CurrentTrack
.
BGM
);
}
// Update is called once per frame
...
...
This diff is collapsed.
Click to expand it.
Assets/Script/MotionView.cs
View file @
22a291dc
...
...
@@ -52,16 +52,22 @@ public class MotionView : MonoBehaviour {
leftHand
=
body
[
idx
].
Joints
[
JointType
.
HandLeft
]
.
Position
,
rightHand
=
body
[
idx
].
Joints
[
JointType
.
HandRight
]
.
Position
;
.
Position
,
spineShoulder
=
body
[
idx
].
Joints
[
JointType
.
SpineShoulder
]
.
Position
;
MotionState
s
=
MotionState
.
UNKNOWN
;
if
(
head
.
Y
<
leftHand
.
Y
&&
head
.
Y
<
rightHand
.
Y
)
s
|=
MotionState
.
HURRAY
;
if
(
Distance
(
leftHand
,
rightHand
)
>
0.3f
)
if
(
Distance
(
leftHand
,
rightHand
)
>
0.3f
&&
spineShoulder
.
Y
<
leftHand
.
Y
&&
spineShoulder
.
Y
<
rightHand
.
Y
)
s
|=
MotionState
.
CLAP_PREPARE
;
if
(
Distance
(
leftHand
,
rightHand
)
<
0.1f
)
if
(
Distance
(
leftHand
,
rightHand
)
<
0.1f
&&
spineShoulder
.
Y
<
leftHand
.
Y
&&
spineShoulder
.
Y
<
rightHand
.
Y
)
s
|=
MotionState
.
CLAP_DONE
;
InputManager
.
Instance
.
Joints
=
body
[
idx
].
Joints
;
return
s
;
}
...
...
This diff is collapsed.
Click to expand it.
Assets/Script/TrackInfo.cs
View file @
22a291dc
...
...
@@ -12,6 +12,8 @@ public class TrackInfo
public
float
BPM
{
get
;
private
set
;
}
public
int
Level
{
get
;
private
set
;
}
public
AudioClip
BGM
{
get
;
private
set
;
}
public
List
<
string
>
TrackList
{
get
;
private
set
;
}
public
List
<
Note
>
Notes
{
get
;
private
set
;
}
...
...
@@ -68,6 +70,9 @@ public class TrackInfo
case
"#TRACKLIST"
:
TrackList
.
Add
(
value
);
break
;
case
"#WAV"
:
BGM
=
new
WWW
(
"file:///"
+
file
.
DirectoryName
+
'\\'
+
value
).
GetAudioClip
();
break
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
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