USP0008 Don't flag private methods used with Invoke/InvokeRepeating or StartCoroutine/StopCoroutine as unused
Private methods used with Invoke
, InvokeRepeating
, StartCoroutine
or StopCoroutine
are not unused.
IDE0051 - Remove unused private members
using UnityEngine;
class Camera : MonoBehaviour
{
void Start()
{
Invoke("InvokeMe", 10.0f);
}
private void InvokeMe()
{
// Invoke me
}
}
The IDE cannot detect any calls to InvokeMe
in the class.
InvokeMe
is called indirectly by Unity, which is undetectable by the IDE.