유니티(3)
-
유니티 Atlas 주의사항
문제 상황batch와 draw call을 줄이기 위해서 atlas를 만들었는데 batch와 draw call이 줄지 않는다. 2시간 동안 뻘짓을 했다. 해결 방법절대로 유니티 Atlas를 쓰실 때 동일한 Order in layer의 경우 Atlas가 적용 되지 않습니다.Sprite Rendere의 Order in layer 를 모두 다르게 하셔야 합니다. 부디 저 같은 실수를 하지 않으시길 바랍니다.
2024.09.25 -
[유니티]Lerp , SmoothDamp
https://www.youtube.com/watch?v=_QOvSLCXm7A&t=331s 오늘 코딩님의 Lerp관련 영상을 보고서 원래 가지고 있던 궁금증이 풀리게 되었다 using System.Collections; using System.Collections.Generic; using UnityEngine; public class LerpSmoothDamp : MonoBehaviour { public Transform EndPos; // Update is called once per frame void Update() { transform.position = Vector3.Lerp(transform.position, EndPos.position, 10 * Time.deltaTime); } } 위 코..
2023.03.01 -
[유니티]RayCast2D,RayCastHit2D
[1] RayCast2D는 왜, 언제 사용하는것일까 터치한 오브젝트의 정보를 가져오거나 체크를 할때 그리고 물체의 Collider간의 충돌의 체크할때 주로 사용하는것 같다 [2] RayCast2D는 어떻게 사용하는것일까 RaycastHit2D는 true와 false를 반환합니다 Physics2D.RayCast로 Ray라는 광선을 쏩니다 그리고 Debug.DrawRay를 같이 사용하여 현재 광선을 시각화 해줍니다 RayCast의 속성에는 이런것들이 있는데 Origin은 Ray 광선의 시작점 Direction은 Ray 광선의 방향 Ditance는 Ray 광선의 최대길이 LayerMask는 지정한 레이어만 감지하는것 MinDepth는 지정한 Z좌표의 값보다 >= 크거나 같은 개체만 감지할수있게 MaxDepth..
2023.03.01