Hello,
I am implementing a powerup menu that that has icons pop out and close after the player clicks a powerup.
My issue is I want the powerup menu's icons to reset to their hidden positions after the panel holding the menu is set to inactive.
So I figured the resetIfDisabled should do just that, so I call that in the start function on the power menu script.
This is how my hierarchy is set up:
--PowerupPanel
----PowerupMenu <-- Has following script attached, a collider and a UIPlayTween(Play Direction is set to Toggle) for each Powerup.
--------PowerupA - Has Tween Position to pop the powerup out.
--------PowerupB - Has Tween Position to pop the powerup out.
--------PowerupC - Has Tween Position to pop the powerup out.
The script I have attached to the PowerupMenu:
void Start () {
foreach (UIPlayTween ptt in gameObject.GetComponents<UIPlayTween>())
{
ptt.resetIfDisabled = true;
}
foreach(UIPlayTween pt in transform.GetComponentsInChildren<UIPlayTween>(true))
{
pt.resetIfDisabled = true;
}
}
What happens is the powerup menu works but when I hide and unhide the panel the state they
are in stays, meaning they dont return to their original hidden positions.
Any help or insight would be very appreciated!
Thanks,
Max