Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 638 Bytes

USP0014.md

File metadata and controls

28 lines (19 loc) · 638 Bytes

USP0014 The Unity runtime invokes Unity messages

Unity messages should not be flagged as candidates for static modifier.

Suppressed Diagnostic ID

CA1822 - Mark members as static

Examples of code that produces a suppressed diagnostic

using UnityEngine;

class Camera : MonoBehaviour
{
	void Update()
	{
		//Some code that does not access instance data
	}
}

Why is the diagnostic reported?

Members that do not access instance data or call instance methods can be marked as static for performance reasons.

Why do we suppress this diagnostic?

Unity messages will not be processed if they are marked static.