I want to make a cache system for my game in order to reuse effects assets.
I have an idea of having an idol
which properties will be cloned. After I will cache my needed object and it’s properties being set to the idol’s properties. The only way I came up with is to have a table with it’s properties names as index and its properties values as an value and then in for _, v loop
set the properties when i cache something. But I don’t think it’s quite optimized.
Is there any better way at doing such thing?