Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Get RemoteBuildPath

Discussion in 'Addressables' started by faolad, Jul 17, 2019.

  1. faolad

    faolad

    Joined:
    Jan 27, 2013
    Posts:
    118
    How can I get the RemoteBuildPath directory, is there something similar to Addressables.BuildPath?
     
    Last edited: Jul 17, 2019
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    What do you mean? You writing editor code that needs to know where things wound up? You can ask the profile system for the evaluation of a particularly named variable. But that name is arbitrary. So more likely you want code that inspects the group schema to see what it's pointing to, and react accordingly.
     
    faolad likes this.
  3. faolad

    faolad

    Joined:
    Jan 27, 2013
    Posts:
    118
    What I'm looking for is to know the size of the download location folder.
     
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Ah, you want to know what is the total size, on disk, of the generated remote artifacts of the build. Right?

    Two main ways I could see doing this.
    1. Do something like this (pseudo code)
    Code (CSharp):
    1.  
    2. settings = AddressableAssetSettingsDefaultObject.Settings.groups
    3. foreach ( group in settings)
    4. {
    5. s =  group.GetSchema<BundledAssetGroupSchema>()
    6.   if(s not null)
    7.     myListOfPaths.Add(  s.BuildPath.GetValue(settings) )
    8. }
    9.  
    This would tell you all the build paths as of when you are running your editor code. At that point you could check those spots for files, and get their size.

    2. Or look at the actual build result. You can do this by calling build yourself, or overriding BuildScriptPackedMode. The result of the build is an AddressablesPlayerBuildResult which contains a FileRegistry (all the build artifacts).

    hope this helps.
     
    faolad likes this.