I have a C++ type that I don't want to instantiate from scripts and only use as handles, preferably by passing it to the constructor for script classes that should be able to interact with it.
I followed the documentation and used asOBJ_NOCOUNT and did not provide a factory behavior. Actually, this is all I did (never mind the wrapper):
engine.register_object_type("Scene", 0, asOBJ_REF | asOBJ_NOCOUNT);
engine.register_object_method("Scene", "const string &name() const", asMETHODPR(scene::Scene, name, () const, const std::string&));
When I try to load a script that looks like this:
class Scene_test
{
Scene_test(Scene@ scene)
{
scene_ = scene;
}
void on_scene_loaded()
{
print("Hello World");
}
Scene@ scene_;
};
I get an error stating "Identifier 'Scene' is not a data type".
Any idea what I'm missing?