- Home /
Question by
LocalNoob · Jul 28, 2017 at 06:32 PM ·
gameobjectdictionaryinventory systempersistence
How to get items(my custom class) by a custom id I paired them to?
I got a list of ids(strings) in my save file. And I got many items prefabs(each has unique id). I wanna get an item corresponding to its id.
I was thinkin of addin a dictionary to my gameManager(singleton) with ids(Strings) and items corresponding to it but it will be pretty fat...Is there any better way?
Comment
Answer by LocalNoob · Jul 28, 2017 at 07:13 PM
I used a list with ids...But any answers will still be apreciated
Your answer
![](https://koobas.hobune.stream/wayback/20220612131418im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Allocating Game Object name dynamically using Find 0 Answers
[Probably an easy question]Troubles saving my GameObject through scenes 1 Answer
Runtime instantiation based on XML 1 Answer
Is it safe to use GameObject as a Dictionary key? 1 Answer
Dictionary with GameObject as key is updating values under other keys 1 Answer