Hello
We are using multiple scene editing in our game so different devs can work on different parts. We really could do with being able to cross reference gameobjects that have certain scripts on them though and was wondering if anyone had any ideas for a solution?
Say I have a Task.cs script attached to a gameobject in “SceneA”. It has a property for another Task, let’s call it TargetTask. Now I can allow cross scene references in the editor with “preventCrossSceneReferences = false” and when I drag and drop a Task from “SceneB” onto TargetTask it’s assigned properly. What I’d like to do is somehow save this data and when the game runs properly it’s restored.
I understand why the reference doesn’t save so doing something like saving the name of the gameobject and restoring it from a name, or via a unique ID, would be fine. I’m just not sure how I go about doing that?
What complicates things a little is that I have a lot of different scripts inheriting from my base Task that will have other Task fields that need saving and I don’t want to have to write a serializeable class for every one. Is there a way to do it with a custom attribute like?
[SerializeAsString]
Task TargetTask;
Failing that, is there a way to tell when a GameObject is dropped onto the TargetTask field so I can grab the name of it and store that?
Any ideas?
Thanks!