Hi there,
I’m not exactly too great with scripting at the moment and I was wondering if I could get some help with something. I have used a free achievement manager script and I have trimmed it down quite small to the bits which I only need. The script allows me to create an array of achievements and assign a Name(string), Description(string), Complete Icon(texture), Incomplete Icon(texture), Earned state(bool).
I have made the earned bool state public so that when I press it in the inspector, naturally the Incomplete Icon changes into the Complete Icon.
I want to be able to do the said function above but from another script and implement it on for example a mouse click. I have used AchievementManagerAll.Earned = true; from the other script (AchievementManagerAll being the achievement manager script) and this works, except it changes ALL the achievements to true instead of just the one. What I want to do is tell my other script to JUST to turn on the Earned state for 1 particular achievement in the array.
So I guess the question would be, how would I change a bool value of an array element from another script? Would I have to do something along the lines of AchievementManagerAll.Earned(“Test”, true); ? ← I know that’s wrong of course but you get the picture
I’ll provide screenshots below. All help greatly appreciated.
-Connor
[29294-array+2.png|29294]
[29293-array+1.png|29293]