In my MonoBehavior, defining this member
Camera camera;
gives the warning
Assets/Scripts/CreditsManager.cs(43,16): warning CS0108: 'CreditsManager.camera' hides inherited member 'UnityEngine.Component.camera'. Use the new keyword if hiding was intended
but
new Camera camera;
gives the warning
Assets/Scripts/CreditsManager.cs(43,20): warning CS0109: The member 'CreditsManager.camera' does not hide an inherited member. The new keyword is not required
Which one is it? What am I supposed to believe? Either way, I can’t get rid of a warning.
This happens with all the deprecated component members, like rigidbody and such.
Anyway, if it’s private, it could/should be _camera
, or m_camera
.
I’d use the new keyword if in doubt.