-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Graphic API Validation (Vulkan), Comment out Layout in ReadmeEditor
- ReadMeEditor의 Layout 로드가 레이아웃 초기화를 유발 - 그래픽스 API가 Vulkan이 아닐 경우 알림메시지
- Loading branch information
Showing
4 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
using UnityEngine.Rendering; | ||
|
||
internal class GraphicsAPIValidate | ||
{ | ||
[InitializeOnLoadMethod] | ||
private static void Check() | ||
{ | ||
const string kCheckGraphicsAPIValidateState = "ProjectKaya.GraphicsAPIValidate"; | ||
|
||
// 에디터 세션 당 한 번만 확인 | ||
if (!SessionState.GetBool(kCheckGraphicsAPIValidateState, false )) | ||
{ | ||
SessionState.SetBool(kCheckGraphicsAPIValidateState, true); | ||
|
||
if (SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan) | ||
{ | ||
if (EditorUtility.DisplayDialog("주의", | ||
"본 프로젝트는 Vulkan 그래픽스 백엔드로 구현되었습니다. UnityHub에서 커맨드라인을 통해 Vulkan 모드로 실행해주세요.", | ||
"세팅 방법 보기", "닫기")) | ||
{ | ||
Application.OpenURL("https://github.com/UnityKorea/ProjectKaya#editor-setting"); | ||
} | ||
} | ||
} | ||
} | ||
|
||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)] | ||
private static void CheckInPlaymode() | ||
{ | ||
if (SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan) | ||
{ | ||
Debug.LogWarning($"[현재 그래픽스 : {SystemInfo.graphicsDeviceType}] 본 프로젝트는 Vulkan 그래픽스 백엔드로 구현되었습니다. UnityHub에서 커맨드라인을 통해 Vulkan 모드로 실행해주세요."); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters