I am wondering if it is possible to save that into playerprefs. So far i have been unable to work out a way to get it to work. I don’t think it is possible from reading some documentation and browsing the internet, but before i give up hope and try to work out a new way to do it I thought that i would ask. thanks!
ah okay, thank you @hamsterbytedev Basically i have 3 arrays set up that handle the fish per second upgrades, costs and count of upgrades. Then I use the GetFishPerSec function to calculate how many it is getting per second. Everything else is saving just fine, but I am having issues getting the saving and loading of the fish per second. I will lay around with that suggestion and see if i can get it working correctly. Appreciate the response, hope your having a good day!
You can’t assign to a method. You must assign to a variable. Also, don’t use capital letters in your playerprefs. It will cause issues on certain Android devices.
Technically speaking you can do this, either with reflection or via serialising a delegate. From your post history both of these techniques are beyond your abilities at the moment.
But from reading you follow up posts, this is not actually what you want to do. I’d strongly suggest abandoning the game for a short time, and go read up on the basics of programming. Do all of the videos in the scripting section again. Focus in on the different types. Read through the yellow book. That sort of thing.
I assumed that he didn’t want to save the method to PlayerPrefs. I’ve never run into an application where I would want to do this or had to do this. Curiously, I have to wonder if you have ever encountered a situation where you needed to save a method in the way that he is suggesting?
Most users that would want to do this would be beyond player prefs, saving the data in another file format. But I could imagine some mod systems needing to save methods as strings. Things get pretty hairy when you try and load and run code at runtime that wasn’t part of the original build.
Yeah, I can see that as I’m working on a developer console right now. I’m parsing data from an input field into pertinent methods and arguments; tying the whole thing together with reflection. It is definitely hairy and not something I would suggest a novice try and dive into.
i completely agree with you there, I just keep having fancial issues coming up or i would have allready had my class going. hoping to be able to get it up and started soon though. Also I was actually going to send you a PM and ask if the coding and scripting videos unity published were good or not. Thanks for letting me know I will go back through from the begining and watch them all over again. I have watched many of them all ready but the refresher and repeated info can only help me learn it better. thank you again for all the help.