I'm getting numerous null references from instantiated prefabs referencing each other so I would like to do a 2nd load pass, as suggested in other threads. I'm using the code below to load. How can I detect when this first load is finished?
Ok good to know, however my scene takes about 10 seconds to load because it's huge and not fully optimized yet. Would two load commands still fully process in this scenario?
I'm having a similar issue, but I'm using AutoSave. It's set to load the scene in the Awake() function, but when I try to access the object's it's loading in the Start() function, I see they have not been instantiated yet. This doesn't happen often, maybe 1 in 10 times, but since my code checks to see if the objects exist and then creates them from scratch if they don't this is causing all of my saved data to be reset with default data at random intervals.
Is there a way to check to see if the AutoSave load is done? Or wait until it is? I mean, I can check to see if my GameObject is null, but I'm looking for a best practice here.
Currently, I plan on checking if the object is null, and if it is, checking to see if there's a save file. If there is, we can assume it hasn't finished loading. If there isn't, then we can assume this is the first run or the player deleted the file to reset the game.
As mentioned above, Easy Save works synchronously (unless you call it from your own thread), so it's done immediately after it's called. As all Awake() methods are called before any Start() methods, it would indicate that the issue isn't to do with timing but something else.
So I wasn't sure if Start could run before all of Awake finished, I thought it would go as soon as Awake finished initiating commands. Good to know.
It appears that somewhere, sometime, it's saving after my data structure has destroyed the object, so it's not saving any data, then the next time there's no data to load.
At least, that's what I think is happening, because every time it happens I look at the save file and it's missing that chunk. I'll research it more. But it's hard to trace because it doesn't happen every time.