How to get variables from twig-template in my Subscriber class?

Hi!
I can set variable for twig-template in my Subscriber class via $event->getPage()->assign([……]) and it works.
But, how I can get variables from twig-template in my Subscriber class? In Shopware 5 it was getAssign(‘myVar’), but in Shopware 6 I didn’t see it.
Thanks a lot!