Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Getting the UnityCloudBuildManifest during Post-Export method?

Discussion in 'Unity Build Automation' started by ESG-Steven, Feb 26, 2016.

  1. ESG-Steven

    ESG-Steven

    Joined:
    Mar 18, 2015
    Posts:
    38
    Is it possible to do this? I've attempted Resources.Load and when that failed (I assume this didn't work because this isn't a runtime environment with embedded assets) I attempted to do something like then following, which also failed:

    Code (CSharp):
    1. AssetDatabase.LoadAssetAtPath<TextAsset>("Assets/__UnityCloud__/Resources/UnityCloudBuildManifest.json");
    The reason why I'm doing this and not just caching the pre-export method's BuildManifestObject is that it never seems to have the appended "localBundles" and "localBundlesRelativePath" keys in the json that is said to come with turning on 'Build Asset Bundles' in the UCB project console. I figured that because it's done during the building of the project, it was only available after. Perhaps I'm just doing something wrong here instead?
     
  2. doggan

    doggan

    Joined:
    Aug 12, 2012
    Posts:
    23
    Try something like below. I use this to successfully get the BuildManifestObject in my PostProcessBuild. I assume it would also work in Post-Export.

    Code (CSharp):
    1. var manifest = (UnityEngine.CloudBuild.BuildManifestObject)AssetDatabase.LoadAssetAtPath(
    2. "Assets/__UnityCloud__/Resources/UnityCloudBuildManifest.scriptable.asset",
    3. typeof(UnityEngine.CloudBuild.BuildManifestObject));
     
    ESG-Steven likes this.
  3. ESG-Steven

    ESG-Steven

    Joined:
    Mar 18, 2015
    Posts:
    38
    Thanks a lot! Totally works.