local Main = {}

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

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

local function LoadGlobalScript()
    require("Base/GlobalFunctions.lua")
    require("Sharedefine/GameDefine.lua")
    require("Logic/ZPlayer.lua")
    require("Logic/ZConference.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 ~")

    require("Base/UIHelper.lua"):OpenUI("UI/EnterMeeting/ZUIPanelEnterMeeting.lua")

    ZPlayer:Init()
    ZConference:Init()
    -- SServerTime.Init()
    require("Config/ZConfigManager.lua"):Init()
    require("Network/NetworkManager.lua"):Init()
end

function Main.OnDestroy()
    require("Network/NetworkManager.lua"):UnInit()
    require("Config/ZConfigManager.lua"):UnInit()
    -- SServerTime.UnInit()
    ZConference:UnInit()
    ZPlayer:UnInit()

    print("Main.OnDestroy Called ~")
end

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

return Main