728x90
Mathf는 untiy에서 사용할 수 있는 수학 함수를 말한다. 매우 유용함.
Debug.Log(Mathf.Abs(-19)); // 절대값 출력 : 19
Debug.Log(Mathf.Max(2, 5)); // 더 큰 숫자 출력 : 5
Debug.Log(Mathf.Min(2, 5)); // 더 작은 숫자 출력 : 2
Debug.Log(Mathf.Clamp(5, 1, 3)); // 5 : 범위, 1 : 최솟값, 3 : 최댓값을 뜻함. 출력 : 3
https://docs.unity3d.com/kr/530/ScriptReference/Mathf.html
Unity - 스크립팅 API: Mathf
Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. 닫기
docs.unity3d.com
728x90
'공부 > Unity' 카테고리의 다른 글
[Unity] 코루틴(Coroutine)이란? (0) | 2022.05.03 |
---|---|
[Unity] DontDestroyOnLoad() (0) | 2022.05.03 |
[Unity] ArgumentException 오류 (0) | 2022.05.02 |
[Unity] Debug 디버깅과 오류 해결하기 (0) | 2022.05.02 |
[Unity] UseGravity, IsKinematic, IsTrigger 실습 (0) | 2022.05.02 |