Animation 창을 열면 오른쪽 상단에 파란색의 시간이 설정되어 있는데 이것을 늘리거나 줄이려면, 간단히 마우스 휠을 스크롤 하면 조정이 가능합니다.
유니티가 버전 업 되면서 auto refresh 설정을 해제 하는 메뉴가 변동되었습니다. 이전 버전에서는 Preference => General => Auto Refresh 였습니다. 2021 버전에서는 Asset Pipeline 메뉴에 Auto Refresh를 해제할 수 있는 옵션이 위치합니다. 이 기능을 해제하면 매번 에셋 변경이 있을 때마다 컴파일이 되는 디폴트 설정이 변경됩니다. 윈도우의 경우 Ctrl+R 단축키로 refresh를 할 수 있습니다.
파라미터로 bool 형의 worldPositionStays 가 있는데, 이것을 true로 해야 월드 좌표계의 위치, 회전, 스케일이 이전과 같이(SetParent 하기 이전) 유지가 됩니다. using UnityEngine; public class ExampleClass : MonoBehaviour { public GameObject child; public Transform parent; //Invoked when a button is clicked. public void Example(Transform newParent) { // Sets "newParent" as the new parent of the child GameObject. child.transform.SetParent(newParent)..
transform.Find()는 성능에 큰 영향을 주지 않습니다. 유니티 공식 스크립트 레퍼런스 문서에 따르면, 아래와 같이 설명합니다. Note: Find does not perform a recursive descend down a Transform hierarchy. 사용 방법은 파라미터에 Hierarchy 상의 경로를 지정하고 슬래시로 구분합니다. 출처 - https://docs.unity3d.com/2021.1/Documentation/ScriptReference/Transform.Find.html Unity - Scripting API: Transform.Find If no child with name n can be found, null is returned. If n contains a '..
당연한 것일 수도 있겠지만 비활성화된 (Disabled) 게임 오브젝트에는 StopCoroutine()이 안 먹힙니다. 만약 코루틴을 시작하거나 정지할 때 해당 게임오브젝트가 비활성화 되어 있다면 에러가 발생합니다. using UnityEngine; using System.Collections; public class Example : MonoBehaviour { // keep a copy of the executing script private IEnumerator coroutine; // Use this for initialization void Start() { print("Starting " + Time.time); coroutine = WaitAndPrint(3.0f); StartCoroutin..
GetComponentsInChildren() 할 때 파라미터로 includeInactive를 true로 설정하면 비활성화된 children 배열을 가져올 수 있다. 비활성화 된 게임오브젝트의 컴포넌트를 가져오는 방법은 이 방법 밖에 없는 것으로 보인다. - 출처 : Unity - Scripting API: Component.GetComponentsInChildren (unity3d.com) Unity - Scripting API: Component.GetComponentsInChildren Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions,..