Asset Cooked Event example ?

   3429   5   2
User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
Hi Folks,

Does anyone know how asset cooked event works ? I added one on my HDA in Unity, and I selected the example script HEU_AssetEventReceiverTest.cs into the slot. Set it to “Runtime and Editor” but when I cook the asset, there is nothing printed out in the console ? And it seems that after a cook the slot is set to “CookedCallback” instead of HEU_AssetEventReceiverTest.

The documentation on that matter is not very helpful, anybody have idea on that ?

Unity 2018.2.14f1 and Houdini 17.0.352

Thanks !
http://cgtoolbox.com/ [cgtoolbox.com] Houdini tools and scripts for free ! :)
User Avatar
Member
571 posts
Joined: May 2017
Offline
Hi,

In the event field, you'll need to set the event callback to CookedCallback. See attached screenshot.

The GameObject field is the target object, and the dropdown is the actual event function, so that needs to be set.

Attachments:
cookedcallback.png (10.7 KB)

User Avatar
Member
17 posts
Joined: May 2010
Offline
Hi Seelan,

Thanks for your reply, and sorry for the dumm question ( I'm quite new i nUnity world ) but, the GameObject field is filled with the C# script itself ? I tried to drag and drop it, that but with no luck …
Houdini Pipeline TD - Ubisoft
http://www.cgtoolbox.com [www.cgtoolbox.com]
Free scripts for Houdini !
User Avatar
Member
571 posts
Joined: May 2017
Offline
The gameobject field is for the object that has the HEU_AssetEventReceiverTest script attached to it. You can create a new gameobject, attach the HEU_AssetEventReceiverTest script, then drag & drop the gameobject to that field. Then choose the CookedCallback in the dropdown.
User Avatar
Member
571 posts
Joined: May 2017
Offline
The underlying mechanism is UnityEvents, so perhaps a tutorial on that might help you out:
https://docs.unity3d.com/Manual/UnityEvents.html [docs.unity3d.com]
https://www.youtube.com/watch?v=pjWqsFDozSo [www.youtube.com]
Edited by seelan - Nov. 5, 2018 10:28:17
User Avatar
Member
17 posts
Joined: May 2010
Offline
Awesome ! That's what I was looking for to be able to run my small tests Thanks a lot seelan.
Houdini Pipeline TD - Ubisoft
http://www.cgtoolbox.com [www.cgtoolbox.com]
Free scripts for Houdini !
  • Quick Links