namespace CarbonInput { /// /// Internal wrapper class, used to access touch input. /// public class TouchMapping : CarbonController { /// /// Currently pressed buttons. /// private readonly bool[] buttonMap = new bool[ButtonCount]; /// /// Current values of all axes. /// private readonly float[] axisMap = new float[AxisCount]; private void OnEnable() { name = "TouchInput"; } /// /// Gets or sets if the specific button is pressed or not. /// /// /// public bool this[CButton button] { get { return buttonMap[(int)button]; } set { buttonMap[(int)button] = value; } } /// /// Gets or sets the value of the given axis. /// /// /// public float this[CAxis axis] { get { return axisMap[(int)axis]; } set { axisMap[(int)axis] = value; } } public override bool GetButton(CButton btn, int id) { return this[btn]; } public override float GetAxis(CAxis axis, int id) { return this[axis]; } } }