맵을 좀 더 추가해주었다.
z축으로 설치되는 벽을 추가 하고 바리케이드에 기능을 넣어 줬다.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static UnityEngine.GraphicsBuffer;
public class CameraCtrl : MonoBehaviour
{
private GameObject target;
private float scrollSum = 5;
void Update()
{
float scroll = Input.GetAxis("Mouse ScrollWheel") * 15f;
scrollSum -= scroll;
float scrollSize = Mathf.Clamp(scrollSum, 1, 10);
scrollSum = scrollSize;
Camera.main.orthographicSize = scrollSize;
if(target != null)
{
this.transform.position = new Vector3(this.target.transform.position.x-17, 15f, this.target.transform.position.z-17);
}
}
public void Init(GameObject target)
{
this.target = target;
}
}
카메라에 줌인 줌아웃 기능을 추가해주었다.
if(Time.time < 1)
{
this.timeText[0].text = 30.ToString("00");
}
else
{
this.timeText[0].text = Mathf.Floor(30 - (Time.time / 60)).ToString("00");
}
if(Mathf.CeilToInt(60 - (Time.time % 60)) == 60)
{
this.timeText[1].text = 0.ToString("00");
}
else
{
this.timeText[1].text = (60-(Time.time % 60)).ToString("00");
}
타이머를 추가해주었다.
써놨던 여러 상수들을 변수로 바꿔서 확장성을 높여 줬다.
'3D 콘텐츠 제작' 카테고리의 다른 글
좀짓막(좀비 집짓고 막기) [#8] - 게임시스템 만들기 (0) | 2023.10.10 |
---|---|
좀짓막(좀비 집짓고 막기) [#7] - 오브젝트 풀링 (0) | 2023.10.06 |
좀짓막(좀비 집짓고 막기) [#6] - 공격/이동/설치기능 완성 (0) | 2023.10.05 |
좀짓막(좀비 집짓고 막기) [#5] - 목표물 타게팅/설치 기능 만들기 (2) | 2023.10.04 |
좀짓막(좀비 집짓고 막기) [#4] - 길찾기 알고리즘 이동에 적용 (0) | 2023.09.27 |