본문 바로가기
반응형

개발/Unity312

Unity) MenuItem (Check Menu) MenuItem (Check Menu) Unity Editor에 Custom Menu를 사용하다가 Toogle 형태의 Menu가 필요한 상황이 생겼다. 따로 Custom EditorWindow를 만들어도 되지만 Unity의 기능이 있어서 해당 기능으로 간단하게 사용했다. Menu.SetChecked / Menu.GetChecked 를 통해서 생성이 가능하다. 예시는 다음과 같다. 'Menu.SetCheck'를 여러개로 처리를 해서 Toggle 처럼 단일 선택도 가능하다. Unity Editor Menu : [링크] Unity - Scripting API: Menu Success! Thank you for helping us improve the quality of Unity Documentation. A.. 2023. 1. 9.
Unity) #unitytips #unitytips Unity 의 Tip을 따로 개시하는 해시태그로 Bronson Zgeb가 Unity Project의 생산성을 높을수 있는 효율적인 방식에 대해서 고민하다가 알게되었고 카테고리에 맞춰서 개인의 생각을 정리해 보았다. 원본글을 참고해서 실제 기능과 Tip을 직접 하나씩 해보는것을 추천한다. (원본링크는 맨 하단에 있습니다.) 1. 생상적인 워크플로우 구축 작업하는 방식에서 반복하거나 불편한 점에 대한 고민을 하는 시간을 가지면 좋다. Custom Inspector, Custom Editor Window, Custom Menu, Custom Hierarchy 등등, 반복적이거나 불편한것을 나누거나 결합하는 과정에서 생산성이 늘어난다. 다른 사람이 만든 유틸 Asset을 구매해서 적용하는것도.. 2023. 1. 6.
Unity) 객체 복사 시 이름 규칙 (GameObject Copy Naming Scheme) 객체 복사 시 이름 규칙 (GameObject Copy Naming Scheme) Unity에서 객체를 복사하는 하게되면 자동으로(Numbering)의 이름으로 추가된다. 해당 규칙을 설정하는 옵션은 다음과 같다. [Project Setting]-[Editor]-[Numbering Scheme] 옵션에 대한 간략한 설명은 다음과 같다. 옵션 설명 Game Object Naming 복제에 대한 명령 체계, 원래 오브젝트 이름에 연속적인 숫자를 추가하여 이름을 지정 Game Object Digits 복제된 GameObject 번호에 사용할 자릿수 Space Before Number in Asset Names 중복 에셋 이름에 숫자 앞에 공백을 삽입할지 여부 Unity Ed.. 2023. 1. 4.
문제해결)Unity)an attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type an attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type Attribute에서 사용하는 속성 매개변수의 유형은 제한된다. 조건에 대한건 다음과 같다. 조건 자료형 - bool, byte, char, double, float, int, long, sbyte, short, string, uint, ulong, ushort. System.Type 접근제한자 - Public 상수 - const 본인은 Static인 값을 넣고 빌드하는 과정에서 해당 문제가 발생해서 static -> const 로 변경하고 진행했다. .Net Attribu.. 2023. 1. 4.
Unity) 특정 경로(Resource)의 하위 디렉토리 검색 특정 경로(Resource)의 하위 디렉토리 검색 Resource의 특정 디렉토리를 기준으로 경로를 읽는 코드이다. 재귀처리로 LoadPathRecursive 에서 File 과 Directory 를 판단해서 다시 재귀 호출을 진행한다. private static string[] FindFileExtension = { ".asset", ".png", ".jpg", ".prefab", ".json", ".cs", }; public void Test() { PathInfo rootPath = new PathInfo(); LoadPathsRecursive("", ref rootPath); PrintPath(rootPath); } private void PrintPath(PathInfo _info) { forea.. 2023. 1. 3.
Unity) Editor Theme 변경(Dark Skin 다크모드 / Light Skin) Unity Editor Theme 변경(Dark Skin 다크모드 / Light Skin) Unity Editor Theme는 2가지를 지원한다. 기존에는 Pro / Plus / Enterprise 에서만 가능한 기능이었지만. Unity 2019.4.8부터 Dark Editor 테마는 유료 구독자와 무료 사용자 모두에게 제공된다., 변경 방법은 다음과 같다. [Edit] - [Preferences] -[General] - [Editor Theme] 에서 원하는 테마를 선택하면 된다. 본인은 기존의 테마보다는 Dark Theme를 선호한다. Unity Support : [링크] ★☆☆☆☆ 2022. 12. 29.
문제해결)Unity)The property database "Library/Search/propertyDatabase.db" is already opened.UnityEditor.EditorApplication:Internal_InvokeTickEvents () The property database "Library/Search/propertyDatabase.db" is already opened.UnityEditor.EditorApplication:Internal_InvokeTickEvents () The property database "Library/Search/propertyAliases.db" is already opened. UnityEditor.EditorApplication:Internal_InvokeTickEvents () 두개의 메시지가 노출되서 확인해봤는데. 간단하게 Unity Engine에서 내부의 정보를 읽는 과정중 오류로 인해서 다시 close를 못해서 발생하는 이슈이다. 런타임 중에는 계속 진행이되고 해당 이슈를 해결하기 위해서는 Un.. 2022. 12. 15.
문제해결)Unity)Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Unity Version을 변경하고나서 Android Build 과정에서 Gradle 버전이 맞지 않아서 생긴 이슈이다. Project Setting - Publishing Setting의 Build 항목에 Custom Base Gradle Template이 설정되어있는 경우 해당 Gradle Version이 명시가 되어서 그런 경우로 한번 다시 셋팅해주면 기본값이 들어간다. Android Gradle 플러그인 : [링크] Android Gradle 플러그인 출시 노트 | Android 개발자 | Android Developers Androi.. 2022. 12. 8.
Unity) 어드레서블Addressables (Tutorial, Sample) 테스트 어드레서블Addressables (Tutorial, Sample) 테스트 간단하게 Addressable Sample을 테스트해보는 걸 정리하는 포스팅이다. 참고 : Unity 버전 2020.2.0a9 이상버전에서 사용가능합니다. Addressable Pacakge Import Sample Project 테스트 Assets 추가 및 변경항목 확인 Remote 처리 Assets Version Change 및 확인 Inspector에서 Addressable을 적용할 Assets을 체크하면 Group에 추가된다. 간단하게 FirstScene을 로드하는 코드를 버튼이벤트에 추가하고 실행해보면 로드된 씬으로 변경된다. void OnButtonClick() { Addressables.LoadSceneAsync("Fi.. 2022. 12. 5.
문제해결)Unity)Gradle failed to fetch dependencies. Gradle failed to fetch dependencies. Gradle Dependencies 에러가 발생했다. 이번에 Unity Version을 변경하면서 생긴 이슈로 에러 내용을 보면 간단하게 JAVA_HOME 의 환경변수가 맞지 않는다는 내용이 포함되어있다. Gradle failed to fetch dependencies. Failed to run 'C:\WORKSPACES\Personal_Project\Nonogram\Nonogram\Temp\PlayServicesResolverGradle\gradlew.bat --no-daemon -b "C:\WORKSPACES\Personal_Project\Nonogram\Nonogram\Temp\PlayServicesResolverGradle\Play.. 2022. 12. 5.
문제해결) An error occurred while resolving packages: Project has invalid dependencies: 패키지이름: Error when executing git command. git: 'credential-winstore' is not a git command. See 'git --help'. fatal: could not read Username for 'ht.. An error occurred while resolving packages: Project has invalid dependencies: 패키지이름: Error when executing git command. git: 'credential-winstore' is not a git command. See 'git --help'. fatal: could not read Username for 'https://gitlab.com': terminal prompts disabled You may need to set up a Git credentials helper to access a private repository.A re-import of the project may be required to fix .. 2022. 12. 4.
문제해결)Unity)The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(MonoBehaviour) m_Name UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(MonoBehaviour) m_Name UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) 상속관계에서 여러번 같은 이름으로 직렬화(Serialized) 되는 과정에서 발생하는 에러이다. 본인은 m_Name이라는 메서드가 상속관계에서 동일하게 쓰였다. 해결방법으로 해당 이슈나는 name을 다른 name으로 변경해서 사용하거나 상속 구조를 변경하면 된다. 급하게 작업하고 빌드하다가 발생했다. ㅎㅎ. ★☆☆☆☆ 2022. 11. 30.
Unity) Custom Project Setting (SettingProvider) Custom Project Setting (SettingProvider) SettingProvider를 사용하면 Project Setting의 메뉴를 추가할수있다. 빌드 및 프로젝트의 필요한 설정을 굳이 Editor Window를 만들어서 사용하지 않아도 된다. Project 관련된 설정을 Custom 해서 추가해보자. SettingServices 를 통해서 해당 메뉴를 열수도 있다. [MenuItem("SHC_Menu/Select Custom Hierarchy")] private static void ShowProjectSetting() { SettingsService.OpenProjectSettings("Project/CusthomHierarchy form SHC"); } Unity SettingPr.. 2022. 11. 29.
Unity)No 'git' executable was found. Plase install Git on your system then restart Unity and Unity Hub No 'git' executable was found. Plase install Git on your system then restart Unity and Unity Hub Git Package로 설치되어있는 프로젝트를 여는 과정에서 UPM(Unity Package Manager)를 로드하지 못해서 생긴 이슈이다. 1 .네트워크 연결을 확인해본다. 네트워크 연결이 비정상적이거나 해당 패키지를 읽어오지 못한 경우일 수도 있다. (네트워크 연결 확인후 다시 Unity 재실행) 2. 문제가되는 것으로 파악되는 UPM (git으로 연결된 패키지)를 제거하고 다시 로드해본다. Git Package를 다른 형태로 Package를 추가할수 있으면 하는 방법도 있다. 추가로 Unity 공식 문서는 아.. 2022. 11. 27.
Unity) Unity Pro 라이선스 구분하기 (from Editor) Unity Pro 라이선스 구분하기 (from Editor) Editor를 만드는 과정에서 Pro와 Personal의 구분이 필요한 경우가 종종 존재한다. 그럴때 사용하는 코드이다. UnityEditorInternal.InternalEditorUtility.HasPro() 간단하게 코드로 Pro License를 구분이 가능하다. Pro는 기본적으로 Dark Skin이 기본이고 Personal은 기본이 Gray Skin이다. Editor를 Custom하는 과정에서 구분이 필요해서 찾게 되었다. Unity OpenSource : [링크] GitHub - Unity-Technologies/UnityCsReference: Unity C# reference source code. Unity C# reference.. 2022. 11. 23.
반응형