Author Topic: Tween alpha of a 3d object inside a UIPanel  (Read 4967 times)

Fraco

  • Guest
Tween alpha of a 3d object inside a UIPanel
« on: May 31, 2013, 10:38:31 AM »
Hello!

I'm using NGUI for the first time. In my application I'm using TweenAlpha to fade in and out menu panels. It works amazingly well for all sprites within the panel with the extra convenience of turning off all colliders, preventing unwanted interaction when the panel is invisible.

I have now encountered an obstacle: In some of those panels I want to use not only sprites but also some 3d objects I have modeled. On the object's material I have set the shader to be "Unlit/Transparent Colored", but I see no controls for tint/alpha on the Unity Inspector and changing the alpha of the parent's UIPanel has no effect.

I would like to set up the 3d objects inside my UIPanel in such a way that when I call something like

  1. TweenAlpha.Begin(parentPanel.gameObject, fadeTime, 0);

all items, both sprites and 3d objects, fade out.

Is this possible and if so how? Thanks so much in advance for your time! (:

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween alpha of a 3d object inside a UIPanel
« Reply #1 on: May 31, 2013, 02:06:10 PM »
TweenAlpha tweens the alpha value on the panel, which only affects widgets. 3D models are not widgets, so they will not be affected. You need to tween them separately.

Fraco

  • Guest
Re: Tween alpha of a 3d object inside a UIPanel
« Reply #2 on: May 31, 2013, 02:15:55 PM »
Understood! Thanks for the response!