Search Unity

Addressables are here!

Discussion in 'Addressables' started by audrey-unity, Jun 15, 2018.

  1. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
  2. vexe

    vexe

    Joined:
    May 18, 2013
    Posts:
    635
    I was just messing around. Got a null ref exception in a brand new project hitting the "Preview" button in the Adressables window

    Unity 2018 2.6f1 - Addressables 0.2.2-preview

    Code (csharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3. UnityEditor.AddressableAssets.AddressableAssetsSettingsGroupEditor.TopToolbar (Rect toolbarPos) (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.2.2-preview/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:123)
    4. UnityEditor.AddressableAssets.AddressableAssetsSettingsGroupEditor.OnGUI (Rect pos) (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.2.2-preview/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:331)
    5. UnityEditor.AddressableAssets.AddressableAssetsWindow.OnGUI () (at C:/Users/user/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.2.2-preview/Editor/GUI/AddressableAssetsWindow.cs:134)
    6. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    7. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    8. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    9. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    10. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
    11. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
    12. UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
    13.  
    14.  
     
  3. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
    Thanks for the report. I've put in a bug about it. This will not be fixed in the next release (0.3.x) as that's almost out, but should be addressed in the following round (0.4.x).

    -Bill
     
  4. JiMMaR

    JiMMaR

    Joined:
    Aug 4, 2012
    Posts:
    12
    Is there a way to download some assets without loading them into memory ?

    my understanding is that Addressables.PreloadDependencies will fetch but also load everything into memory, I just need to prefetch them on game loading and then load them later as needed.
     
  5. AAK_Lebanon

    AAK_Lebanon

    Joined:
    May 30, 2015
    Posts:
    59
    I was surprised today when I saw that the current version now is 0.3.5 (jumping from 0.2.2) is there something that am I missing (maybe a git repository where I can monitor update more frequently ?) and it seems from the change log that they are talking about a new terms, for example :
    • "Build/Prepare for Content Update" will detect assets in locked bundles (bundles flagged as static, by default all local bundles)"
    what they mean by locked bundles ? or bundles flagged as static ? and also they say that "Added docs for the Content Update flow", where are those docs ?
     
  6. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
    The answer is "a little no, but mostly yes". When you preload dependencies, the AssetBundle is downloaded, then loaded into memory. But there are two key details that make this loading fairly insignificant. Firstly, we immediately release them (dropping the ref-count to zero). That should immediately unload them unless you have set up a pooled provider yourself. Secondly, Unity has overloaded the term AssetBundle. It refers to both the large file, and the header inside the file (confusing right!). When we load the "AssetBundle" into memory, we're only loading the header. Not the actual content in the bundle. So we download the giant thing, load a small header, then unload the small header.
    You could also look into creating your own provider that didn't do this, but the impact should be pretty small.

    -Bill
     
    JiMMaR and karl_jones like this.
  7. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
    You are not missing anything. We just published the new release, but the online docs haven't been updated so I haven't posted about it in the forums yet. Once the docs are online, I'll post in https://forum.unity.com/threads/release-announcements-and-notes.543537/.

    As to the version number... The reason for the .3. is that every release we do will bump the minor (second number) unless it's a small patch (bug fix). The reason for the .5 is that when we test internally, we actually publish the package to a hidden server so QA can test a true package update process rather than just pulling the code from our repo. As we fix bugs found by our QA, we update that patch version. So as far as the public is concerned, 0.3.5 will follow 0.2.2.

    As to a repo, we're working on that. Right now Unity is hosting our content on an internal server. We intend to get this out to a public one in the coming months. I know many of you want direct access to the code, and we want you to have it so you can more easily point out (and maybe fix!) bugs. Once we have a public repo, I'll post about it on the forum for sure.

    As to docs, as I said, they aren't up yet, hence the lack of an announcement. Keep an eye on that release notes thread for once we're fully live with 0.3.5.

    -Bill
     
    karl_jones and AAK_Lebanon like this.
  8. mentorgame1

    mentorgame1

    Joined:
    Oct 31, 2016
    Posts:
    19
    Someone already try it using Remote Loading?
     
  9. AAK_Lebanon

    AAK_Lebanon

    Joined:
    May 30, 2015
    Posts:
    59
    I can't understand the workflow documentation: what is the benefit or the idea behind "structuring your games in two groups:things that you want to update and things that will never update" ?

    I mean everything not addressable should be static, right ?
     
  10. dri_richard

    dri_richard

    Joined:
    Mar 10, 2017
    Posts:
    56
    How do we prevent 'modding' if our addressables pertain to paid-for content? We wish to prevent piracy and also the injection of user-created content.
     
  11. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    48
    We are looking into potential solutions to this. One possibility is to encrypt the settings.json and catalog.json files when making player builds. Bundles themselves could also be encrypted and use a custom provider to load at runtime. We plan on adding a base encrypted bundle provider for users to subclass and use, but this is a bit further down the roadmap.
     
  12. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
    Perhaps a better way to phrase it would have been "structure your addressables into two groups...". The idea being that some things you mark as addressable you will want to be able to easily update via a remote server. Some things not. I'll update the docs in the next release to be more clear.

    -Bill
     
    AAK_Lebanon likes this.
  13. JiMMaR

    JiMMaR

    Joined:
    Aug 4, 2012
    Posts:
    12
    Is there a way to find out if something is already downloaded or not ?

    I'm using
    Code (CSharp):
    1. Addressables.PreloadDependencies("Preload", null)
    to preload on game launch, I'd like to show a progress bar for that.
    but for example when I launch the game a second time, those assets should be already cached and there would be no need to show any progress bar so how can I check if there are any assets to be downloaded ?
     
  14. Ann0036

    Ann0036

    Joined:
    Mar 11, 2015
    Posts:
    1
    Hi just played around with the new version 0.3.5. But where has the the toggle button "addressable" gone? Is this just a bug or what am I missing? :/

    Version 0.3.5:

    Version 0.1.2:

    Thanks /Ann
     
  15. JiMMaR

    JiMMaR

    Joined:
    Aug 4, 2012
    Posts:
    12
    Ann0036 likes this.
  16. mentorgame1

    mentorgame1

    Joined:
    Oct 31, 2016
    Posts:
    19
    nullGroup.png
    I was able to create a null reference even tho i just used the Addressable to delete and Group. and then this happen and now i can't compile.

    EDIT: i add a setter to the group on the "AddressableAssetSettings" just to create on my script a remover of any null value!!! and then the addressable windows update correctly and show up normally! before was totally blanked.
     
    Last edited: Sep 13, 2018
  17. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
    Thanks for letting us know, we'll add this as a bug.
     
  18. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
    Right now, no. I've added it into our system as a feature request. In the mean time, if you still call PreloadDependencies, it will finish the next frame if everything is there. Generally, we've seen games that not only need to download, but also load some assets into memory. So the first launch loading screen takes a while (download all + small load) and the later runs it's much quicker (still doing the load). If you don't need to pre-load anything into memory, then you have a 1 frame delay waiting to see if the preload is done.
     
    JiMMaR likes this.
  19. mentorgame1

    mentorgame1

    Joined:
    Oct 31, 2016
    Posts:
    19
    i'm trying to figure it out why my standalone build now is getting "Unable to open archive file: StandaloneWindows64/UnityBuiltInShaders"! maybe becouse now i compile in il2cpp?
     
  20. OmiCron07

    OmiCron07

    Joined:
    Jun 27, 2015
    Posts:
    6
    I have an issue with Git, when I restore my repo, the addressable's tags are lost. Here is my .gitignore:

     
  21. PBeast

    PBeast

    Joined:
    May 12, 2014
    Posts:
    35
    Hey Guys ! First of all I LOVE addressables! Great feature! :)
    But as i played around with it i tried to load scenes which are addressables but that didn't work for some reason?!
    Loading scenes is unfortunately not documented so i might use it completely wrong ... I do :
    Code (CSharp):
    1.         public AssetReference SceneTest;
    2.    
    3.         public void Initialize()
    4.         {
    5.             var async = Addressables.LoadScene(SceneTest, LoadSceneMode.Additive);
    6.             async.Completed += operation => {
    7.                    Debug.Log("LOADED! ");
    8.                    Debug.Log(operation.Result.isLoaded);
    9.             };
    10.         }
    I get the LOADED log but the scene is not present in the hierarchy and the
    operation.Result.isLoaded
    returns false. What do i miss here? What do i have to call to really load a scene?
    I'm using package version 0.3.5

    Thanks guys and sorry if i miss something obvious here :-/
     
    Last edited: Sep 20, 2018
    dnnkeeper likes this.
  22. JorgeJustino

    JorgeJustino

    Joined:
    Mar 2, 2011
    Posts:
    16
    Hey guys, I started using this new addressable system and its getting very nice.
    I'm having a problem when configuring my groups, I'm using unity version 2018.3.0b1 and the package version 0.3.5,
    I have 4 groups where all of them contains one prefab each, but for some reason when I close my unity and open again those prefabs are being removed from groups, I dont know what should be causing this, those prefabs are variants of another one. It seems that unity is not saving those prefabs into the groups.
    Has anyone stumble into something similar?

    Thanks for the great work :)
     
  23. dnnkeeper

    dnnkeeper

    Joined:
    Jul 7, 2013
    Posts:
    64
    I come here with exactly the same question! Can't get scene loaded with addressables. It works fine in Virtual Play mode but doesn't work in Packed Play mode.

    Plus I'd like to figure out if it is possible to add a new scene and load it via addressable system without updating main APK. For now it is required to have scene added into Build Settings list.
     
  24. PBeast

    PBeast

    Joined:
    May 12, 2014
    Posts:
    35
    It does work for you in Virtual Play mode ? o_O For me it does not work at all :confused:
     
  25. dnnkeeper

    dnnkeeper

    Joined:
    Jul 7, 2013
    Posts:
    64
    Quatum1000 and PBeast like this.
  26. Tony707

    Tony707

    Joined:
    Jun 15, 2015
    Posts:
    37
    Looks like the AssetReference is not marked as dirty if changing the referenced asset in a scene ? Is that a known bug ?

    I'm on Unity 2018.2.9 and Addressables 0.3.5
     
  27. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
    I've added all three of these to our bug list. I think they may all be related, but regardless we'll look into all of them.
     
    tomoyasu_ishikawa likes this.
  28. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    673
    The second one of these sounds like case 1084178.
     
  29. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    What's the best way to check whether an asset reference is assigned?

    These aren't great

    Code (CSharp):
    1.  AssetReference assetReference;
    2.  
    3. bool isAssigned = assetReference.RuntimeKey != Hash128.Parse(0);
    4.  
    5. bool isAssigned2 = assetReference != new AssetReference(0);
    6.  
    7. bool isAssigned3 = assetReference.ToString() != "[0]";
    I'd love an equality check based on the guid as well please.
     
  30. JoshuaMcKenzie

    JoshuaMcKenzie

    Joined:
    Jun 20, 2015
    Posts:
    818
    So I just downloaded Version 0.3.5 and I came across a couple bugs I'd like to point out.

    1. One of the first things I tried doing in the Addressables Window was create a new Group. I named the new group "Remote/Core/Characters" (to mirror an AssetBundle Label) and not only did the Group not get created, it failed silently and will not let me create other groups ( reopening the window did not solve the issue, forced to reboot Unity). I assume it was the "/" that broke it which in retrospect makes sense since the groups will be actual files in the AddressableAssetData folder. Using another character instead of "/" is easy, but just pointing out that there should be feedback that would let the user know that certain characters are not allowed and should it prevent it breaking the window.

    2. Also another issue I ran into was when I opened the window it asked if I wanted to auto-convert a legacy asset bundle Addressables. when I chose to convert a progress window popped up an the conversion immeadiately failed. It threw an error stating that the target folder needs to exist first (it wanted to put the new asset in a new folder within "AddressableAssetsData/AssetGroups/[Folder]/[Folder]/[Asset]"). The progress window was halted but would not go away and would not allow focus to return to the editor, Cancel button was unresponsive (forced to kill Unity Process).

    3. I get the following Errors/Exceptions on re-launch:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.AddressableAssets.AddressableAssetSettings.Validate () (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/Settings/AddressableAssetSettings.cs:386)
    3. UnityEditor.AddressableAssets.AddressableAssetSettings.OnEnable () (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/Settings/AddressableAssetSettings.cs:370)
    4. UnityEditor.AddressableAssets.AddressableAssetsWindow:OnEnable()
    5. UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
    6. UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)
    7.  
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.AddressableAssets.AddressableAssetSettings.FindAssetEntry (System.String guid) (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/Settings/AddressableAssetSettings.cs:529)
    3. UnityEditor.AddressableAssets.AddressableAssetSettings.CreateSubEntryIfUnique (System.String guid, System.String address, UnityEditor.AddressableAssets.AddressableAssetEntry parentEntry) (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/Settings/AddressableAssetSettings.cs:648)
    4. UnityEditor.AddressableAssets.AddressableAssetEntry.GatherAllAssets (System.Collections.Generic.List`1 assets, Boolean includeSelf, Boolean recurseAll) (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/Settings/AddressableAssetEntry.cs:268)
    5. UnityEditor.AddressableAssets.AddressableAssetEntryTreeView.AddAndRecurseEntriesBuild (UnityEditor.AddressableAssets.AddressableAssetEntry entry, UnityEditor.AddressableAssets.AssetEntryTreeViewItem parent, Int32 depth) (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:625)
    6. UnityEditor.AddressableAssets.AddressableAssetEntryTreeView.AddGroupChildrenBuild (UnityEditor.AddressableAssets.AddressableAssetGroup group, UnityEditor.IMGUI.Controls.TreeViewItem root) (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:615)
    7. UnityEditor.AddressableAssets.AddressableAssetEntryTreeView.BuildRoot () (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:448)
    8. UnityEditor.IMGUI.Controls.TreeView+TreeViewControlDataSource.FetchData () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControlDataSource.cs:53)
    9. UnityEditor.IMGUI.Controls.TreeViewDataSource.ReloadData () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewDataSource.cs:53)
    10. UnityEditor.IMGUI.Controls.TreeView+TreeViewControlDataSource.ReloadData () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControlDataSource.cs:25)
    11. UnityEditor.IMGUI.Controls.TreeViewController.ReloadData () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:285)
    12. UnityEditor.IMGUI.Controls.TreeView.Reload () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControl.cs:103)
    13. UnityEditor.AddressableAssets.AddressableAssetsSettingsGroupEditor.OnGUI (Rect pos) (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:333)
    14. UnityEditor.AddressableAssets.AddressableAssetsWindow.OnGUI () (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/GUI/AddressableAssetsWindow.cs:134)
    15. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    16. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    17. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    18. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    19. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
    20. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
    21. UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
    22. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    23.  
    Code (CSharp):
    1. ArgumentException: Getting control 2's position in a group with only 2 controls when doing Repaint
    2. Aborting
    3. UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Modules/IMGUI/LayoutGroup.cs:117)
    4. UnityEngine.GUILayoutUtility.BeginLayoutArea (UnityEngine.GUIStyle style, System.Type layoutType) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:361)
    5. UnityEngine.GUILayout.BeginArea (Rect screenRect, UnityEngine.GUIContent content, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayout.cs:287)
    6. UnityEngine.GUILayout.BeginArea (Rect screenRect) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayout.cs:275)
    7. UnityEditor.AddressableAssets.AddressableAssetsSettingsGroupEditor.TopToolbar (Rect toolbarPos) (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:106)
    8. UnityEditor.AddressableAssets.AddressableAssetsSettingsGroupEditor.OnGUI (Rect pos) (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/GUI/AddressableAssetsSettingsGroupEditor.cs:346)
    9. UnityEditor.AddressableAssets.AddressableAssetsWindow.OnGUI () (at C:/Users/Owner/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.addressables@0.3.5-preview/Editor/GUI/AddressableAssetsWindow.cs:134)
    10. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    11. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    12. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    13. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    14. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
    15. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
    16. UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
    17.  
    Code (CSharp):
    1. TreeView has not been properly intialized yet. Ensure to call Reload() before using the tree view.
    2. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    3.  
    Basically, Addressables Window was open on launch but due to the errors the panel would not render. AddressableAssetSettings had a null ref in its Groups (what @mentorgame1 had posted). I was able to manually solve the issue by changing the inspector to debug mode and remove the empty field from the groups list/array and then reopen the Addressables window. Not sure how you would want to handle this error, (remove field vs skip) but in either case it shouldn't prevent the window from rendering
     
  31. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    If you have an array of AssetReferences, modifications to any non zero index are applied to the zero index.
     
  32. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    AssetReference's PropertyDrawer also fails in nested structs in ScriptableObjects
     
    VQZX likes this.
  33. VQZX

    VQZX

    Joined:
    Jan 13, 2013
    Posts:
    1
    AssetReference's not drawing in nested structs in ScriptableObjects is quite a setback for me. I'm hoping to try and find a hack around this until you guys fix it.
     
  34. rachelgarza

    rachelgarza

    Unity Technologies

    Joined:
    Jun 6, 2017
    Posts:
    28
    Hello! I'm working to reproduce this now, would you mind opening up a separate thread with more details on your project setup and the error you're seeing?
     
  35. jedh

    jedh

    Joined:
    Aug 26, 2014
    Posts:
    16
    Maybe I'm missing something but is the Addressables package not available in the package manager? I'm on the latest Unity 2018.2.10f1 and in the package manager for a project I can't see it anywhere - is there some additional step to get Addressable Assets working in a project?
     
  36. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    673
    You need to put the package reference in your manifest.json, it’s not yet discoverable in the package manager.
     
  37. s-vovik

    s-vovik

    Joined:
    Mar 24, 2017
    Posts:
    14
    I have troubles with Addressables initialization in WebGL build at Chrome and Firefox browsers. Application try to load local cashed *.hash files with "file://" url. And browsers blocks that because of security reason. This behavior appears in 0.2.2-preview. In 0-3-5-preview it's also repeat. The same build in Edge working fine. Windows standalone build is working too.

    Please check out this thread https://forum.unity.com/threads/0-3...faild-to-initialize-in-chrome-browser.553741/
     
  38. plzhelp

    plzhelp

    Joined:
    Sep 27, 2018
    Posts:
    4
    hi,

    I am trying to move from loading Resources from the Resources folder, to using Addressables. I've never used Asset Bundles. I'm stuck trying to get Addressables to work loading AnimationClips.

    I have an FBX file which I dragged into the Addressables window into a group and gave it a clean name like "animations"
    I then call Addressables.LoadAsset<AnimationClip[]>("animations");
    On the Completed callback, the op.Result is null and the status is Failed.

    When I load just a single AnimationClip<> instead, it works - but it only gives me the first clip in the FBX. I need access to all clips individually as I had with the Resources.LoadAll() method.

    I am able to get an Array of AnimationClips from a single FBX using Resources.LoadAll as such:

    Resources.LoadAll<AnimationClip>("full path to fbx");

    Yet using Addressables I get a null and failure. What am I doing wrong? I can load a Sprite via .png like in the example project just fine.

    Thanks for any help!
     
    Last edited: Sep 27, 2018
  39. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    13
    thanks s-sovik for some help there...examples help me understand how the code works and is supposed to work.

    Does anyone know how the gui side works - i watched that berlin intro over and over again - i seem to be missing some of his stuff - for instance - i cant create labels i just see default
    edit: found this in addressassetsettings actually


    i only have create group - packed content (which i believe should be fine for what i am doing) just weird that i dont have any other options compared to him

    i was attempting to just do something basic by - adding some sprites from a folder in my assets to and have a progress bar set up and used s-sovik code for test ...it actually executes the but comes up with a bunch of null reference exceptions - pointing to inOperation.OperationException as a null reference from the debug error log - not sure if it SHOULD have data in that message always or not..i could resolve it with a ifnotnull but wasn't positive if i should.


    Debug.Log(inOperation.Current); shows null pretty much over and over again- i am guessing its just something i didnt do in the addressables section

    for instance am i supposed to hit build and save it to a bin or something or hit preview - clear the cache ????

    edit: I think it has something to do with the loadassets<gameobject> and the assets not being gameobjects - maybe? I am just trying to simulating downloading the group of sprites - as i dont need to 'resource.load' anything as others may be doing...I believe I may want preloaddependencies since i just want it to act as a patcher system from the web - download the data and not actually instantiate it. Most of the sprites and such are in sprite repositories which i just call that sprite repository sprite id and it will give me the sprite so that should all work automatically as long as i can figure out how to get addressables to work.
     
    Last edited: Sep 28, 2018
  40. xiaolinl

    xiaolinl

    Joined:
    May 27, 2015
    Posts:
    37
    After loading (Addressables.LoadAsset), is there any way to get the asset path of AssetReference in script?
     
  41. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    121
    Can you use this for assets that are already visible in a scene? For example some tree sprites that you don't call in script but you placed in the scene view.
     
  42. Coryatmarsden

    Coryatmarsden

    Joined:
    May 22, 2018
    Posts:
    6
    This system rocks! I have no issues pulling content down from a CDN if the files are marked as public. Is there an easy way to add some security (authentication token) to the remote server request?
     
  43. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    673
    You should be able to do that by modifying AssetBundleProvider or copying it and replacing the one in ResourceManager.ResourceProviders with your new one.
     
    Coryatmarsden likes this.
  44. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    119
    I can't find Addressable Assets system in the Package Manager. Tried to disable and enable the video package but this didn't help for me. Can someone tell me how to get it? I'm on Unity 2018.2.10f1 (64bit - Windows 10)
     
  45. Coryatmarsden

    Coryatmarsden

    Joined:
    May 22, 2018
    Posts:
    6
    Have you edited your manifest.json yet? Once you do, it will show up in the Package Manager:

    Step 2: Edit your Packages/manifest.json.
    {
    "dependencies": {
    "com.unity.addressables": "0.3.5-preview"
    }
    }
     
  46. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    119
    Tried that. Also rebooted, removed other dependencies etc. Nothings seems to help :-(
    I've also tried to create a new project but even than Addressable System isn't showing up.
     
  47. ARGH-Mika

    ARGH-Mika

    Joined:
    Jun 14, 2018
    Posts:
    1
    Hi, Addressables seems to be quite a nice concept and current version (0.3.5 for me) already works quite nicely. I'm converting existing code from direct references (GameObject, Textures) to AssetReferences (AssetReferenceGameObject etc.) and noticed that when using a custom editor for a scriptable object the entire editor GUI will break if scriptable object has any AssetReference types in there.

    Code (CSharp):
    1. Error rendering drawer for AssetReference property SkinTextureRef.
    2. UnityEditor.EditorGUI:PropertyField(Rect, SerializedProperty, GUIContent)
    3. <OnEnable>c__AnonStorey0:<>m__0(Rect, Int32, Boolean, Boolean) (at Assets/Editor/DataEditor.cs:40)
    4. UnityEditorInternal.ReorderableList:DoListElements(Rect) (at C:/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:587)
    5. UnityEditorInternal.ReorderableList:DoLayoutList() (at C:/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:394)
    6. DataEditor:OnInspectorGUI() (at Assets/Editor/DataEditor.cs:70)
    7. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Result is that when selecting scriptable object (asset) and trying to show inspector all Unity editor windows will show overlapping texts containing the same error message. Not only the inspector but every window. Editor state is broken until restarted.

    My question is if there is something that I should do to use custom editors for drawing asset reference properties?
    I have ReorderableList that contains properties for any type (using reflection) and I can draw any other property with EditorGUI.PropertyField.

    EDIT: Apparently there is already a bug (or two) about this; https://forum.unity.com/threads/error-rendering-drawer-for-assetreference-property.551125/

    If I have ScriptableObject which has a member of a custom (serializable) type that contains AssetReference AssetReferenceDrawer cannot draw it. In my case I have ScriptableObject that has a list of custom serializable classes which contains AssetReference properties. Even without custom editor they won't show up on the Inspector making it quite difficult to use Addressables for our project :).

    EDIT: EDIT:

    I was able to fix all the problems mentioned above. AssetReferenceDrawer has several issues that lead into the problems described above.

    Shortly, it does not support a case where you have AssetReferences in nested classes and it does not properly support them in lists either. This can be fixed using reflection and parsing/walking arbitrary property paths. Also, if you are using generics (List etc) you will have to deal with that special case also, it will have property path that expands array indices like [0] to .Array.data[0].

    Corruption of the editor GUI I experienced (that lead into having garbage labels in all windows) was actually because the AssetReferenceDrawer::OnGUI changes the text of the label that is given for the OnGUI. If you call EditorGUI.PropertyField with GUIContent.none it will modify what that 'none' contains and wherever that static is used later it will contain the last modified label text.

    I had
    Code (CSharp):
    1. EditorGUI.PropertyField(fieldRect, relativeProperty, GUIContent.none);
    which either has to change to
    Code (CSharp):
    1. EditorGUI.PropertyField(fieldRect, relativeProperty, new GUIContent(""));
    or rather remove the modification of the label in the AssetReferenceDrawer::OnGUI.
     
    Last edited: Oct 5, 2018
  48. GilesCoopeAkelius

    GilesCoopeAkelius

    Joined:
    Oct 2, 2018
    Posts:
    7
    I can't get addressables running in WebGL. Even the space demo crashes in Edge, Chrome and Firefox as shown.

    Capture.PNG

    This is with Unity 2018.2.10f1 and Addressables 0.3.5-preview. Anyone with a solution?

    Edit: Fixed, I had to turn off Other Settings > Strip Engine Code
     
    Last edited: Oct 8, 2018
    hopeful likes this.
  49. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
    what you showed is currently best, but it does sound like a good idea for us to create a simple IsValid sort of interface on there. I've added it to our to-do.

    -Bill
     
  50. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    955
    Those are all known bugs that should be addressed in the upcoming 0.4.x-preview release. Basically everything went wrong if you had a slash in a group name
     
    hopeful likes this.