How to create a list of names with a quantity value that can be added and removed in this case using the names of gameObjects that enter or exit a specific space?
For example a list of students entering and exiting a room, or the names and quantities of items entered into a bag/inventory.
Now iv looked at arrays, list, and dictionary. But I’m still not sure which to use and how to really use them. I know that Arrays are too limited, List might not be enough, and Dictionary might be too much. The issue is that im just not sure how to use them. I wonder of such a list can be created from scratch instead but hooowww. Like the method Mathf.Clamp which takes in 3 parameters puts them through 2 if statements. Also how do you look into Unity methods to see how the inner workings or is that ‘illegal’? I was able to find the body code of Mathf.Camp once but i dont think it was official document.
Additionally, Im wondering how should I structure it in the first place.
I was thinking should the names just be intergers in which their values can be changed?
int Ashley = 6;
int Sherry = 5;
Or should they be 2 values but associated with each other like a string and int?
string Jill, int 3;
string Claire, int 1;
Or maybe vector2s. But I think vectors need to have the same value type?
Vector2 = Ada, 2;
I am not a programmer. Im in the process figuring this out. The hard part is that im using a tablet and cant really test or experiment with anything with in Unity.