-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyInputs.cs
38 lines (31 loc) · 1012 Bytes
/
MyInputs.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class MyInputs {
//K_ is keyboard, 1_ is first GC, 2_ is second etc
public static string[] prefixes = new string[] { "K_", "1_", "2_", "3_", "4_"};
public static void ChangeControllers(string[] newPrefixes)
{
prefixes = newPrefixes;
}
public static float GetAxis(int player, string axis)
{
return Input.GetAxis(prefixes[player] + axis);
}
public static float GetAxisRaw(int player, string axis)
{
return Input.GetAxisRaw(prefixes[player] + axis);
}
public static bool GetButton(int player, string axis)
{
return Input.GetButton(prefixes[player] + axis);
}
public static bool GetButtonDown(int player, string axis)
{
return Input.GetButtonDown(prefixes[player] + axis);
}
public static bool GetButtonUp(int player, string axis)
{
return Input.GetButtonUp(prefixes[player] + axis);
}
}