示例#1
0
    public static NgAsset.ObjectNode[] GetModelList(string strDir, bool bRecursively)
    {
        int       nOutFindFile;
        ArrayList retArray;
        int       nCount = 0;

        if (bRecursively)
        {
            retArray = NgAsset.GetResourceFileRecursively <GameObject>(strDir, null, 0, false, NgEnum.PREFAB_TYPE.All, out nOutFindFile);
        }
        else
        {
            retArray = NgAsset.GetResourceFiles <GameObject>(strDir, null, 0, false, NgEnum.PREFAB_TYPE.All, out nOutFindFile);
        }

        while (true)
        {
            if (retArray.Count <= nCount)
            {
                break;
            }
            if (PrefabUtility.GetPrefabType((Object)retArray[nCount]) != PrefabType.ModelPrefab)
            {
                retArray.RemoveAt(nCount);
            }
            else
            {
                nCount++;
            }
        }
        nOutFindFile = retArray.Count;

        return(ArrayListToObjectNodes(retArray));
    }