xamarin / urho

Code to integrate with the Urho3D engine
Other
462 stars 122 forks source link

Missing methods #121

Closed skelar32 closed 8 years ago

skelar32 commented 8 years ago

There are missing methods in Node.cs to get user variables like in Urho3D/Scene/Node.h Variant& GetVar(StringHash key) and VariantMap& GetVars(). In UrhoSharp can only set them, no way to retrieve them.

Also methods Start, FixedUpdate, FixedPostUpdate and PostUpdate in UrhoD/Scene/LogicComponent.h are virtual, whereas in LogicComponent.cs they are not and it's impossible to override them.

migueldeicaza commented 8 years ago

You do not need to use LogicComponent as a base class like you do in C++.

Instead, you use the UserComponent class.

skelar32 commented 8 years ago

For some reason I can't use this UserComponent class, it says it couldn't be found, and I don't see it in project References/Urho (Only Component, LogicComponent, UnknownComponent).

EgorBo commented 8 years ago

@skelar32 actually it's just Component. You can override OnUpdate and OnAttachedToNode (Start). For GetVar and GetVars - it's a known issue.

skelar32 commented 8 years ago

But Component doesn't have FixedUpdade (for moving Rigidbodies) and PostUpdate. Anyway, I worked around it, though I would prefer to have these methods in the first place

EgorBo commented 8 years ago

@skelar32 FixedUpdate: physicsWorld.PhysicsPreStep += PostUpdate: scene.ScenePostUpdate +=

skelar32 commented 8 years ago

Yeah, I kind of had it done like this, but in a messy way (what was I thinking..). Thanks for pointing it out and yes, Component class is enough.

Still, the main reason I submitted issue was because of GetVar. That's how you would get variables that you can set in Editor, right? I'm still new with Urho so I may just be missing something

EgorBo commented 8 years ago

@skelar32 the latest UrhoSharp package contains LogicComponent with all needed events.

migueldeicaza commented 8 years ago

I am closing this based on the last comment.