




Rigidbody의 BodyType
Dynamic :Kinematic :OnTriggerEnter2D 메서드를 통해 isTrigger가 true인 Collider와 충돌하면 충돌을 감지할 수 있다. ()Static :그밖에 게임을 만들며 사용한 내장 메서드들 :
GetCompornent : (이 메서드를 사용한 스크립트가 붙은) 오브젝트 내에서 해당 컴포넌트를 찾음GetComponentInChildren : (이 메서드를 사용한 스크립트가 붙은) 오브젝트의 하위 오브젝트까지 검색해서 해당 컴포넌트를 찾음Input.GetMouseButtonDown : 마우스 몇 번째 버튼을 누르는지 검사Mathf.Clamp : (참고 블로그 👉https://code-piggy.tistory.com/entry/MathfClamp)public static float Clamp(float value, float min, float max);
//value: 제한하려는 값
//min: 허용 가능한 최소값
//max: 허용 가능한 최대값
//만약 value가 min값보다 작다면 min값으로,
//max값보다 크다면 max값으로,
//min과 max의 사이값이라면 그대로 반환된다.
<예시>
int num = 20;
num = Mathf.Clamp(num, 22, 100); // num에 22가 들어감
FindObjectOfType : (참고 블로그 👉 https://coding-shop.tistory.com/197)indObjectOfType 사용한 코드: void Start()
{
Obstacle[] obstacles = GameObject.FindObjectsOfType<Obstacle>();
obstacleLastPosition = obstacles[0].transform.position;
obstacleCount = obstacles.Length;
for (int i = 0; i < obstacleCount; i++)
{
obstacleLastPosition = obstacles[i].SetRandomPlace(obstacleLastPosition, obstacleCount);
}
}
혜진님. 항상. 잘. 보고. 있습니다. ^_^