Unity/Else

    VSCode에서 자동정렬이 되지 않는 이슈

    🟦 이슈새 프로젝트를 판 후 스크립트를 작성하고 저장을 했는데 자동정렬이 되지않음.설정에 들어가서 확인해도 "format on save"가 활성화되어있음.VSCode를 껐다 킬 때 아래와 같은 팝업이 떠서 문제를 파악함.The version of the Unity Package 'Visual Studio Editor' is too old. Please update to version 2.0.20 or later in Unity's Package Manager. 🟧 해결방법- Visual Studio Editor 패키지 버전이 최신이 아니라서 발생한 이슈였음.   - Unity 실행 후 Package Manager 띄움- Visual Studio Editor 업데이트

    Unity Project Junction

    🟦 Unity Project Junction빌드하기 위해 플랫폼을 변경해야할 때 프로젝트 크기가 커질수록 변환하는 시간이 길어진다.이럴 때 Junction을 이용하면 플랫폼을 변경하지 않아도 된다. 멀티를 지원하는 프로젝트를 테스트하는 경우에도 Juction을 이용하면 편리하다.   🟧 사용법// gist by Roystan (IronWarrior): https://gist.github.com/IronWarrior/005f649e443bf51b656729231d0b8af4// Video demo: https://twitter.com/DavigoGame/status/1300842800964018178//// CONTRIBUTIONS:// Mac and Linux support a..

    유니티 버튼 색상 리셋

    🟦 유니티 버튼 색상 리셋 창닫기 버튼처럼 클릭하면 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..

    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..

    Unity Asset Bundle

    🟦 Unity Asset Bundle 🟧 Document https://docs.unity3d.com/kr/530/Manual/BuildingAssetBundles.html 유니티 - 매뉴얼: 4.x버전에서의 에셋번들 빌드 에셋번들 (AssetBundles) 4.x버전에서의 에셋번들 빌드 To begin creating an AssetBundle (called AssetBundle in scripts and within the Unity Editor), select an asset from your project folder that you want to include in a bundle. At the very bott docs.unity3d.com https://docs.unity3d.com/2017..

    AudioMixer

    🔷 AudioMixer - slider로 auido를 조절해보기 🔶 AudioMixer - Audio Mixer 열기 - - Group에 추가 - 주의 : BGM과 Voice를 독립적으로 조작하려면 Master 바로 아래에 생성해야함 - 상위에 있는 그룹의 데시벨을 조작할 경우 하위 그룹의 데시벨도 변경되기 때문 - 이 부분에서 많이 헤맸는데, 우측 상단에 있는 Exposed Parameter에 조작하고자 하는 그룹이 있어야함 - 그렇지 않으면 스크립트로 조절할 수가 없음 - 그룹을 클릭하면 인스펙터 창에 위와 같이 뜸 - Volume 쪽에 우클릭하면 위와 같은 메뉴가 보임 - Expose 'Volume (of BGM)' to script 클릭 - exposed Parameters에 뜨는 것을 볼 수 있..