I'm having an odd problem and I'm hoping to get some help. I'm going to try my best to explain it, but let me know if this makes no sense.
I have a series of buttons that Tween Position at the start of my menu scene loading. I want them to be flush with the edge of the screen upon completion of the Tween. This is what I did:
1. Anchored the button to the outside edge of the screen
2. Run a "setup" method in Awake() that does the following for each Tween:
playButtonTween.SetStartToCurrentValue();
playButtonTween.to = new Vector3(playButtonSprite.transform.localPosition.x - playButtonSprite.localSize.x,
playButtonSprite.transform.localPosition.y,
playButtonSprite.transform.localPosition.z);
This effectively tells the Button to only tween based off its current length.
3. Run the tween in a coroutine from Start().
Now, here is my issue. If this is the first scene I run, it works like a charm. The buttons move and the tweens get the proper values loaded.
However, if I have another scene (like a custom splash screen) load first, then load the scene with the above code, it doesn't work. The tweens use whatever resolution the scene was last saved at for the positions that they load to determine the from/to in the tween.
This means that if I last saved my scene in a higher resolution (say a width of 1080), but then try and test in a lower resolution (width of 800), the Tweens still get edited as though they are using the position for 1080, meaning that when they tween in, they go too far.
Hopeful my description makes sense. Any help that could be provided would be greatly appreciated.
Thank you,
Shawn