public static void OnHierarchyChangeUpdate()
{
if (!s_Instance || s_Instance.m_TestLines == null || EditorApplication.isPlayingOrWillChangePlaymode) return;
// create a test runner if it doesn't exist
TestRunner.GetTestRunner();
// make tests are not places under a go that is not a test itself
foreach (var test in TestComponent.FindAllTestsOnScene())
{
if (test.gameObject.transform.parent != null && test.gameObject.transform.parent.gameObject.GetComponent<TestComponent>() == null)
{
test.gameObject.transform.parent = null;
Debug.LogWarning("Tests need to be on top of the hierarchy or directly under another test.");
}
}
if (selectedInHierarchy) selectedInHierarchy = false;
else s_Instance.RebuildTestList();
}