728x90
반응형

c# 35

[Unity] Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)The following scene GameObjects were found 해결법

플레이를 종료할 때 갑자기 Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?) The following scene GameObjects were found 라는 에러를 뱉었는데 해결법을 찾아 이리 저리 검색해보았더니 private static object _lock = new object(); private static gameManager _instance; public static gameManager Instance { get { if (applicationIsQuitting) { return null; } lock (_lock) { if (_instance == ..

Unity 2022.01.03

[Unity] C# 중복 실행 방지 코드

유니티 프로그램은 Project Setting - Player - Resolution 에서 Force Single Instance를 체크하면 됩니다 C# 프로그램을 만들 때 중복 실행을 방지하는 코드는 간단합니다. Process[] p = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName.ToUpper()); if (p.Length > 1) { return; } GetProcessesByName(프로세스 이름); 으로 Length가 1이상이면 응용 프로그램을 중지하는 식입니다.

Unity 2021.06.10

[Unity]원하는 함수/코루틴 차례 대로 실행 시키기 - 간단한 방법

void first(){} void second(){} 두 함수가 있다고 가정햇을때 void start(){ first(); second(); } 면 first가 실행되고 특별한 지연함수가 있지 않은 이상 second가 실행되는데 first가 실행하고 끝나길 기다린 후 second를 실행하고 싶다면 코루틴을 활용하면 된다 1. 일정한 간격을 두고 실행하고 싶을 때 IEnumerator deley(){ yield return new WaitForSeconds(2); first(); } //2초 뒤에 first실행 2. 함수가 끝나길 기다리고 시작하고 싶을 때 IEnumerator deley(){ yield return StartCoroutine(first()); yield return StartCorout..

Unity 2019.04.10

[Unity]멀티 디스플레이 VR적용하기(Multi Display - Window+VR)

https://guks-blog.tistory.com/entry/UnityC-%EB%A9%80%ED%8B%B0-%EB%94%94%EC%8A%A4%ED%94%8C%EB%A0%88%EC%9D%B4 [Unity/C++] 멀티 디스플레이(multi-display)with VR VR에서 VR과 모니터 두 개에 출력하기 VR 카메라는 Target Eye를 Both, VR이 아닌 카메라의 Target Eye를 None(Main Display)로 설정 Multi-display Multi-display allows you to display up to 8 different camer.. guks-blog.tistory.com https://guks-blog.tistory.com/entry/UnityCUI-%EC%B9%B..

Unity 2019.04.03

[Unity]UI 카메라와 메인 카메라 사용하기(UI Camera + Main Camera)

-카메라를 하나 더 추가(UICamera) -캔버스와 버튼을 추가(Image는 구분을 해주려고 Background) UI를 왼쪽 Scene View를 오른쪽으로 둘 계획 MainCamera의 ViewPort Rect를 보면 X : 0.15 Y : 0 W : 0.85 H : 1 X는 드로우 될 수평 포지션 시작점 Y는 수직 포지션 시작점 W는 넓이 H는 높이 시작점을 X: 0.15 Y:0부터 가로 0.85 세로 1의 높이로 출력 UICamera X:0 Y:0 W:0.15 H:1 X:0 Y:0부터 가로 0.15 세로 1로 출력 Culling Mask는 UI로 설정했는데 UI Canvas뒤로 Scene View가 겹치지 않도록 하기 위해 설정 겹쳐도 상관없다면 everything으로 설정 옆으로만 넓은 큐브를..

Unity 2019.04.03
728x90
반응형