How to share/reuse a Lua script for multiple entities?
问题 I'm in the design/skeleton coding phase of my C++ game with Lua scripting, but I have run into a design issue: The game will have many copies of the same kind of entities, with behavior controlled by the same script. Is there a straightforward way I can share the script between entities of the same type in a single lua_state? I have only been able to find this question asked a couple of times on the Internet; I have read mixed feedback on whether or not it's a good idea to load the same