private void SetAxisButtonPressed(ref AxisButtomPressed button, float val, ref bool button_lock) { //Debug.Log("Change: " + button + " " + (button != AxisButtomPressed.Positive) + " " + (val > 0.0000000F)); if (val > 0.0F && button != AxisButtomPressed.Positive && !button_lock) { //Debug.Log("Positive##################"); button = AxisButtomPressed.Positive; button_lock = true; } else if (val < 0.0F && button != AxisButtomPressed.Negative && !button_lock) { button = AxisButtomPressed.Negative; button_lock = true; } else { button = AxisButtomPressed.NoInput; } if (val == 0.0F) { button_lock = false; } //Debug.Log("Change: " + hor_axis_button); }
/// <summary> /// initialize the value; /// </summary> private void ResetAllInputs() { hor_axis_val = 0.0F; ver_axis_val = 0.0F; A_pressed = false; B_pressed = false; START_pressed = false; SELECT_pressed = false; hor_axis_button = AxisButtomPressed.NoInput; ver_axis_button = AxisButtomPressed.NoInput; }