Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 787 Bytes

File metadata and controls

33 lines (23 loc) · 787 Bytes

USP0020 The Unity runtime invokes Unity messages

Unity messages should not be flagged as unused because Unity invokes those messages.

Suppressed Diagnostic ID

IDE0052 - Private method can be removed as it is never invoked.

Examples of code that produces a suppressed diagnostic

using UnityEngine;

class Camera : MonoBehaviour
{
	void Start()
	{
		//Some code
	}

	/// <summary>
	/// This reference triggers IDE0052 <see cref=""Start"" />
	/// </summary>
	public float speed = 0f;
}

Why is the diagnostic reported?

The IDE cannot find any references to the method Start and believes it to be unused.

Why do we suppress this diagnostic?

Even though the IDE cannot find any references to Start, it will be called by Unity, and should not be removed.