🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
How to use the same class in difference modules ?
A Module : had built class C ( use it in script )
B Module : had built class C ( use it in script )
I want to only build class C for only once.
A and B Module could use class C both :)
How to do it ?
Is AddScriptSection() set module parameter to NULL value ?
or some interfaces for setting it ?
thanks!!!
Building a module with the module name set to NULL is no different from a module with a name, except that it has no name.
If the same script class is declared in two different modules AngelScript will treat it as two different classes.
If you want to use one script class that can be accessed from both modules, you'll have to have it implement an interface that is registered from the engine so that both modules share it. Then you'll have to write a factory function for creating the script class instances that the modules can access.
If the same script class is declared in two different modules AngelScript will treat it as two different classes.
If you want to use one script class that can be accessed from both modules, you'll have to have it implement an interface that is registered from the engine so that both modules share it. Then you'll have to write a factory function for creating the script class instances that the modules can access.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement