Hello in the universal render pipeline script you guys used == null … eg below universalrenderpipeline.cs
Camera currCamera = cameraStack*;*
if (currCamera == null)
{
shouldUpdateCameraStack = true;
continue;
}
if (currCamera.isActiveAndEnabled)
{
currCamera.TryGetComponent(out var data);
if (data == null || data.renderType != CameraRenderType.Overlay)
curious is this the proper form to do this or ‘is null’ more appropriate and should be used? Ive always seen nullreference exception with == null
just in general if anyone knows about the is null and == null - from stacktrace it seems like == null shouldnt be used - instead use is null ( as == null will just through object reference errors which is the whole point to prevent anyways)
just was surprised to see it in the unity scripting so thought maybe a newer version of c# allowed this kinda of code now???
just hoping for an either -
‘actually - c# version bla supports == null’
OR
‘o whoops it should actually be is null - if the camera actually is null it will throw a nullrefexcept error’
ehhhh???