Search Unity

[UnityThreadHelper] The referenced script on this Behaviour is missing!

Discussion in 'Editor & General Support' started by Korolev, Jan 20, 2015.

  1. Korolev

    Korolev

    Joined:
    Sep 20, 2012
    Posts:
    22
    constantly get an error: The referenced script on this Behaviour is missing!
    wrote a script to search
    Code (CSharp):
    1.   GameObject[] go = (GameObject[])FindObjectsOfType<GameObject>();
    2.         List<Object> ob = new List<Object>();
    3.         foreach (GameObject g in go)
    4.         {
    5.             Component[] components = g.GetComponents<Component>();
    6.             for (int i = 0; i < components.Length; i++)
    7.             {
    8.                 if (components[i] == null)
    9.                     ob.Add(g);
    10.             }
    11.         }
    12.         Selection.objects = ob.ToArray();
    it provides that the loss in [UnityThreadHelper]
    how to fix this error?