The goal:
- Display the content of Dictionary while OnGUI
- Retain the ability to modify spoken dictionary i.e. like simple, primitive GUI<->DB chain
Now, the 1)
isnt hard, just iterate and display GUI elements, as best as it gets here. However, the 2)
makes it trickier. The best solution I came up with is:
public void OnGUI
{
foreach (Type object in new List<type>(Dictionary.Keys))
{
//lots of great stuff, including Dictionary removal/adding
}
}
Now, here is the BIG PROBLEM:
*OnGUI implementation might be called several times per frame*
which essentially means what it means - I allocate new List<>
bunch of time per frame. Now, doing a simple math it looks scary per minute at X frames. Go up to a hour and it is insane.
The things is I’m limited to OnGUI
for now. Any ideas how this issue can be tackled?