전체 글

    유니티 버튼 색상 리셋

    🟦 유니티 버튼 색상 리셋 창닫기 버튼처럼 클릭하면 UI가 비활성화되는 버튼이 있다고 가정해보자. 버튼은 기본 색상은 흰색이며, 마우스오버하면 검정색으로 변할 것이다. 클릭하는 순간 회색으로 변했다가 클릭을 마치면 다시 검정색이 된다.(버튼 위에서 클릭을 마쳤을 때) 버튼이 검정색인 상태로 UI가 비활성화된다. UI를 활성화해보면 버튼이 여전히 검정색이다. 검정색이 아니라 기본 색상인 흰색으로 reset하는 방법이다. 🟧 해결방법 /// /// 버튼 색상 리셋 /// public void ResetButtonColor(Button _btn) { UnityEngine.EventSystems.PointerEventData eventDataCurrentPosition = new UnityEngine.Event..

    레이아웃 재정렬

    🟦 레이아웃 재정렬 Horizontal Layout Group, Vertical Layout Group 등의 컴포넌트를 이용해 UI를 구성한 다음 프리팹을 생성하면 정렬이 안되는 경우가 종종 있다. 그럴 때 강제로 재정렬해주는 코드이다. 🟧 Document LayoutRebuilder.ForceRebuildLayoutImmediate() WaitForEndOfFrame() 🟧 코드 public void RebuildLayout(RectTransform _obj) { StartCoroutine(nameof(CorRebuildLayout), _obj); } IEnumerator CorRebuildLayout(RectTransform _obj) { yield return new WaitForEndOfFrame..

    [유니티 Json 파싱] Newtonsoft.Json & Unity JSON Utility

    🟦 Newtonsoft.Json 🟧 Document 참고영상 : 베르의 게임 개발 유튜브 https://docs.microsoft.com/ko-kr/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-5-0 C#을 사용하여 JSON을 직렬화 및 역직렬화하는 방법 - .NET System.Text.Json 네임스페이스를 사용하여 .NET에서 JSON으로 직렬화 및 역직렬화하는 방법을 알아봅니다. 샘플 코드가 포함되어 있습니다. docs.microsoft.com 🟧 Settings https://www.newtonsoft.com/json - 링크 접속 후 Download 버튼 클릭 - Json.NET 버튼 클릭 - 최신 버전의 zip파일 ..

    Unity VScode Debugging

    🟦 Unity VScode Debugging visual studio와 달리 디버깅을 위해서는 extention과 설정을 해주어야 한다. 🟧 Settings - C#, Debugger for Unity, Unity Tools 3가지를 다운받는다. - 왼쪽에 벌레모양 아이콘을 클릭한다. - create a launch.json file 클릭 - Unity Debugger 클릭 더보기 { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid..

    Animation Rigging

    🟦 Animation Rigging - 모델에 애니메이션이 들어가면 플레이상태에서 모델의 rig 구조를 컨트롤 할 수 없음 - Animation Rigging 패키지를 사용하면 애니메이션 상태에서도 컨트롤 할 수 있음 🟧 Document https://docs.unity3d.com/Packages/com.unity.animation.rigging@1.2/manual/constraints/MultiAimConstraint.html Multi-Aim Constraint | Animation Rigging | 1.2.0 Multi-Aim Constraint A Multi-Aim Constraint rotates a Constrained Object to face a target position specifie..

    에러 : A failure occurred while executing

    🟦 상황 빌드하려는데 아래와 같은 팝업창이 뜸 🟧 에러메세지 🟦 해결방법 - Project Settings / Player / Publishing Settings - Keystore Password를 정확하게 입력해야함

    에러 : Manifest merger faild

    🟦 상황 빌드를 하려는데 아래와 같은 팝업창이 뜸 🟧 에러메세지 🟦 해결방법 - Minimum API Level 설정 - 팝업창에서 API 레벨 24 이상으로 설정하라고 했기 때문에 위와 같이 설정함

    에러 : JDK directory is not set or invalid.

    🟦 상황 빌드를 하려는데 팝업창이 뜨며 빌드가 되지않음. 🟧 에러메세지 Java Development Kit (JDK) directory is not set or invalid. Please, fix it in Preferences -> External Tools 🟦 해결방법 - Unity Hub 열기 - Installs 클릭 - 설정 버튼 클릭 - Add modules 클릭 - 원래는 OpenJDK 앞에 체크박스가 있음. 체크하기 - Install 버튼 클릭