private void MakeDecision() { bool isStopped = (Random.Range(0, 2) == 1); if (isStopped) { scareTarget.SetMoveDirection(new Vector2(0, 0)); return; } float xDir = 0, yDir = 0; bool isGoingSameDir = (Random.Range(0, 2) == 1); bool isGoingCWDir = (Random.Range(0, 2) == 1); switch (scareTarget.currDirection) { case Direction.UP: yDir = (isGoingSameDir ? 1 : 0); xDir = (isGoingCWDir ? 1 : -1); break; case Direction.DOWN: yDir = (isGoingSameDir ? -1 : 0); xDir = (isGoingCWDir ? -1 : 1); break; case Direction.LEFT: xDir = (isGoingSameDir ? -1 : 0); yDir = (isGoingCWDir ? 1 : -1); break; case Direction.RIGHT: xDir = (isGoingSameDir ? 1 : 0); yDir = (isGoingCWDir ? -1 : 1); break; } scareTarget.SetMoveDirection(new Vector2(xDir, yDir)); }