Author Topic: TweenScale: Update Table not working  (Read 3293 times)

monogon

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 9
    • View Profile
TweenScale: Update Table not working
« on: May 03, 2014, 09:45:15 AM »
Hey!

It is not the first time I set up a widget with TweenScale that updates the table but right now I can't get it working. I don't know what I did wrong this time ...
This is my structure
  1. UITable
  2. ---UIWidget (first container element)
  3.     ---UIWidget (second container element)
  4.         ---UIWidget with TweenScale
  5.             --- elements
  6.             --- ....
  7.  

I just looked into the last project where I used this method and found out that in this project there is one less container element. So this structure:

  1. UITable
  2. ---UIWidget (first container element)
  3.     ---UIWidget with TweenScale
  4.         --- elements
  5.         --- ....
  6.  

Now I thought TweenScale is not able to find UITable because UITable is too far up in the Transform hierarchy.
However I looked into the code of TweenScale and if I understand it right it should search in all parents ...

So what could be going on here?
« Last Edit: May 03, 2014, 01:15:19 PM by monogon »

monogon

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: TweenScale: Update Table not working
« Reply #1 on: May 03, 2014, 05:05:51 PM »
Ok, I checked it during debug mode in the inspector:
The TweenScale instance is definitely finding the parent table and referencing it in the variable "mTable". So what's going on here??

Why is "mTable.repositionNow = true" not working as expected?

Edit: I tried moving the scaleContainer one step up in the transform hierarchy (like it was in the older project) and the table is now updating. However this is not an option for me in this case.... I need the scale containers to be one step lower in the hierarchy or my whole structure becomes really messy.
Why is it not working with two parent elements between UITable and TweenScale? To me this makes no sense right now .. Could you please check this ArenMook? Thanks in advance!
« Last Edit: May 03, 2014, 05:14:42 PM by monogon »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TweenScale: Update Table not working
« Reply #2 on: May 04, 2014, 10:49:26 AM »
As I recall if the table's immediate child is a widget, it will use that widget's dimensions as the bounds for its calculations. If the object is a game object rather than a widget, then it will go down the more expensive (and slower) route of adding up all of its widget's bounds.

So your container element must be a plain game object, not a widget.