Isometric Tilemap

Untitled

총 3가지 타일맵으로 구성 됨.

Tilemap : 땅

Level : 2층

Collider : 충돌

총 3개의 맵으로 구성

첫 번째 맵

Untitled

세 번째 맵

Untitled

두 번째 맵

Untitled

각 맵은 텐트를 통해 이동할 수 있다.


카메라

메인 카메라

📄 CameraController.cs ( In Isometric )

<aside> ❓ 카메라가 플레이어를 부드럽게 쫓아가게 해주는 컨트롤러이다.

</aside>

public sealed class CameraController : MonoBehaviour
{
  public float smoothSpeed = 2f;
  private Transform target;
  public Vector2 min, max;

  private void Start()
  {
    target = GameObject.FindWithTag("Player").transform;
  }

  private void LateUpdate()
  {
    var x = Mathf.Clamp(target.position.x, min.x, max.x);
    var y = Mathf.Clamp(target.position.y, min.y, max.y);
  
    var position = transform.position;
    transform.position = Vector3.Lerp(position, new(x,y,position.z), smoothSpeed * Time.deltaTime);
  }
}

Mathf.Clamp() 함수를 사용해 카메라의 위치에 제한을 줌.

Lerp 함수를 사용해 부드럽게 쫒아가도록 해줌.

미니맵 카메라

<aside> ❓ 플레이어 주변의 맵을 미니맵으로 보여준다.

</aside>

Untitled

메인 카메라의 자식으로 하여 카메라의 위치를 동일하게 함.