| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- local Main = Main or {}
- print("main.lua run start ... ... ")
- function Main.Awake(luaRoot)
- print("Main.Awake() Called ~")
- print("luaRoot.name -> " .. luaRoot.name)
- end
- g_TestTable = {
- Awake = function()
- print("g_TestTable.Awake Called~")
- end,
- Start = function()
- print("g_TestTable.Start Called~")
- end
- }
- function Main.Start(luaRoot)
- print("Main.Start Called ~")
- print("luaRoot.name -> " .. luaRoot.name)
- local luaTest = CS.UnityEngine.GameObject("Lua_Test_g_TestTable")
- print("luaTest.name -> " .. luaTest.name)
- CS.SFramework.SLuaComponent.Add(luaTest, g_TestTable)
- print("-------------- Test require -------------")
- -- Test Update v1 Code
- local tExistedTab = require("start/existed.lua");
- tExistedTab.Test("this is a test info.")
- tExistedTab.ShowUI()
-
- -- Test Update v2 Code
- --[[local tExistedTab2 = require("start/existed2.lua")
- tExistedTab2.ShowUI()]]
- end
- function Main.OnDestroy()
- print("Main.OnDestroy Called ~")
- end
- print("main.lua run Finish ... ...")
- return Main
|