Skip to content

C# method override in Lua #102

@na2axl

Description

@na2axl

NeoLua Version: 5.3 (Nuget 1.3.10)

Hi, I'm just starting to use NeoLua, which is pretty good, and I fall into an issue... I want to know if it's possible to override a virtual method defined in C# from Lua.

I've tried to do like this

Component = clr.AlienEngine.Core.Gaming.LuaComponent;
cmp = Component();

cmp.Update = function()
    print "Updated";
end;

where LuaComponent is just a proxy of the abstract Component class for the use in lua code.

When I want to execute this code, I got the error 'LuaComponent:Update' is not writable.

I've also tried to do:

Component = clr.AlienEngine.Core.Gaming.LuaComponent;
cmp = Component();

function cmp:Update()
    print "Updated";
end;

and I got the error No conversion defined from LuaComponent to LuaTable.

So please I want to know if it's possible or if there is another way to achieve this goal.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions