Unity overrides the null comparison operator for Unity objects, which is incompatible with null coalescing.
using UnityEngine;
class Camera : MonoBehaviour
{
public Transform a;
public Transform b;
public Transform NC()
{
return a ?? b;
}
}
Use null comparison:
using UnityEngine;
class Camera : MonoBehaviour
{
public Transform a;
public Transform b;
public Transform NC()
{
return a != null ? a : b;
}
}
A code fix is offered for this diagnostic to automatically apply this change.