강의

멘토링

커뮤니티

Inflearn Community Q&A

thisis720835's profile image
thisis720835

asked

[While We're At It, Let's Release] Unity Idle Raising Game (M1 + C1)

UI

UIManager의 SetCanvers() 부분에서

Written on

·

309

0

안녕하세요..

UIManager 의 SetCanvas 에서

public void SetCanvas(GameObject go, bool sort = true, int sortOrder = 0)
	{
		Canvas canvas = Util.GetOrAddComponent<Canvas>(go);
		if (canvas == null)
		{
			canvas.renderMode = RenderMode.ScreenSpaceOverlay;
			canvas.overrideSorting = true;
		}

"if (canvas == null)" 부분이 "canvas != null" 이 되어야 될 것 같은데 설명 부탁드립니다.

C#unityMMORPG

Answer 1

0

Rookiss님의 프로필 이미지
Rookiss
Instructor

오타가 맞습니다.
정리하다가 복붙이 잘못 되었네요.
!=로 바꿔주시고, 사실 GetOrAdd로 했기 때문에 if를 없애도 무방합니다.

thisis720835님의 프로필 이미지
thisis720835
Questioner

빠른 답변 감사합니다.

thisis720835's profile image
thisis720835

asked

Ask a question