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
eda0937f
Commit
eda0937f
authored
7 years ago
by
16이상민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit Joystick logic
parent
f8b91bf3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
6 deletions
+35
-6
ButtonStatus.cs
Assets/Script/ButtonStatus.cs
+1
-1
TrackManager.cs
Assets/Script/TrackManager.cs
+32
-3
InputManager.asset
ProjectSettings/InputManager.asset
+2
-2
No files found.
Assets/Script/ButtonStatus.cs
View file @
eda0937f
...
...
@@ -14,6 +14,6 @@ public class ButtonStatus : MonoBehaviour
void
Update
()
{
Manager
.
IsButtonDown
=
Input
.
GetKey
(
KeyCode
.
Space
)
||
Input
.
GetKey
(
KeyCode
.
Joystick
1
Button0
);
Input
.
GetKey
(
KeyCode
.
JoystickButton0
);
}
}
This diff is collapsed.
Click to expand it.
Assets/Script/TrackManager.cs
View file @
eda0937f
...
...
@@ -42,8 +42,27 @@ public class TrackManager : MonoBehaviour
}
}
KeyDown
PrevJoyAxis
=
KeyDown
.
None
,
CurrJoyAxis
=
KeyDown
.
None
;
private
KeyDown
JoyState
{
get
{
if
((
PrevJoyAxis
==
KeyDown
.
None
&&
CurrJoyAxis
==
KeyDown
.
Down
))
return
KeyDown
.
Down
;
if
((
PrevJoyAxis
==
KeyDown
.
None
&&
CurrJoyAxis
==
KeyDown
.
Up
))
return
KeyDown
.
Up
;
return
KeyDown
.
None
;
}
}
bool
IsPressedStart
{
get
{
return
Input
.
GetKey
(
KeyCode
.
Space
);
}
}
{
get
{
return
Input
.
GetKey
(
KeyCode
.
Space
)
||
Input
.
GetKey
(
KeyCode
.
JoystickButton0
);
}
}
// Use this for initialization
void
Start
()
...
...
@@ -58,6 +77,14 @@ public class TrackManager : MonoBehaviour
// Update is called once per frame
void
Update
()
{
PrevJoyAxis
=
CurrJoyAxis
;
if
(
Input
.
GetAxis
(
"Vertical"
)
>
0
)
CurrJoyAxis
=
KeyDown
.
Down
;
else
if
(
Input
.
GetAxis
(
"Vertical"
)
<
0
)
CurrJoyAxis
=
KeyDown
.
Up
;
else
CurrJoyAxis
=
KeyDown
.
None
;
ScrollTrackList
();
if
(
IsPressedStart
)
...
...
@@ -66,9 +93,11 @@ public class TrackManager : MonoBehaviour
void
ScrollTrackList
()
{
if
(
Pressed
==
KeyDown
.
Down
)
if
(
Pressed
==
KeyDown
.
Down
||
JoyState
==
KeyDown
.
Down
)
DownScroll
();
else
if
(
Pressed
==
KeyDown
.
Up
)
else
if
(
Pressed
==
KeyDown
.
Up
||
JoyState
==
KeyDown
.
Up
)
UpScroll
();
}
...
...
This diff is collapsed.
Click to expand it.
ProjectSettings/InputManager.asset
View file @
eda0937f
...
...
@@ -34,8 +34,8 @@ InputManager:
sensitivity
:
3
snap
:
1
invert
:
0
type
:
0
axis
:
0
type
:
2
axis
:
1
joyNum
:
0
-
serializedVersion
:
3
m_Name
:
Fire1
...
...
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