Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 748 Bytes

File metadata and controls

28 lines (19 loc) · 748 Bytes

USP0005 The Unity runtime invokes Unity messages

Unused parameters should not be removed from Unity messages.

Suppressed Diagnostic ID

IDE0060 - Remove unused parameters

Examples of code that produces a suppressed diagnostic

using UnityEngine;

class Camera : MonoBehaviour
{
	void OnCollisionEnter(Collision c)
	{
		// do stuff, but c remains unused
	}
}

Why is the diagnostic reported?

The IDE does not detect that you've used c, and under normal circumstances, it would be reasonable to remove the unused parameter.

Why do we suppress this diagnostic?

The IDE doesn't realize this is a Unity message, and therefore has no way of determining that it needs to have a specific signature to function correctly.