Exemplo n.º 1
0
    public static string FixMapsPath(string BlueprintPath)
    {
        if (GetGamedataFile.IsMapPath(BlueprintPath))
        {
            //Debug.Log(MapLuaParser.Current.FolderName);
            if (!BlueprintPath.StartsWith("/maps/" + MapLuaParser.Current.FolderName) && !BlueprintPath.StartsWith("maps/" + MapLuaParser.Current.FolderName))
            {
                //if (!System.IO.File.Exists(GetGamedataFile.MapAssetSystemPath(BlueprintPath)))
                //{
                string NewBlueprintPath = GetGamedataFile.TryRecoverMapAsset(BlueprintPath);
                Debug.Log("Before: " + BlueprintPath + ", after: " + NewBlueprintPath);

                if (!string.IsNullOrEmpty(NewBlueprintPath))
                {
                    return(NewBlueprintPath);
                }
                else
                {
                    Debug.LogError("Unable to recover wrong map path: " + BlueprintPath);
                }
            }
        }
        return(BlueprintPath);
    }