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
c471ce93
Commit
c471ce93
authored
Aug 25, 2017
by
16서원빈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on motion notes
parent
38fb1af7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
14 deletions
+48
-14
Clap.cs
Assets/MotionNotes/Clap.cs
+3
-3
Guard.cs
Assets/MotionNotes/Guard.cs
+4
-4
Jump.cs
Assets/MotionNotes/Jump.cs
+2
-2
Piano.cs
Assets/MotionNotes/Piano.cs
+2
-2
PushUp.cs
Assets/MotionNotes/PushUp.cs
+2
-2
MotionNote.cs
Assets/Script/MotionNote.cs
+35
-1
No files found.
Assets/MotionNotes/Clap.cs
View file @
c471ce93
using
System
;
using
System.Collections
.Generic
;
using
System.Collections
;
using
UnityEngine
;
public
class
Clap
:
MotionNote
...
...
@@ -20,13 +20,13 @@ public class Clap : MotionNote
{
}
public
override
IEnumera
ble
<
bool
>
Checkpoint
()
public
override
IEnumera
tor
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
while
(
motion
!=
MotionState
.
CLAP_PREPARE
)
yield
return
false
;
yield
return
null
;
Activated
=
true
;
...
...
Assets/MotionNotes/Guard.cs
View file @
c471ce93
using
System
;
using
System.Collections
.Generic
;
using
System.Collections
;
using
UnityEngine
;
public
class
Guard
:
MotionNote
...
...
@@ -16,7 +16,7 @@ public class Guard : MotionNote
}
}
public
Guard
(
string
key
,
float
timing
)
:
this
(
timing
)
public
Guard
(
string
key
,
float
timing
,
float
end
=
0f
)
:
this
(
timing
,
end
)
{
switch
(
key
)
{
...
...
@@ -31,11 +31,11 @@ public class Guard : MotionNote
break
;
}
}
public
Guard
(
float
timing
)
:
base
(
timing
)
public
Guard
(
float
timing
,
float
end
=
0f
)
:
base
(
timing
,
end
)
{
}
public
override
IEnumera
ble
<
bool
>
Checkpoint
()
public
override
IEnumera
tor
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
...
...
Assets/MotionNotes/Jump.cs
View file @
c471ce93
using
System
;
using
System.Collections
.Generic
;
using
System.Collections
;
using
UnityEngine
;
public
class
Jump
:
MotionNote
...
...
@@ -20,7 +20,7 @@ public class Jump : MotionNote
{
}
public
override
IEnumera
ble
<
bool
>
Checkpoint
()
public
override
IEnumera
tor
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
...
...
Assets/MotionNotes/Piano.cs
View file @
c471ce93
using
System
;
using
System.Collections
.Generic
;
using
System.Collections
;
using
UnityEngine
;
public
class
Piano
:
MotionNote
...
...
@@ -35,7 +35,7 @@ public class Piano : MotionNote
{
}
public
override
IEnumera
ble
<
bool
>
Checkpoint
()
public
override
IEnumera
tor
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
...
...
Assets/MotionNotes/PushUp.cs
View file @
c471ce93
using
System
;
using
System.Collections
.Generic
;
using
System.Collections
;
using
UnityEngine
;
public
class
PushUp
:
MotionNote
...
...
@@ -35,7 +35,7 @@ public class PushUp : MotionNote
{
}
public
override
IEnumera
ble
<
bool
>
Checkpoint
()
public
override
IEnumera
tor
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
...
...
Assets/Script/MotionNote.cs
View file @
c471ce93
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.IO
;
using
UnityEngine
;
...
...
@@ -12,28 +13,61 @@ public abstract class MotionNote : Note
public
MotionNote
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
}
public
abstract
IEnumera
ble
<
bool
>
Checkpoint
();
public
abstract
IEnumera
tor
Checkpoint
();
public
static
readonly
Dictionary
<
string
,
Type
>
keymap
=
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
(
Piano
)
},
{
"LI"
,
typeof
(
Piano
)
},
{
"RI"
,
typeof
(
Piano
)
},
{
"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
)
{
Sprite
NewSprite
=
new
Sprite
();
Texture2D
SpriteTexture
=
LoadTexture
(
FilePath
);
if
(
SpriteTexture
==
null
)
return
null
;
NewSprite
=
Sprite
.
Create
(
SpriteTexture
,
new
Rect
(
0
,
0
,
SpriteTexture
.
width
,
SpriteTexture
.
height
),
new
Vector2
(
0
,
0
),
PixelsPerUnit
);
...
...
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