Is there any way to change the access to my C# object methods in Lua by turning two dots into one? I want to change this:
Object:DoSomething();
Into this:
Object.DoSomething();
Without getting any errors. Any ideas? Thanks in advance.
Is there any way to change the access to my C# object methods in Lua by turning two dots into one? I want to change this:
Object:DoSomething();
Into this:
Object.DoSomething();
Without getting any errors. Any ideas? Thanks in advance.
The two lines do different things. Object:DoSomething()
is syntax sugar for Object.DoSomething(Object)
. It's what turns a regular object lookup+function call into a method call.
So no, there's no way to do this.
No. Here's an alternative...
You can consider Object:DoSomething()
to be a .NET extension method. Just like a .NET extension method, you can choose to call it like the "static" method it is:
Object.DoSomething(Object);