Inflearn brand logo image

Inflearn Community Q&A

sontaewjd4334's profile image
sontaewjd4334

asked

[MMORPG Game Development Series with C# and Unity] Part3: Unity Engine

Input Manager

KeyAction != null

Written on

·

189

0

InputManager의 OnUpdate함수에

if( KeyAction != null) 일때만

      KeyAction.Invoke(); 를 해줬는데

KeyAction이 null일때 Invoke를 해주면 문제가 생겨서

저렇게 조건을 넣어주신건가요????

C#unity

Answer 1

0

rookiss님의 프로필 이미지
rookiss
Instructor

KeyAction에 아무것도 += 해주지 않으면
null인 상태가 되며 크래시가 납니다.

sontaewjd4334's profile image
sontaewjd4334

asked

Ask a question