playMaker

Author Topic: Is there a Playmaker action that can get hash out of AssetBundle manifest?  (Read 7171 times)

PleaseHelpMe

  • Playmaker Newbie
  • *
  • Posts: 20
Hello, is there a Playmaker Action that can get the hash out of an AssetBundle manifest so AssetBundle versions can be confirmed and will update?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 uhm, interesting question, just made an action for this on the ecosystem called

GetAssetBundleHashIsValid

Can you confirm it works for you?

 Bye,

 Jean

PleaseHelpMe

  • Playmaker Newbie
  • *
  • Posts: 20
Hi,

 uhm, interesting question, just made an action for this on the ecosystem called

GetAssetBundleHashIsValid

Can you confirm it works for you?

Hello, thank you for the quick script. However, I am receiving this error and it does not even appear inside "Actions" tab.

Assets/PlayMaker Custom Actions/AssetBundle/GetAssetBundleHash.cs(35,40): error CS0120: An object reference is required to access non-static member `UnityEngine.AssetBundleManifest.GetAssetBundleHash(string)'

Your written code for line 35 is:
Code: [Select]
Hash128 _hash = AssetBundleManifest.GetAssetBundleHash (assetBundleName.Value);

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 ah, crap, I need to dive into Bundle properly on this one.

 Where is located your bundle? is online or inside a mobile app?

 Bye,

 Jean

PleaseHelpMe

  • Playmaker Newbie
  • *
  • Posts: 20
Hi,

 ah, crap, I need to dive into Bundle properly on this one.

 Where is located your bundle? is online or inside a mobile app?

Hello, the Bundles are located online. I am using the "W W W Asset Bundle" to call the bundle and caching the bundle.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 ok, so do you want to download the manifest first and verify the hash or do you want to download the bundle and then check the manifest?

are you on 2017 and/or 2018? or 5.x?

 Bye,

 Jean

PleaseHelpMe

  • Playmaker Newbie
  • *
  • Posts: 20
Hi,

 ok, so do you want to download the manifest first and verify the hash or do you want to download the bundle and then check the manifest?

are you on 2017 and/or 2018? or 5.x?

Hello, I want it to download the manifest first since the manifest is only 1KB and it will be downloaded from the internet immediately everytime the app is launched. Thus, allowing for all other scenes that require to be updated to download immediately after that.

I am on 2018.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 ok, I was trying with 5.6, and was hitting trouble, I'll try on 2017 an 2018, maybe it will work straight off.


Bye,

 Jean

PleaseHelpMe

  • Playmaker Newbie
  • *
  • Posts: 20
Hi,

 ok, I was trying with 5.6, and was hitting trouble, I'll try on 2017 an 2018, maybe it will work straight off.

Hello again, I've also been trying to figure out how to delete Version "1" of a cached AssetBundle so I can replace Version "1" with an updated cached AssetBundle from the internet. Because the current method is to keep incrementing the Version "#" integer from 1 to 2 to 3, etc. everytime there is an update.

So if the AssetBundle is updated to Version "2", then the Version "1" is still cached and is taking up storage space.

So on "W W W Asset Bundle" there exists a bool "Load From Cache or Download" and an integer "Cache Version "#"".
Is it possible to create an "Override Cache" and "Cache Version "#"" as well. That will override a Cached AssetBundle with the new AssetBundle? This way, it can stick to Version "1" and only have 1 AssetBundle Version Cached instead of multiple versions cached?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 ok, after some discussion on the unity forum, it turns out that I am failing to produce a valid asset bundle... I am puzzled as to why, but I have to investigate further.

 but I think I fixed the action to get the hash and checkj if it is valid, can you get it again from the ecosystem:

 you first load the assetbundle into an FmsObject and use that within the action GetAssetBundleHashIsValid action.

 It's blind coding since I don't have any working assetbundle.

 maybe you could share with me your url, and give me the assetBundleName, then I can try.

 Let me know how it goes,

 we'll get to the versionning after.

 BYe,

 Jean

PleaseHelpMe

  • Playmaker Newbie
  • *
  • Posts: 20
Hi,

 ok, after some discussion on the unity forum, it turns out that I am failing to produce a valid asset bundle... I am puzzled as to why, but I have to investigate further.

 but I think I fixed the action to get the hash and checkj if it is valid, can you get it again from the ecosystem:

 you first load the assetbundle into an FmsObject and use that within the action GetAssetBundleHashIsValid action.

 It's blind coding since I don't have any working assetbundle.

 maybe you could share with me your url, and give me the assetBundleName, then I can try.

 Let me know how it goes,

 we'll get to the versionning after.
It doesn't seem like I'm doing this correctly. For "Asset Bundle" should I be loading in the Saved Variable Object of the AssetBundle I want to be loading and for "Asset Bundle Name" I should be typing in the name of the Manifest?

I am uploading 2 sets of the same AssetBundles with different builds so you can test it.

The 1st set of AssetBundles uploaded below will display a text saying "Version 1".
Code: [Select]
Manifest file, called "Android" since it is built for Android
https://www.dropbox.com/s/ifi40dkepafej9j/Android?dl=1

Scene file, called "test1" will display text "Version 1"
https://www.dropbox.com/s/tflc26qfy0xdzxu/test1?dl=1

The 2nd set of AssetBundles uploaded below will display a text saying "Version 2".
Code: [Select]
Manifest file, called "Android" since it is built for Android
https://www.dropbox.com/s/umvfkh1psbvcymq/Android?dl=1

Scene file, called "test1" will display text "Version 2"
https://www.dropbox.com/s/ufkp2y0gemwerqj/test1?dl=1

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,
 
you need to load the assetbundle itself, not the file with the extension .manifest.

 yes, you save it in the assetbundle FsmVariable and use it in the action to get the hash is valid flag.


which version of Unity did you use to produce these asset bundles?


Bye,

 Jean

PleaseHelpMe

  • Playmaker Newbie
  • *
  • Posts: 20
Hi,
 
you need to load the assetbundle itself, not the file with the extension .manifest.

 yes, you save it in the assetbundle FsmVariable and use it in the action to get the hash is valid flag.


which version of Unity did you use to produce these asset bundles?

Hello, I uploaded the assetbundles using 2018. The Android Manifest file I uploaded is the correct file. I did NOT upload the Android.Manifest file. I uploaded the Android no extension file.

The assetbundle build for android will still work with other platforms. Just some objects will lose texture and become purple.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Hi, just to throw it out there. Here are my asset bundle actions, that are confirmed working. The require unity 5.3 and higher.

https://github.com/dumbgamedev/playmaker_assetbundle

It does not have the hash action however.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi Eric,

 Could you validate that the hash is valid actions works for you?

 Bye,

 Jean