Serializable Dictionary

Hey, i found some serializable Dictionary at the web… but now I want hardcode the Dictionary for example with string as key and int as value… but what is the third value (“TValueStorage”)…?

TKey is string and TValue is int…

original Code: https://paste.myst.rs/4bk

and my Code… but it doesn’t work -.-

Hi Graui,

Welcome to our community! :slight_smile:

For which course project is that code and what does “it doesn’t work” mean? Does your computer freeze when you run that code?

I want to create a LevelManager for the rpg game… So i want to create a Serializeable Dictionary, so a Costum Editor can handle all Scenes in this Build… But this Code doesn’t compile…

The 2nd code appears to be more of an edit of the first code than inheriting from the first code.
The first bit of code uses generics to accomplish it’s task, but it’s also abstract, meaning it can’t actually be implemented as is… Unfortunately, whatever trick they’re using has left me a bit scratching my head as to how they’re accomplishing what they’re doing, I believe because I don’t have all of the instructions. As I have no idea where the code comes from, I don’t know who to ask for more clarification.

What are you looking for your LevelManager to accomplish? A SerializableDictionary may not even be the right approach for the task.

  • What information does the LevelManager need to keep track of?
  • What will the Custom Editor be handling?

This topic was automatically closed after 5 days. New replies are no longer allowed.

Privacy & Terms