private void Update() { if (!currentButton) { return; } if (Input.GetButtonDown(selectButton)) { currentButton.Activate(); } if (Mathf.Abs(Input.GetAxisRaw(verticalAxis)) < 0.05f) { centeredVertical = true; } if (Mathf.Abs(Input.GetAxisRaw(horizontalAxis)) < 0.05f) { centeredHorizontal = true; } if (centeredVertical) { if (Input.GetAxisRaw(verticalAxis) > 0.5f) { currentButton = currentButton.SelectDown(); centeredVertical = false; return; } if (Input.GetAxisRaw(verticalAxis) < -0.5f) { currentButton = currentButton.SelectUp(); centeredVertical = false; return; } } if (centeredHorizontal && Mathf.Abs(Input.GetAxisRaw(horizontalAxis)) > 0.5f) { currentButton.AxisInput(Input.GetAxisRaw(horizontalAxis)); centeredHorizontal = false; } }