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
dbd5de72
Commit
dbd5de72
authored
Jun 06, 2015
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add alternate arrows input mapping
parent
6af717c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
PlayerInputMapping.cs
Assets/Scripts/PlayerInputMapping.cs
+13
-1
No files found.
Assets/Scripts/PlayerInputMapping.cs
View file @
dbd5de72
using
UnityEngine
;
using
System.Collections
;
using
GamepadInput
;
public
enum
controlType
:
int
{
WASD
=
0
,
ARROWS
=
1
,
GAMEPAD1
=
2
,
GAMEPAD2
=
3
,
GAMEPAD3
=
4
,
GAMEPAD4
=
5
}
public
enum
controlType
:
int
{
WASD
=
0
,
ARROWS
=
1
,
ARROWS2
=
6
,
GAMEPAD1
=
2
,
GAMEPAD2
=
3
,
GAMEPAD3
=
4
,
GAMEPAD4
=
5
}
public
class
PlayerInputMapping
:
MonoBehaviour
{
...
...
@@ -40,6 +40,18 @@ public class PlayerInputMapping : MonoBehaviour
keyCodes
[(
int
)
Keys
.
Dash
]
=
KeyCode
.
Backslash
;
keyCodes
[(
int
)
Keys
.
Shoot
]
=
KeyCode
.
RightBracket
;
break
;
case
controlType
.
ARROWS2
:
usesGamepad
=
false
;
keyCodes
[(
int
)
Keys
.
Right
]
=
KeyCode
.
RightArrow
;
keyCodes
[(
int
)
Keys
.
Left
]
=
KeyCode
.
LeftArrow
;
keyCodes
[(
int
)
Keys
.
Up
]
=
KeyCode
.
UpArrow
;
keyCodes
[(
int
)
Keys
.
Jump
]
=
keyCodes
[(
int
)
Keys
.
Up
];
keyCodes
[(
int
)
Keys
.
Down
]
=
KeyCode
.
DownArrow
;
keyCodes
[(
int
)
Keys
.
Dash
]
=
KeyCode
.
Hash
;
keyCodes
[(
int
)
Keys
.
Shoot
]
=
KeyCode
.
Plus
;
break
;
case
controlType
.
GAMEPAD1
:
gamepadIndex
=
GamePad
.
Index
.
One
;
break
;
...
...
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