Hey everyone,
I am currently having a very irritating issue.
I am in the midst of creating a clicking/idle game and I have a script which has some functions and variables. One of these variables - being the cost seems to change to 0 when I run the function to buy something.
As I have about 5 scripts which are - I feel too long to post here and I cannot seem to pinpoint it so a single/ a couple of scripts I will post the entire project.
All/any help would be greatly appreciated.
In the project currently, I have a scrollview and content etc and within there I have a single button which I am using to test and diagnose this issue.
This is what attaching the debugger is for, put a breakpoint anywhere the variable is modified, and watch for when it’s modified to be 0… you’ll know who called it then.
This is also a place where encapsulation comes in use for debugging, public fields allow your code to modify the value anywhere. Encapsulated fields control who has access, and you can put the breakpoint in one place (as well as deal with strange incoming values for the field… like setting it 0 when it shouldn’t).
And no, most of us won’t download your entire project off of zippyshare (I don’t even know what zippyshare is… and the unity website has a built in uploader to share files with… nevermind who the heck wants to open your entire project for this problem!? We’re not here to do all your work for you, we’re here to offer help and guidance).
Agreed, I probably would not be having such an issue if I did not set everything to public, it is sheer lack of experience with doing so. I will look further into such things. Also I had Debug.Log’s in place before I removed them so I could check other things.
I appear to of offended you… the unity uploader only allows 4MB. But yes I do understand that no-one would want to download an entire project.