public void Move(InputDirection id) { switch (id) { case InputDirection.Down: tilesManager.MoveDown(); break; case InputDirection.Left: tilesManager.MoveLeft(); break; case InputDirection.Right: tilesManager.MoveRight(); break; case InputDirection.Up: tilesManager.MoveUp(); break; default: Debug.LogError("Invalid input direction: " + id.ToString()); break; } tilesManager.ResetThisTurnFlags(); CheckGameOver(); }
private void Instance_LeftJoystickUsedEvent(int player, InputDirection dir) { if (Time.time > TimeOffset + CoolDown) { Debug.Log(dir.ToString()); switch (dir) { case InputDirection.Up: selectedButton--; TimeOffset = Time.time; break; case InputDirection.Down: selectedButton++; TimeOffset = Time.time; break; } selectedButton = selectedButton >= Buttons.Count ? Buttons.Count - 1 : selectedButton < 0 ? 0 : selectedButton; SelectButton(); } }
void HandleSwipeInput(InputDirection direction) { inputText.text = direction.ToString(); }