본문 바로가기

프로그래밍280

유니티 Addressables 기반 Play Asset Delivery https://github.com/Unity-Technologies/Addressables-Sample?tab=readme-ov-file GitHub - Unity-Technologies/Addressables-Sample: Demo project using Addressables package Demo project using Addressables package. Contribute to Unity-Technologies/Addressables-Sample development by creating an account on GitHub. github.com ㄴ 예제를 다운 받는 github. 안에 여러가지 예제가 들어 있는데 아래 항목에 해당하는 부분만 보면 된다 Advanced/Play Asset .. 2024. 2. 19.
라이더에서 GibHub 저장소를 지웠으나 [ GitHub에 원격이 이미 있습니다 ] 라고 뜨는 경우 아직 라이더 내부에 찌끄러기가 있어서 새로 연결이 안되는 것이니 그걸 삭제 합시다 위의 경로에서 터미널을 실행 시켜 주고 터미널 창에서 커서 깜빡 거리는데다가 git remote remove origin git remote remove github 복붙해서 엔터 치면 내부에 가지고 있던 정보가 사라지면서 해결! 2023. 8. 23.
Unity - 중세 배경의 에셋 https://assetstore.unity.com/packages/3d/props/modular-medieval-dungeon-115219?aid=1011lvKwp 중세 배경의 배경 샘플이 필요할 때.. 괜찮은 에셋 입니다 어떤 느낌인지 봅시다 2023. 5. 21.
Unity - 카메라 기반 8 방향 이동 var moveDirection = new Vector3(Input.GetAxisRaw("Horizontal"), 0f, Input.GetAxisRaw("Vertical")); // 움직임이 있을 때만 이동 처리 if (moveDirection != Vector3.zero) { if (GameData.World.IsCameraIsometric()) { Vector3 cameraRight = Camera.main.transform.right; Vector3 cameraForward = Vector3.Cross(Vector3.up, cameraRight).normalized; if (moveDirection.z != 0)// 상하 이동 방향이 반대일 때 보정 cameraForward = -cameraForw.. 2023. 5. 14.
Unity - 특정 씬에서 시작하기 개발을 하다보면 특정 씬에서 시작을 해야 되는데 팀원들이 그걸 다 알지도 못하고 본인 역시도 다른 씬에서 작업하다 시작은 특정 씬으로 돌아가서 해야 되고 불편함이 많았는데 아래와 같은 클레스를 넣어두면 0 번 씬으로 강제 시작 되기 때문에 편리 합니다. 물론 모든 상황에서 0 번씬이 우선적으 로 열리기 때문에 그로 생기는 불편이 있을 수 있기 때문에 특정 키워드가 들어간 씬은 이동 안하게 예외처리를 해두었 습니다 (본문에서는 Test 라는 키워드) using UnityEngine; using UnityEditor; using UnityEditor.SceneManagement; using UnityEngine.SceneManagement; public class PlayModeInitializer { [I.. 2023. 5. 3.
Unity - 유용한 개발 에셋 유틸 : GPU Instancer 풍성한 수풀이나 많은 오브젝트들이 표시되야 할 때 게임의 부하를 줄여주는 유틸 입니다 일단 설명을 보고 아래 예제를 참고 하시면 됩 니다 스토어 링크 https://assetstore.unity.com/packages/tools/utilities/gpu-instancer-117566?aid=1011lvKwp ReadMe GPU Instancer v1.7.6 Copyright ©2018-22 GurBu Technologies --------------------------------- Thank you for supporting GPU Instancer! GPU 인스턴서를 지원해 주셔서 감사합니다! --------------------------------- DOCUMENTATION ------------.. 2023. 4. 28.
Object Pool 에 들어간 class 의 동작 1. Addressable 을 통해 로드 2. Object Pool 을 통해 생성 이런 식으로 Awake -> OnEnable -> Start 순으로 들어온다 본 class 는 1초 후 풀로 돌아가게 되어있다 그래서 1초 후 OnDisable 3. Pool 에 Disable 상태의 오브젝트를 Pool 로 다시 생성 이런 식으로 두번째 재활용으로 사용 되면 OnEnable 만 한번 들어오고 1초 후 OnDisable 1회에만 써야 되는건 Awake 나 Start 에서 사용해야 된다 는 것을 알 수 있다 2023. 3. 21.
구글 RealTimeDataBase GetValue 개수와 크기 .GetValueAsync().ContinueWith(task => { if (task.IsFaulted) { // 오류 처리 } else if (task.IsCompleted) { DataSnapshot snapshot = task.Result; // 데이터 처리 var cnt = snapshot.Children.Count(); var size = snapshot.GetRawJsonValue().Length; } }); 이런 방식으로 Child 의 개수와 사이즈를 알 수 있다 2023. 2. 24.
Unity MonoSingleton 모노싱글톤 https://gist.github.com/onevcat/6025819 Mono singleton Class. Extend this class to make singleton component. Mono singleton Class. Extend this class to make singleton component. - MonoSingleton.cs gist.github.com using UnityEngine; public class MonoSingleton : MonoBehaviour where T : MonoSingleton { private static T instance; public static T Instance { get { if (instance == null) { instance = Fi.. 2023. 2. 14.
Unity 메모리 프로파일링 https://docs.unity3d.com/kr/2021.3/Manual/ProfilerMemory.html 메모리 프로파일러 모듈 - Unity 매뉴얼 Unity에서 애플리케이션의 메모리 사용량을 분석하는 방법에는 다음의 두 가지가 있습니다. docs.unity3d.com https://resources.unity.com/games/ultimate-guide-to-profiling-unity-games Ultimate guide to profiling Unity games The Ultimate guide to profiling Unity games features best practices from Unity experts on how to profile and improve the performa.. 2023. 1. 30.
Unity 주변 랜덤 뭐 검색을 해보면 여러가지 방법들이 나오는데 그냥 가장 심플한 방법을 소개... Random.insideUnitCircle 이걸 사용.. // 10m 반경 랜덤 var pos = Random.insideUnitCircle * 10.0f; // 높이를 무시하고 좌우 앞뒤 값만 사용 Instantiate(obj, m_Player.transform.position + new Vector3(pos.x, m_Player.transform.position.y, pos.y), Quaternion.identity); 결과는 아래 영상에서- https://youtu.be/0cWNSo4BgP4 2023. 1. 29.
안드로이드 네이티브 크러쉬 https://source.android.com/docs/core/tests/debug/native-crash?hl=ko 네이티브 충돌 진단 | Android 오픈소스 프로젝트 | Android Open Source Project 네이티브 충돌 진단 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. 다음 섹션에는 네이티브 충돌의 일반적인 유형, 샘플 크래시 덤프의 분석, Tombstone에 관 source.android.com 2023. 1. 25.
TheSeed 2021 Addressables 패치 시스템 Scenemachine 카메라 제어 Universal RP URP 사용 https://youtu.be/57T1pEvjP2s 이제 런처씬 - 인게임씬 따로 분류를 해서 런처에서 어드레서블 패치를 하고 안에서 심리스맵 잘 동작하나 체크를 해주고 https://youtu.be/4KShSLcFyuQ 실제 앱플레이어에서도 잘 패치되고 동작하나 볼까요 2022. 11. 4.
Unity - Addressable Patch Download https://github.com/Wenrong274/Unity-Addressable GitHub - Wenrong274/Unity-Addressable: 主要是實作 Addressable hotfix 的寫法。 主要是實作 Addressable hotfix 的寫法。. Contribute to Wenrong274/Unity-Addressable development by creating an account on GitHub. github.com 중국 형님의 글 발견.. 역시 대세는 중국 프로그래머인가 아무튼 잘 참고하여 아래처럼 정리... using System; using System.Collections; using System.Collections.Generic; using System.Linq; usi.. 2022. 10. 11.
C# Generic return T public T GetGenericReturn(string num) { return (T)Convert.ChangeType(num, typeof(T)); } int n = GetGenericReturn("1"); string n = GetGenericReturn("1"); 한개의 함수로 그때 그때 다른 리절트를 얻는 2022. 10. 2.
유니티 네트워크 상태 얻기 Application.internetReachability 2022. 8. 12.
유니티 - 슬립 모드 온디맨드 렌더링을 사용하자 https://blog.unity.com/kr/technology/how-on-demand-rendering-can-improve-mobile-performance 온디맨드 렌더링을 이용한 모바일 성능 개선 | Unity Blog 포럼에서 온디맨드 렌더링을 어떻게 활용하고 있는지 알려주세요. Windows, macOS, WebGL, iOS, Android에서 Unity 에디터와 스탠드얼론 플레이어를 대상으로 테스트를 완료했으나, 피드백은 언제든지 blog.unity.com 2022. 8. 10.
유니티 - 네이버 게임챗 (Game Chat) https://guide.ncloud-docs.com/docs/gamechat-gamechatunity Game Chat Unity SDK - Game Chat 사용 guide.ncloud-docs.com 1. 채팅 -> 채널 추가 2. 설정 -> 금칙어 3. 설정 -> 사용자 설정에서 관리자 using System; using System.Collections; using System.Collections.Generic; using GameChatUnity; using UnityEngine; using UnityEngine.UI; public class Main : MonoBehaviour { private const string PROJECT_ID = "your project id"; private .. 2022. 8. 4.
유니티 콜백 팝업 예제 [SerializeField] private Button m_Button_OK; [SerializeField] private Button m_Button_Cancel; [SerializeField] private Text m_Text_Desc; private event Action m_Callback; private void Awake() { m_Button_OK.onClick.AddListener(OnOK); m_Button_Cancel.onClick.AddListener(OnCancel); } public void Set(string desc, Action callback) { m_Callback = callback; m_Text_Desc.text = desc; } private void OnOK().. 2022. 7. 18.
어드레서블 (Addressable) 여기서 apk 통빌드(?) 로 구울 때는 바로 여기서부터는 패치로 어드레서블을 사용하는 부분인데 * 다운로드 경로에 버전 삽입 다운로드 경로 변경 Addressable -> Profile /[UnityEngine.Application.version]/[BuildTarget] 이런식으로 추가하여 버전 추가 * 에셋 팩 통째로 로드 에셋 팩 개별 옵션에서 이 옵션으로 해주면 그 팩의 일부만 로딩하더라도 나머지 관련된거 싹다 로드 2022. 7. 14.