Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dyingIsMainstream
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gamejam-gpn15
dyingIsMainstream
Commits
20933192
Commit
20933192
authored
Jun 05, 2015
by
Tim Reiter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed gamepad input bug.
parent
7d9c2dd3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
Menu.cs
Assets/Scripts/Menu.cs
+4
-4
PlayerInputMapping.cs
Assets/Scripts/PlayerInputMapping.cs
+3
-3
No files found.
Assets/Scripts/Menu.cs
View file @
20933192
...
@@ -90,7 +90,7 @@ public class Menu : MonoBehaviour
...
@@ -90,7 +90,7 @@ public class Menu : MonoBehaviour
}
}
}
}
if
(
GamePad
.
GetButton
(
GamePad
.
Button
.
A
,
GamePad
.
Index
.
One
))
if
(
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
A
,
GamePad
.
Index
.
One
))
{
{
if
(
GP1Added
)
if
(
GP1Added
)
{
{
...
@@ -110,7 +110,7 @@ public class Menu : MonoBehaviour
...
@@ -110,7 +110,7 @@ public class Menu : MonoBehaviour
}
}
}
}
if
(
GamePad
.
GetButton
(
GamePad
.
Button
.
A
,
GamePad
.
Index
.
Two
))
if
(
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
A
,
GamePad
.
Index
.
Two
))
{
{
if
(
GP2Added
)
if
(
GP2Added
)
{
{
...
@@ -130,7 +130,7 @@ public class Menu : MonoBehaviour
...
@@ -130,7 +130,7 @@ public class Menu : MonoBehaviour
}
}
}
}
if
(
GamePad
.
GetButton
(
GamePad
.
Button
.
A
,
GamePad
.
Index
.
Three
))
if
(
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
A
,
GamePad
.
Index
.
Three
))
{
{
if
(
GP3Added
)
if
(
GP3Added
)
{
{
...
@@ -149,7 +149,7 @@ public class Menu : MonoBehaviour
...
@@ -149,7 +149,7 @@ public class Menu : MonoBehaviour
}
}
}
}
}
}
if
(
GamePad
.
GetButton
(
GamePad
.
Button
.
A
,
GamePad
.
Index
.
Four
))
if
(
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
A
,
GamePad
.
Index
.
Four
))
{
{
if
(
GP4Added
)
if
(
GP4Added
)
{
{
...
...
Assets/Scripts/PlayerInputMapping.cs
View file @
20933192
...
@@ -82,7 +82,7 @@ public class PlayerInputMapping : MonoBehaviour {
...
@@ -82,7 +82,7 @@ public class PlayerInputMapping : MonoBehaviour {
public
bool
isJumpPressed
()
public
bool
isJumpPressed
()
{
{
if
(
usesGamepad
)
return
GamePad
.
GetButton
(
GamePad
.
Button
.
A
,
gamepadIndex
);
if
(
usesGamepad
)
return
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
A
,
gamepadIndex
);
else
return
Input
.
GetKey
(
keyCodes
[(
int
)
Keys
.
Jump
]);
else
return
Input
.
GetKey
(
keyCodes
[(
int
)
Keys
.
Jump
]);
}
}
...
@@ -113,7 +113,7 @@ public class PlayerInputMapping : MonoBehaviour {
...
@@ -113,7 +113,7 @@ public class PlayerInputMapping : MonoBehaviour {
if
(
usesGamepad
)
if
(
usesGamepad
)
{
{
return
(
GamePad
.
GetTrigger
(
GamePad
.
Trigger
.
LeftTrigger
,
gamepadIndex
)
>
0.01f
)
||
(
GamePad
.
GetTrigger
(
GamePad
.
Trigger
.
RightTrigger
,
gamepadIndex
)
>
0.01f
)
return
(
GamePad
.
GetTrigger
(
GamePad
.
Trigger
.
LeftTrigger
,
gamepadIndex
)
>
0.01f
)
||
(
GamePad
.
GetTrigger
(
GamePad
.
Trigger
.
RightTrigger
,
gamepadIndex
)
>
0.01f
)
||
GamePad
.
GetButton
(
GamePad
.
Button
.
LeftShoulder
,
gamepadIndex
)
||
GamePad
.
GetButto
n
(
GamePad
.
Button
.
RightShoulder
,
gamepadIndex
);
||
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
LeftShoulder
,
gamepadIndex
)
||
GamePad
.
GetButtonDow
n
(
GamePad
.
Button
.
RightShoulder
,
gamepadIndex
);
}
}
else
return
Input
.
GetKey
(
keyCodes
[(
int
)
Keys
.
Dash
]);
else
return
Input
.
GetKey
(
keyCodes
[(
int
)
Keys
.
Dash
]);
}
}
...
@@ -122,7 +122,7 @@ public class PlayerInputMapping : MonoBehaviour {
...
@@ -122,7 +122,7 @@ public class PlayerInputMapping : MonoBehaviour {
{
{
if
(
usesGamepad
)
if
(
usesGamepad
)
{
{
return
GamePad
.
GetButton
(
GamePad
.
Button
.
X
,
gamepadIndex
)
||
GamePad
.
GetButto
n
(
GamePad
.
Button
.
Y
,
gamepadIndex
);
return
GamePad
.
GetButton
Down
(
GamePad
.
Button
.
X
,
gamepadIndex
)
||
GamePad
.
GetButtonDow
n
(
GamePad
.
Button
.
Y
,
gamepadIndex
);
}
}
else
return
Input
.
GetKey
(
keyCodes
[(
int
)
Keys
.
Shoot
]);
else
return
Input
.
GetKey
(
keyCodes
[(
int
)
Keys
.
Shoot
]);
}
}
...
...
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