is there such a way to run a method in all scenes in unity without passing data from one screen to another? What I want to do is assume that I have a method which counts the time like stopwatch. When I open the game it starts counting on main screen like 1,2,3... and when I go another screen it should keep running the method and continue counting 4,5,6... and it should continue like this when I switch to other screens.
I thought that it can be done using a static variable in a script and using the same script in all scenes in a game object. But I wonder if there is an easier approach as I said in above like running one global method in all screens once game is launched.