jacobdufault / fullinspector

Full Inspector supercharges Unity's inspector
MIT License
111 stars 27 forks source link

Multiple fiBackupSceneStorage objects being created in scenes. #149

Closed FodderMK closed 8 years ago

FodderMK commented 8 years ago

Some changes in recent Unity patches have caused the following error to occur far mare than it used to:

The referenced script on this Behaviour (Game Object 'fiBackupSceneStorage') is missing!

I see the following message several times whenever I resolve all compiler errors in the Unity editor and Unity finishes recompiling all the scripts:

CheckConsistency: GameObject does not reference component MonoBehaviour. Fixing.

Once that occurs I know I'm going to start seeing one more "referenced script" error when I run the scene. Using the "View all scene gameobjects" tool I can see there are multiple "fiBackupSceneStorage" objects, one with the "fiStorageComponent" script and the rest with a missing component.

It looks like a new "fiStorageComponent" object is created each time all compile errors get resolved. I don't recall Full Inspector behaving this way before so I suspect it has something to do with changes in one of the patched releases and that this behavior will eventually make its way into the main branch. Currently I'm using Unity 5.3.5f5 and Full Inspector 2.6.3 .

jacobdufault commented 8 years ago

Okay, I'll take a look at this early next week. I might have to just disable the scene storage all together and figure out a different approach.

aitchest-of-dees commented 8 years ago

I'm getting loads of these errors as well. I went so far as to remove FullInspector from my project, but I was still seeing them. It turns out these invisible objects some how got saved with a bunch of my scenes, and I had to use an editor script to reveal them so I could delete them -- figuring all that out took the better part of an afternoon. I would vote for trying another approach.

jacobdufault commented 8 years ago

I've modified the script so the empty/null behaviors are automatically cleaned up. Please try out the new build from access and let me know if it works. Thanks!

FodderMK commented 8 years ago

Using build "FullInspector-2.6.4 (07-07-2016 at 2122PM)" I'm seeing this problem more than ever. Maybe it was my steps?

Now whenever I load my scene it gets two objects with missing scripts, fiPersistentEditorStorage and fiBackupSceneStorage. If I delete those objects from my scene, save, then reload the scene the objects come back and with missing scripts.

aitchest-of-dees commented 8 years ago

@FodderMK The invisible objects are saved in your scenes.

In order to see them, you need to put this script in Assets/Editor. Then you'll see a new menu in the Unity Editor: Tools -> HiddenObjectExplorer.

This opens a window showing all the objects in your scene and their hidden flags. It is very important that you not mess with SceneLight, SceneCamera, PreRenderLight, PreRenderCamera, HandlesGO or anything else that are Unity generated.

The objects you are looking for are fiPersistentEditorStorage and fiBackupSceneStorage. You can unhide these, then manually delete them in your Hierarchy and save the scene. Note they may be in multiple scenes, so check them all.

FodderMK commented 8 years ago

Yes, that's what I meant with "Delete all references to those prefabs in my scene". I use the Hidden Object explorer to find the "fi*" objects and remove them.

FodderMK commented 8 years ago

To be clear, if I delete the objects then save and run my scene I do not get any errors. I then reload the scene by double-clicking on the scene file and the objects are back.

FodderMK commented 8 years ago

Instead of deleting the fi objects in my scene I have removed the dead script references. I no longer get the errors after reloading the scene, though the scripts do not get reattached. It seems that deleting the objects with the tool under "Window -- Full Inspector -- Developer -- View All Scene GameObjects" doesn't permanently delete them? Because now when I delete the objects with no scripts and save/reload the scene they appear again as if they were never deleted.

aitchest-of-dees commented 8 years ago

I misunderstood, I thought you had completely removed FullInspector. I haven't tried the modified script @jacobdufault posted yet.

jacobdufault commented 8 years ago

The FI script to remove the dead instances will not run if you have removed Full Inspector. If you have a lot of these scripts, it may take a little while for them all to get cleaned out as only one is cleared per script reload (ie, enter/exit play mode).

FodderMK commented 8 years ago

I'm sorry for not being clear in the steps I took, but to reiterate:

1) I removed the old version of FullInspector 2) I installed the new version of FullInspector 3) I tried to clean out old references to fi objects. 4) I am still seeing this problem.