local Main = {}

-- function Main.Start(luaRoot)
--     print("Main.Start Called ~")
--     require("Base/UIHelper.lua"):OpenUI("UI/SUILoginPanel.lua")
-- end

print("main.lua Load start ... ... ")

local function LoadGlobalScript()
    require("Base/GlobalFunctions.lua")
    -- require("Logic/SPlayer.lua")
    -- require("Logic/SServerTime.lua")
end

function Main.Awake(luaRoot)

    CS.UnityEngine.Object.DontDestroyOnLoad(luaRoot)

    LoadGlobalScript()
    print("Main.Awake() Called ~")
    print("luaRoot.name -> " .. luaRoot.name)
    Main.luaRoot = luaRoot
end

function Main.Start(luaRoot)
    print("Main.Start Called ~")

    --CoroutineHelper.Test()
    require("Base/UIHelper.lua"):OpenUI("UI/SUILoginPanel.lua")

    -- SPlayer.Init()
    -- SServerTime.Init()
    -- require("Config/SConfigManager.lua"):Init()
    -- require("Network/NetworkManager.lua"):Init()
end

function Main.OnDestroy()
    -- require("Network/NetworkManager.lua"):UnInit()
    -- require("Config/SConfigManager.lua"):UnInit()
    -- SServerTime.UnInit()
    -- SPlayer.UnInit()

    print("Main.OnDestroy Called ~")
end

print("main.lua Load Finish ... ...")

return Main