Archive 17/01/2023.

[SOLVED](D’oh!)Big problem with events

Kanfor

Hi, urhofans.

I have a rare problem. I don’t know why but I can’t subscribe to new events in my new class.
I have scene, logicomponent, Ui, Uicomponent, etc.

The new class is a simple LogicComponent, but when I add SubscribeToEvent, it crash.

[code]using namespace Urho3D;

class Prueba : public LogicComponent {
URHO3D_OBJECT(Prueba, LogicComponent)
public:
Prueba(Context* context);
virtual ~Prueba();
private:
void Function();
};[/code]

[code]#include “Prueba.h”

Prueba::Prueba(Context* context) : LogicComponent(context)
{
SubscribeToEvent(E_SCENEUPDATE, URHO3D_HANDLER(Prueba, Function));
}

Prueba::~Prueba()
{
}

void Prueba::Function()
{

}[/code]

I think is all right. Please, help me :cry:

yushli

Function should be
Function(StringHash eventType, VariantMap& eventData)

Kanfor

ONE HOUR!!! :blush:

Thank you!