Ejemplo n.º 1
0
    public static string GetExistPath(string key)
    {
#if UNITY_EDITOR
        CreatePack();
        if (NoPackAssetinstance != null)
        {
            NoPackAsset.PackData packData = NoPackAssetinstance.GetPackData(key.ToLower());
            if (packData != null)
            {
                if (File.Exists(packData.allName))
                {
                    return(packData.allName);
                }
            }

            string realKey = NoPackAssetinstance.GetRealPath(key);
            for (int i = 0; i < NoPackAssetinstance.mPahtList.Length; i++)
            {
                for (int j = 0; j < NoPackAssetinstance.mPathEx.Length; j++)
                {
                    string pblkPath = NoPackAssetinstance.mPahtList[i] + "/" + realKey + NoPackAssetinstance.mPathEx[j];
                    if (File.Exists(pblkPath))
                    {
                        return(pblkPath);
                    }
                }
            }
        }
#endif
        return("");
    }