Jump to content

  • Log In with Google      Sign In   
  • Create Account


Unity save game


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 rpiller   Members   -  Reputation: 657

Like
0Likes
Like

Posted 22 January 2014 - 05:53 AM

I know the technical ways to save a game, but I'm more wondering when/how, in Unity, would you save game data about so many different entities when each has their own script that controls it. Also about dynamic objects that are created at run-time.

 

I've seen people make a save game script, but how is that script going to know what entities it needs to save? Making parameters that you have to pass everything you want to save from the editor into doesn't seem like a very good way to do this. At some level it almost seems like you'd want to inform every script/game object to save itself when, say, the same button is pressed. Any ideas around this?



Sponsor:

#2 Yourself   Crossbones+   -  Reputation: 1045

Like
0Likes
Like

Posted 22 January 2014 - 07:33 AM

You could create a class called that derives Monobehaviour and has virtual functions to save/load to a file.

Now let all your object derive from that class and when you want to save/load use FindObjectOfType to get all objects that derive from that class.



#3 rpiller   Members   -  Reputation: 657

Like
0Likes
Like

Posted 23 January 2014 - 09:09 AM

I'll give that a go. Thanks!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS