오보에블로그

[Unity] Render Mode 본문

GameEngine & CG/Unity

[Unity] Render Mode

(OBO) 2021. 8. 16. 18:08
728x90

참고 : https://docs.unity3d.com/kr/530/ScriptReference/RenderMode.html

 

Unity - 스크립팅 API: RenderMode

Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. 닫기

docs.unity3d.com

 

캔버스에대한 렌더 모드를 의미한다.

Variables

ScreenSpaceOverlay 2D Canvas를 사용하는 끝 Scene에 기준 하여 렌더
ScreenSpaceCamera 캔버스 위의 카메라를 기준으로 렌더
WorldSpace 렌더링 가능한 Scene 의 카메라 기준으로 렌더

사용 예제

 

    // 외부에서 팝업 UI 가 켜질때 정리
    public void SetCanvas(GameObject go, bool sort = true)
    {
        Canvas canvas = Util.GetOrAddComponent<Canvas>(go);
        canvas.renderMode = RenderMode.ScreenSpaceOverlay;

        if (sort)
        {
            canvas.sortingOrder = _order;
            _order++;
        }

        else
        {
            canvas.sortingOrder = 0;
        }


    }
728x90

'GameEngine & CG > Unity' 카테고리의 다른 글

[Unity]Cursor  (0) 2021.09.17
[Unity] Json 파일 읽어오기  (0) 2021.08.16
[Unity] UI Event Handler 만들기  (0) 2021.08.10
[Unity] IPointerClickHandler & IDragHandler  (0) 2021.08.10
[Unity] UI Button 이벤트로 Text 변경 (+ Bind)  (0) 2021.08.09