Lazy lookup build

Would it not have been even better to call BuildLookup() from OnEnable()? That way the lookup could already be built by the time we call GetStat the first time.

ScriptableObjects don’t have an OnEnable callback.

The setup we have now is a form of Lazy Evaluation. As the dictionary is only built once, in total, for all characters, there is very little performance hit.

Of course. I don’t know why I thought ScriptableObjects have OnEnabled. Thank you

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms