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.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement