▣ 스크립트 설명
Update: Input.GetMouseButtonDown(0)을 사용하여 마우스 왼쪽 버튼을 클릭했을 때 카메라 흔들림을 트리거합니다.
Shake: 카메라의 위치를 흔들리게 만드는 코루틴입니다.
Camera.main을 사용해 메인 카메라의 위치를 흔들고, 흔들림이 끝난 후 원래 위치로 복구합니다.
shakeDuration과 shakeMagnitude: 각각 흔들림의 지속 시간과 강도를 조절하는 변수입니다.
https://docs.unity3d.com/ScriptReference/Camera-main.html
Unity - Scripting API: Camera.main
If there is no enabled Camera component with the "MainCamera" tag, this property is null. Internally, Unity caches all GameObjects with the "MainCamera" tag. When you access this property, Unity returns the first valid result from its cache. Accessing this
docs.unity3d.com
https://docs.unity3d.com/ScriptReference/Transform-localPosition.html
Unity - Scripting API: Transform.localPosition
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. Close
docs.unity3d.com
https://docs.unity3d.com/ScriptReference/Camera-main.html
Unity - Scripting API: Camera.main
If there is no enabled Camera component with the "MainCamera" tag, this property is null. Internally, Unity caches all GameObjects with the "MainCamera" tag. When you access this property, Unity returns the first valid result from its cache. Accessing this
docs.unity3d.com
'[ Unity ] > - 유니티 실습' 카테고리의 다른 글
유니티 Loading Scene (8) | 2024.09.18 |
---|---|
유니티 GameSettingsUIManager (1) | 2024.09.17 |
유니티 Single RayCast, Multi RayCast (1) | 2024.09.14 |
유니티 Animator, Animation, Blend Tree (1) | 2024.09.14 |
유니티 오브젝트 스크롤링 (1) | 2024.09.13 |
댓글