Hello!
I’m trying to make a derivative object based on Urho3D::Component to be replicated over network.
How I do that is the following:
class RefFrame: public Urho3D::Component
{
URHO3D_OBJECT( RefFrame, Component )
public:
/// Register object factory.
static void RegisterObject( Context * context);
RefFrame( Context * ctx, const String & name=String() );
virtual ~RefFrame();
void setName( const String & name );
...
void RefFrame::RegisterObject( Context * context )
{
context->RegisterFactory<RefFrame>();
URHO3D_COPY_BASE_ATTRIBUTES( Component );
URHO3D_ATTRIBUTE( "Name", String, name_, "", AM_DEFAULT );
}
And when I create the “ RefFrame ” component as either Scene::CreateComponent<RefFrame>( REPLICATED ) or Node::CreateComponent<RefFrame>( REPLICATED ) it is created. But there is no reaction on component attributes change.
Even when I explicitly call “ MarkNetworkUpdate() ” nothing happens. Inside “ MarkNetworkUpdate() ” the “ networkUpdate_ ” field is always “ true ”.
And Component::PrepareNetworkUpdate() for this component is called only once and exits because of “ networkState_->attributes_ ” is NULL .
What do I miss here?