Application.isEditor와 #if UNITY_EDITOR

    728x90

     

    결론 == 똑같다



     공통점 : 에디터 상태인지 확인 또는 플랫폼 확인 시 사용 (기능)
    차이점 : 빌드 후 코드 실행 유무

    👉 Application.isEditor 는 빌드 후에도 코드가 실행됨(어차피 return false여도)
    👉 #if는 빌드 때는 무시

    👉 둘다 플랫폼 확인 가능

     

      Application.isEditor #if UNITY_EDITOR
    기능 에디터인지 확인 에디터인지 확인
    빌드 후 코드 실행 유무 Runtime : O Compile : X

     

     


     

    참고 자료

    https://forum.unity.com/threads/difference-between-if-unity_editor-and-application-iseditor.1438681/

    728x90

    '엔진(Unity, Unreal)' 카테고리의 다른 글

    에셋 번들 AssetBundles  (1) 2023.11.21
    Plastic SCM  (1) 2023.10.11
    유니티 Not allowed 버그 (Mesh)  (0) 2023.04.06
    [1] Unreal 기초 이론 다지기 (Unity와 비교)  (0) 2023.01.21

    댓글