[Style] GetComponent null체크 추가

This commit is contained in:
HaeinLEE 2025-04-21 13:19:00 +09:00
parent b8ea0892b8
commit bec98caa29

View File

@ -19,9 +19,12 @@ public class InteractionController : MonoBehaviour
if (interactionLayerMask == (interactionLayerMask | (1 << other.gameObject.layer))) if (interactionLayerMask == (interactionLayerMask | (1 << other.gameObject.layer)))
{ {
ActionType interactionType = other.gameObject.GetComponent<InteractionProp>().RoutineEnter(); ActionType interactionType = other.gameObject.GetComponent<InteractionProp>().RoutineEnter();
if( interactionType != null )
{
PopActionOnScreen(interactionType); PopActionOnScreen(interactionType);
} }
} }
}
// 사물에서 벗어날 때 UI 정리 // 사물에서 벗어날 때 UI 정리
private void OnCollisionExit(Collision other) private void OnCollisionExit(Collision other)
@ -91,6 +94,8 @@ public class InteractionController : MonoBehaviour
} }
}); });
break; break;
default:
break;
} }
} }
} }