playMaker

Author Topic: action to set or fade alpha for group of ui objects?  (Read 3337 times)

Spunkyinteractive

  • Playmaker Newbie
  • *
  • Posts: 22
action to set or fade alpha for group of ui objects?
« on: December 04, 2016, 09:50:06 PM »
Currently i have placed each of my menus under a parent object each of which has a 'canvas group' on it. With this setup I use the 'u gui canvas group set alpha' action to have my menu fade in and out. However, the issue here is that the 'canvas group' component forces all children objects to have their raycasts turned on or off. Since some objects are buttons i cant just have raycasts all turned off, however raycasts are expensive for perf and unity best practices suggests to turn off raycasts on any objects that dont require them (ie. text objects).

Is there an action that takes advantage of other unity calls in order to fade a canvas? Or any other way of going about fading entire blocks of ui without forcing raycasts on?
For example https://docs.unity3d.com/ScriptReference/UI.Graphic.CrossFadeAlpha.html

thanks,
-Stephen
« Last Edit: December 04, 2016, 10:07:40 PM by Spunkyinteractive »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: action to set or fade alpha for group of ui objects?
« Reply #1 on: January 09, 2017, 03:57:04 AM »
Hi,

 ok, I added crossFadeAlpha and crossFadeColor actions for uGui. It's on the Ecosystem :)

 Bye,

 Jean

Alatriste

  • Full Member
  • ***
  • Posts: 194
Re: action to set or fade alpha for group of ui objects?
« Reply #2 on: December 01, 2018, 02:16:50 PM »
Is this action still working? I tried in my project and I cannot make it work. My Image component doesn't show up any changes when I activate it.

EDIT: It does. But it won't work if you have a Finished event in the action. (but you can add a wait for the crossfade to finish before continue)
« Last Edit: December 01, 2018, 02:24:40 PM by Alatriste »