I have scoured and searched the forums and the internet in general to a possible solution to my issue, but as of now can’t seem to figure out something that works.
I currently have two seperate game project templates, one is a slot machine, and one is a wheel spin type game, that I have combined into one scene. I have got it so both are able to work independently of each other, which obviously won’t be the end result, but is what I am needing at this stage as I figure things out, but each has its own current coin value which are being set, changed, and displayed by each game’s own manager type script.
I am wanting make it so that instead of two separate current values, both would appear to use and affect just the slot total instead. I figure I could try to go through everything and change everything, but was hoping there was a much easier way that wouldn’t be so time consuming. I don’t know if it’s even possible, but was wondering if there would be a way to either change the manager type scripts or create a new coin value type script which would basically act as a score manager of sorts and make it so that both games would affect one game’s current value.
For example, if the slot game has the script SlotManager which has the starting value defined as “public int SlotStart = 10,000;” and then the current value after any losses or wins defined as “public int SlotCurrent;” and then the spin game has the script SpinManager which has its starting value defined as “public int SpinStart = 25,000;” and its current value after any losses or wins defined as “public int SpinCurrent;”
As of now, I tried changing the SpinStart to “SpinStart = 0;” and was finally able to get it to reference the SlotStart definition inside the SpinManager script and set it so that SpinStart = SlotManager.reference.SlotStart which did seem to work and change the total being displayed for the spin game to match the starting total for the slot game when testing, however, when i tried to do the same thing for the SlotCurrent inside the SpinManager script, it doesn’t seem to work right or update when spinning the slots, nor can I get it so the total for the Slots changes if I spin the wheel. As I said before, I don’t even know if it’s possible, but I was wondering if it would work to somehow set it in either each games own manager script so that that game’s current value will equal the other’s current value, so that if either changes, it instantly changes on the other or if I could create a NewCoinValue script and have it do it, and then reference that in each game’s own script?
Sorry for the long explanation, but as you can tell, I am lost and quite confused and am betting it’s much simpler than I am making it, at least that’s the hope anyways. Thanks for any help you are willing to offer!