time.delta 설명가능?
= 직전프레임에 걸린 시간
void update(){
Vector3 translation = targetPosition - startPosition;
Debug.log(transiation);
transform.Translate(translation * Time.deltaTime);
startPostion = transform.position;
}
1/30 하는 게 거리에 따라서 달라지겠지
얼마나 좁혀졌는지 알고 싶다면? Vector3 기능 중 magnitude!!
void Start()
{
transform = gameObject GetComponent<Transform>();
Vector3 position = transform.position;
}
void Update()
{
Vector3 translation = targetPosition - startPosition;
float distance = Vector3.Magnitude(translation);
if (distance > 0.1f)
{
translation.Nomalize();
transform.Translate(translation.TimedeltaTime * 5f);
startPosition = transform.position;
}
}
= 이미지에 속성값이 붙은 칭구칭구들
이미지 넣은 다음에 텍스쳐타입을 스프라이트로 해놓자
간혹 이미지를 불러올 때 왜곡될 때가 있음
정교한 이미지를 해야 하면 HIGH QUALITY로 하면 고용량 이쁨