Skip to main content
21 events
when toggle format what by license comment
Jan 28, 2022 at 5:12 comment added starikcetin @DanielSunYang My suggestion would be to start with singletons as they are easy to use. With time you will see the damage to architecture they do and start looking for better options such as DI. For simple games, however, they will suffice.
Jan 28, 2022 at 0:55 comment added Sunwoo Yang It's crazy how even with this amazing answer, I'm still confused as to which route I should go. PlayerPref seems most simple to get started with, and I guess I don't really care too much if people decide to cheat in my game.
Jul 24, 2021 at 11:37 history edited starikcetin CC BY-SA 4.0
deleted 496 characters in body
Feb 15, 2021 at 18:18 comment added user3345048 It's also possible to mix those solution together such as having a static function (no instance in the game) to save onto a file. In general, PlayerPrefs is better for publicly accessible data (which is usually the options settings), but it comes with restriction on the amount of data you can store into a single variable (since it's hardware-locked to 256bits per variable stored). Using a file allows you to save a many thing as you need, but comes with both slower read (disk-read) and edit. It's good to save characters data. DontDestroyOnLoad() is good for holding temporary data between scene
Jan 11, 2021 at 16:53 comment added ineedahero Fantastic answer. Personally I believe you shouldn't write to a file unless the user explicitly hits a save button (or updates a setting). I like the simplicity of the first option, and would recommend that to anyone starting out.
Jun 16, 2020 at 10:15 history edited CommunityBot
Commonmark migration
Jan 10, 2019 at 21:11 history edited starikcetin CC BY-SA 4.0
added 377 characters in body
Feb 20, 2018 at 9:51 history edited starikcetin CC BY-SA 3.0
edited body
Feb 8, 2018 at 22:14 vote accept Enrique Moreno Tent
Dec 3, 2017 at 13:41 history edited starikcetin CC BY-SA 3.0
added 88 characters in body
Dec 3, 2017 at 13:33 history edited starikcetin CC BY-SA 3.0
added singleton patten to the list.
Nov 9, 2017 at 17:56 history edited starikcetin CC BY-SA 3.0
added 23 characters in body
May 20, 2017 at 17:04 history edited starikcetin CC BY-SA 3.0
deleted 254 characters in body
S May 14, 2017 at 5:21 history edited Gnemlock CC BY-SA 3.0
Fixed grammar
S May 14, 2017 at 5:21 history suggested Cameron Skinner CC BY-SA 3.0
Fixed grammar
May 14, 2017 at 4:53 review Suggested edits
S May 14, 2017 at 5:21
Nov 7, 2015 at 18:47 history edited starikcetin CC BY-SA 3.0
added pros and cons; added 3 characters in body
Nov 7, 2015 at 17:00 history edited jhocking CC BY-SA 3.0
added 4 characters in body
Nov 7, 2015 at 16:50 history edited starikcetin CC BY-SA 3.0
example added
Nov 7, 2015 at 16:43 history edited starikcetin CC BY-SA 3.0
fixed a letter missing
Nov 7, 2015 at 16:29 history answered starikcetin CC BY-SA 3.0