- Home /
Finding a Specific item in a list?
So I have the contents of the inventory stored in a list, and I need to check if the inventory contains a certain Item.
I looked at using List.Find but, being fairly new to scripting, the explanations I've read flew straight over my head. It mentions Predicates and Lambda expressions, which I don't know or understand whatsoever.
Can anyone either explain how to use list.Find, or offer an alternative?
Thanks :)
Answer by Eric5h5 · Jul 01, 2013 at 01:41 AM
Use List.Contains.
Well, that seems to be exactly what i wanted! I don't know how I didn't come across it in my google searches... Thanks though!
Your answer
Follow this Question
Related Questions
inventory system: drop item with mouseclick 1 Answer
how to detect wich item i have in my inevntory 0 Answers
Search for an object by name null reference exception 1 Answer
Stackable Inventory Item 1 Answer
DontDestroyOnLoad make errors 0 Answers