void Update() { x = GetInputX(); y = GetInputY(); if (CanMove()) { Debug.Log(""); character.MoveTo(gridDisplay.grid.GetWorldPosition(x, y)); } }
IEnumerator MoveCharToXY() { while (true) { if (lastX >= 0 && lastX < 8 && lastY >= 0 && lastY < 8) { character.MoveTo(grid.grid.GetWorldPosition(lastX, lastY)); soundManager.PlayRandomSound(); } yield return(new WaitForSeconds(.5f)); } }