Say I have tooltips, windows, or other components that will open / close during runtime (be it on hover, on click, etc.).
What are the best practices to do so?
Ideally, my objectives are:
- The GameObject would stay Active so it can be interacted with properly without an update frame.
- The widget would be visible (active, enabled, and alpha 1) while in the editor, but not by default while playing.
- The colliders would stop to work when the widget is hidden (I'm guessing alpha 0 on the parent won't work for this).
- Tweens could be used (like a tween alpha) for a smooth transition.
Is that possible? If so, how?
For sake of asking a clearer question, how would I fill, for example, this code:
public class TogglableWidget : MonoBehaviour
{
public void Start()
{
// Probably hide it?
}
public void Open()
{
// Make it visible and functional.
}
public void Close()
{
// Make it invisible and eventless.
}
}