luaclass
local NewClass = Inherit(Object)
Object is The most basic class.You can inherit another class:
local NewClassChild = Inherit(NewClass)
local Ins = NewClass:NewIns(...)
It will call parentclass's Ctor function firstly.Then call childclass's Ctor function.
... paramter will be passed to Ctor
Ins:Release(...)
It will call childclass's Destroy function firstly.Then call parentclass's Destroy function.
... paramter will be passed to Destroy
Ins:functionname(...)
It's will search childclass firstly,Then search parentclass.
if you want to call parent function to this ins:
ParentClass.functionname(Ins, ...)
allmost the same as pure lua class.
Difference:
local NewCppClass = Inherit(CppObjectBase)
instead:Class:NewOn(inscpp, ...)
Will search luafunction firstly then cppfunction.
Use the LuaCtor macro in c++.c++ call lua
Use the LuaCtor Node in Blueprint.bp call lua
After LuaCtor.A Lua ins will be created and represent the c++ ins in the Lua.
when you try to get the c++ ins in lua, you will get the Lua ins.
When you pass the Lua ins to c++, It will switch to the c++ ins.
Think about Blueprint,In Blueprint, The c++ ins switch to Bp ins.
When in c++, the Bp ins switch to c++ ins.
Lua class works like this.