how to reference scripts in other scenes unity

Code Example - how to reference scripts in other scenes unity

                
                        //you can use this to preserve scripts when loading new scene
DontDestroyOnLoad();