local DemoAll = {} local function OnClickBtnUINavigitor() require("Base/UIHelper.lua"):SwitchUI("CommonUtils/DemoLuaScripts/DemoUINavigator.lua", "CommonUtils/DemoLuaScripts/DemoAll.lua") end local function OnClickBtnProgressor() require("Base/UIHelper.lua"):SwitchUI("CommonUtils/DemoLuaScripts/DemoProgressor.lua", "CommonUtils/DemoLuaScripts/DemoAll.lua") end local function OnClickBtnRemoteReturn() require("Base/UIHelper.lua"):SwitchUI("CommonUtils/DemoLuaScripts/DemoRemoteReturn.lua", "CommonUtils/DemoLuaScripts/DemoAll.lua") end local function OnClickBtnToast() require("Base/UIHelper.lua"):SwitchUI("CommonUtils/DemoLuaScripts/DemoToast.lua", "CommonUtils/DemoLuaScripts/DemoAll.lua") end local function OnClickBtnMenu() require("Base/UIHelper.lua"):SwitchUI("CommonUtils/DemoLuaScripts/DemoMenu.lua", "CommonUtils/DemoLuaScripts/DemoAll.lua") end local function OnClickBtnPage() require("Base/UIHelper.lua"):SwitchUI("CommonUtils/DemoLuaScripts/DemoPage.lua", "CommonUtils/DemoLuaScripts/DemoAll.lua") end local function OnClickBtnPagePoster() require("Base/UIHelper.lua"):SwitchUI("CommonUtils/DemoLuaScripts/DemoPagePoster.lua", "CommonUtils/DemoLuaScripts/DemoAll.lua") end local function RegisterTouchEvent() local rootPanel = DemoAll.rootPanel local uiHelper = require('Base/UIHelper.lua') uiHelper:AddClickEvent(rootPanel, "Btn_UINavigitor", OnClickBtnUINavigitor) uiHelper:AddClickEvent(rootPanel, "Btn_Progressor", OnClickBtnProgressor) uiHelper:AddClickEvent(rootPanel, "Btn_RemoteReturn", OnClickBtnRemoteReturn) uiHelper:AddClickEvent(rootPanel, "Btn_Toast", OnClickBtnToast) uiHelper:AddClickEvent(rootPanel, "Btn_Menu", OnClickBtnMenu) uiHelper:AddClickEvent(rootPanel, "Btn_Page", OnClickBtnPage) uiHelper:AddClickEvent(rootPanel, "Btn_PagePoster", OnClickBtnPagePoster) end function DemoAll.Awake(luaRoot) DemoAll.luaRoot = luaRoot local canvas = CS.UnityEngine.GameObject.Find('Canvas') DemoAll._rootCanvas = canvas local prefabAllDemo = LoadResource('CommonUtils/Prefabs/Demo/ZDemoAllPanel.prefab') local rootPanel = CS.UnityEngine.GameObject.Instantiate(prefabAllDemo, canvas.transform) DemoAll.rootPanel = rootPanel end function DemoAll.Start() RegisterTouchEvent() end function DemoAll.OnDestroy() CS.UnityEngine.GameObject.Destroy(DemoAll.rootPanel) end return DemoAll