Hi Chris, sorry to bother you during summertime,
I created a dissolve effect shader to show an image appearing or disappearing in GUI with a particulare fade in or fade out effect. Then I wrote a script to control the dissolving effect with a public function called StartDissolve with a bool argument (true fade in, false fade out) and I attached it as a component of the UI image.
When I call the function (i.e. StartDissolve) through the Object: Call Event checking or unchecking the bool it works fine.
But when I make the canvas a prefab and link it to an AC menu, it doesn't work anymore, neither with Call Event, nor with Send Message.
With the Object: Call Event it seems AC loses the object, not linking it to its constant ID (retain in prefab is checked and the element is turned on in the menu manager). While Call Event seems not to pass the bool to the function. Is there a way to do this inside AC ?
Thanks.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The Object: Call event Action relies on Unity's Event system, which requires a direct reference to the object - if you assign a prefab, it'll affect that prefab as opposed to the instance of it in the scene.
Object: Send message can be used in this case, but you'll need to call a function with no parameters. You can update your script with such functions that call
StartDissolve
with the correct value, i.e.:You can then use the Action to invoke its
FadeIn
/FadeOut
functions.Thanks.