'UNITY - Instead of a script there is a blank notepad

About five minutes ago everything was working fine, but after I restarted my pc, one of the scripts in unity stopped working. Other scripts can't access its methods anymore and when I try to open it, I just get a blank Windows Notepad. The assembly information is also blank. Does anyone have an idea how to fix this issue?



Solution 1:[1]

Make sure visual studio is installed, then in unity go to Edit>Preferences>External Tools and then change "External Script Editor" to visual studio.

Solution 2:[2]

Go to the file in file explorer. There will be a temp file of the same name. It contains all your code. Open it and copy the code to the empty file and save it. You will be good to go.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Austin Weis
Solution 2 Hidayat Ullah Khan ZafarYab