Hi,
Is there any way to do or similiar in Angelscript or C++ outside the RegisterObject (bottom part)? The example class is added through a register factory. The class is made as a template that it is registered into the system by a class that registers it.
Vivienne
I declared access to a component as such
RegisterComponent<GameAssetEngineLight>(engine, "GameAssetEngineLight");
engine->RegisterObjectType("GameAssetEngineLight",0, asOBJ_REF);
// Passed Urho3D parameters
engine->RegisterObjectMethod("GameAssetEngineLight", "void SetLightType(LightType SetLight)", asMETHOD(GameAssetEngineLight, SetLightType), asCALL_THISCALL);
engine->RegisterObjectMethod("GameAssetEngineLight", "void SetBrightness(float SetBright)", asMETHOD(GameAssetEngineLight, SetBrightness), asCALL_THISCALL);
Code in StaticModel.CPP
URHO3D_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Model", GetModelAttr, SetModelAttr, ResourceRef, ResourceRef(Model::GetTypeStatic()), AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Material", GetMaterialsAttr, SetMaterialsAttr, ResourceRefList, ResourceRefList(Material::GetTypeStatic()),
AM_DEFAULT);
URHO3D_ATTRIBUTE("Is Occluder", bool, occluder_, false, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Can Be Occluded", IsOccludee, SetOccludee, bool, true, AM_DEFAULT);
URHO3D_ATTRIBUTE("Cast Shadows", bool, castShadows_, false, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Draw Distance", GetDrawDistance, SetDrawDistance, float, 0.0f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("Shadow Distance", GetShadowDistance, SetShadowDistance, float, 0.0f, AM_DEFAULT);
URHO3D_ACCESSOR_ATTRIBUTE("LOD Bias", GetLodBias, SetLodBias, float, 1.0f, AM_DEFAULT);
URHO3D_COPY_BASE_ATTRIBUTES(Drawable);
URHO3D_ATTRIBUTE("Occlusion LOD Level", int, occlusionLodLevel_, M_MAX_UNSIGNED, AM_DEFAULT);