diff options
author | chai <chaifix@163.com> | 2019-03-17 10:49:50 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-17 10:49:50 +0800 |
commit | ad2805aa839892589c13a615730da52f6e474709 (patch) | |
tree | f818bbacee347f8d64d9134ffe4fbda366ba87fe /Source/Samples/LuaxTest/script.lua | |
parent | fb830270c5269a22819a0c0f1ee280f9aa3f1b39 (diff) |
*luax
Diffstat (limited to 'Source/Samples/LuaxTest/script.lua')
-rw-r--r-- | Source/Samples/LuaxTest/script.lua | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/Samples/LuaxTest/script.lua b/Source/Samples/LuaxTest/script.lua index 32bd8e8..97890c0 100644 --- a/Source/Samples/LuaxTest/script.lua +++ b/Source/Samples/LuaxTest/script.lua @@ -63,7 +63,24 @@ function main() return "kid:Write() 2" end ) print(kid:Speak()) - + +------------------- plain class test + local Foo = Asura.Class("Foo") + Foo.Ctor = function(self, age, name, boy) + self.age = age + self.name = boy:GetName() + self.boy = boy + end + Foo.GetAge = function(self) + return self.age + end + Foo.GetName = function(self) + return self.name + end + local foo = Foo.New(10, "lee", kid) + print(foo:GetName()) + print(Foo.GetClassName()) + print(foo.boy:GetAge()) end function err(msg) print(msg) |