public bool FindWrongScriptsInGO(GameObject GO)
    {
        if (!GO)
        {
            CustomMessage = "GameObject Is Null!";
            return(false);
        }

        CustomMessage = "";
        List <GameObject> GO2 = FindGameObjects(GO);

        foreach (GameObject GO3 in GO2)
        {
            Component[] components = GO3.GetComponents <Component>();

            for (int i = 0; i < components.Length; i++)
            {
                if (components[i] == null)
                {
                    AddInfo(ref CustomMessage, GetFullPathToObject(GO3, GO), "|");
                }
            }
        }

        return(true);
    }
Exemplo n.º 2
0
    public bool FindMaterialInGO(GameObject GO)
    {
        if (!GO)
        {
            CustomMessage = "GameObject Is Null!";
            return(false);
        }

        CustomMessage = "";
        List <GameObject> GO2 = FindGameObjects(GO);

        foreach (GameObject GO3 in GO2)
        {
            Renderer[] renderers = GO3.GetComponents <Renderer>();

            for (int i = 0; i < renderers.Length; i++)
            {
                if (renderers[i] != null)
                {
                    Material[] M = renderers[i].sharedMaterials;

                    for (int l = 0; l < M.Length; l++)
                    {
                        if (M[l] != null)
                        {
                            string S = M[l].name;

                            if (Right(S, Len(" (Instance)")) == " (Instance)")
                            {
                                S = Left(S, Len(S) - Len(" (Instance)"));
                            }

                            if (S == MaterialName)
                            {
                                AddInfo(ref CustomMessage, GetFullPathToObject(GO3, GO), "|");
                            }
                        }
                    }
                }
            }
        }

        return(true);
    }