Skip to content

Commit

Permalink
working through export issues now
Browse files Browse the repository at this point in the history
  • Loading branch information
dooly123 committed Feb 18, 2025
1 parent c79de49 commit a871364
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static async Task<BasisBundleGenerated> BuildAssetBundle(string targetDir
AssetBundleManifest manifest = BuildPipeline.BuildAssetBundles(targetDirectory, settings.BuildAssetBundleOptions, buildTarget);
if (manifest != null)
{
InformationHash Hash = await ProcessAssetBundles(targetDirectory, settings, manifest, password, isEncrypted,password);
InformationHash Hash = await ProcessAssetBundles(targetDirectory, settings, manifest, password, isEncrypted);
BasisBundleGenerated = new BasisBundleGenerated(Hash.bundleHash.ToString(),mode,assetBundleName,Hash.CRC,true,password,buildTarget.ToString(),true, $"{Hash.File}{settings.BasisBundleEncryptedExtension}");
DeleteManifestFiles(targetDirectory);
}
Expand All @@ -25,7 +25,7 @@ public static async Task<BasisBundleGenerated> BuildAssetBundle(string targetDir
EditorUtility.ClearProgressBar();
return BasisBundleGenerated;
}
private static async Task<InformationHash> ProcessAssetBundles(string targetDirectory,BasisAssetBundleObject settings,AssetBundleManifest manifest,string password,bool isEncrypted,string PasswordTextFileFolderPath)
private static async Task<InformationHash> ProcessAssetBundles(string targetDirectory,BasisAssetBundleObject settings,AssetBundleManifest manifest,string password,bool isEncrypted)
{
string[] files = manifest.GetAllAssetBundles();
int totalFiles = files.Length;
Expand All @@ -49,7 +49,6 @@ private static async Task<InformationHash> ProcessAssetBundles(string targetDire
CleanupOriginalFile(actualFilePath);
InformationHashes.Add(informationHash);
}
await SaveFileAsync(PasswordTextFileFolderPath, settings.ProtectedPasswordFileName, "txt", password);
if (InformationHashes.Count == 1)
{
return InformationHashes[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public static void ClearOutExistingSets()
bool wasModified = false;
string assetPath = null;
string uniqueID = null;

try
{
if (isScene)
Expand All @@ -92,7 +91,7 @@ public static void ClearOutExistingSets()
}
else
{
GameObject prefab = Object.Instantiate(asset);
GameObject prefab = Object.Instantiate(asset);
OnBeforeBuildPrefab?.Invoke(prefab, settings);
assetPath = TemporaryStorageHandler.SavePrefabToTemporaryStorage(prefab, settings, ref wasModified, out uniqueID);
}
Expand Down Expand Up @@ -130,12 +129,5 @@ public static void ClearOutExistingSets()

return new(false, null);
}
finally
{
if (!isScene && asset != null)
{
Object.DestroyImmediate(asset);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ public static class BasisBundleBuild
{
public static async Task<(bool, string)> GameObjectBundleBuild(BasisContentBase BasisContentBase, List<BuildTarget> Targets)
{
return await BuildBundle(BasisContentBase, Targets,
(content, obj, hex, target) => BasisAssetBundlePipeline.BuildAssetBundle(content.gameObject, obj, hex, target));
return await BuildBundle(BasisContentBase, Targets, (content, obj, hex, target) => BasisAssetBundlePipeline.BuildAssetBundle(content.gameObject, obj, hex, target));
}

public static async Task<(bool, string)> SceneBundleBuild(BasisContentBase BasisContentBase, List<BuildTarget> Targets)
{
return await BuildBundle(BasisContentBase, Targets,
(content, obj, hex, target) => BasisAssetBundlePipeline.BuildAssetBundle(content.gameObject.scene, obj, hex, target));
return await BuildBundle(BasisContentBase, Targets,(content, obj, hex, target) => BasisAssetBundlePipeline.BuildAssetBundle(content.gameObject.scene, obj, hex, target));
}
public static async Task<(bool, string)> BuildBundle(
BasisContentBase BasisContentBase,
Expand Down Expand Up @@ -93,7 +91,7 @@ public static class BasisBundleBuild
);
Debug.Log($"Switched back to original build target: {originalActiveTarget}");
}

await AssetBundleBuilder.SaveFileAsync(Objects.AssetBundleDirectory, Objects.ProtectedPasswordFileName, "txt", hexString);
OpenRelativePath(Objects.AssetBundleDirectory);
return (true, "Success");
}
Expand Down

0 comments on commit a871364

Please sign in to comment.