- Home /
How to fix lost references?
Hi,
I had a weird thing happening to my project. I imported the OneSignal lib, then moved it to the plugins folder, because it couldn't be referenced by a plugin and now I have lost in a project over +1000 references. Is there any way to bring the referencing back? It will be impossible or either very time to consume to go through all referencing again.
Answer by madks13 · Aug 06, 2018 at 11:04 AM
I'm not sure what the references you are talking about are. An imported lib only has a few references and they are to the projects inside a solution. As far as i've seen, Unity generaly creates 2 types of projects. One for runtime scripts, one for Editor scripts. All scripts referencing the library use Namespaces and class names. If your projects references the library, your scripts should be able to find the library.
The first thing to do is check in your project if it references the library. Check also that the library path is the same as the new one. If not, that is your problem. If you still have reference errors, i suggest you reboot your Editors (both Unity and the IDE you use for script editing). Unity is supposed to automatically add the references to managed libraries it finds inside the asset folders, so i think there might be a cache problem.
It's not the library references that disappeared. All of the references, from scripts in CO$$anonymous$$PONENTS (in every component) in the whole project. Total disaster.
Ah, i understand. Though, did they totally disappear or does it say it can't find the scripts? Also, do you have any way of reverting the change?
The scripts are showing but the actual values in them disappeared. I cannot revert the changes. This kind of stuff makes me want to switch the engine...
Answer by DevOnline · Apr 18, 2021 at 07:38 PM
@kaplica, it's insane. I've just had the same issue in 2019.3.14. I have build a project in VS2019. Then Unity Editor was reporting some incorrect assemblies pointing to non-existent code that was commented out. I've exited Unity, started again.... No compiler errors but ALL references to scripts, fonts, sprites etc are gone. I tried to diff the difference but it's a massive scene so I can't quite make sense of the change. It scares me a lot.
Your answer
