Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Script Files keep turning into text files because of singletons

Discussion in 'Editor & General Support' started by slowDrag0n, Mar 30, 2020.

  1. slowDrag0n

    slowDrag0n

    Joined:
    Oct 10, 2017
    Posts:
    41
    I have two singleton classes in my project. And a few scripts that reference the static instance of these singletons. The problem is, unity randomly keeps screwing up the script files of either the singletons themselves or any script that has a reference to them. By screwing i mean it just stops recognizing the files as script files. And inside Unity they just appear as a text file with white icon instead of script file. Double clicking the file opens it up in a simple text editor(eg np++) instead of the IDE. The whole project starts giving red lights because for the other scripts, these files don't exist anymore.

    I had no idea what on earth was going on and after hours of looking and failing to find any solution to this particular problem on the net, out of nowhere (maybe because of the fits of frustrations that i was going thru), i right click the file and hit 'Reimport'. This surprisingly solved the issue with the files. BUT THIS JUST KEEPS HAPPENING OVER AND OVER AGAIN AT RANDOM TIMES WITH RANDOM FILES and i have to go through the jump scare of sudden red lights everywhere, process of finding which files got screwed, waiting times of compiling after reimporting these files, over and over again.

    Please fix.

    Best Regards,
    firsttry21

    P.S.
    Unity 2018.4.20f1
    Visual Studio Community 2019
     
  2. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,231
    Sounds a bit like issues I was having - see new post in this forum.
    Unity 2018 LTS seems to have developed bugs in recognising changes to file which can lead to them no longer appearing as C# files or just the whole damn editor crashing!! Not good for an LTS branch!
    Or Unity community - which I also use
     
  3. slowDrag0n

    slowDrag0n

    Joined:
    Oct 10, 2017
    Posts:
    41
    for some reason it seems like its just us two. i saw u posted a similar bug yesterday and that thread too got no reply that may help towards solving the problem from community or the devs
     
  4. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,231
    Have you any Visual Studio plugins? Line endings unifier?
     
  5. slowDrag0n

    slowDrag0n

    Joined:
    Oct 10, 2017
    Posts:
    41
    nope its out-of-box vs2019 setup that comes with unity