local ZUINoticeText = {}

function ZUINoticeText.NoticeInfo(noticeInfo)
    print("ZUINoticeText.NoticeInfo -> ", noticeInfo)

    local luaRootGameObject = ZUINoticeText.luaRoot
    local prefabGameObject  = ZUINoticeText.rootPanel
    local textConnect       = ZUINoticeText.rootPanel.transform:Find("Text").gameObject
    ZUINoticeText.rootPanel:GetComponent("Text").text = noticeInfo
    textConnect.transform:GetComponent("Text").text = noticeInfo
    local actionSequence = CS.DG.Tweening.DOTween.Sequence()
    actionSequence:AppendInterval(0.5)
    actionSequence:Append(ZUINoticeText.rootPanel.transform:DOScale(CS.UnityEngine.Vector3(2.0, 2.0, 2.0), 0.3))
    actionSequence:Append(ZUINoticeText.rootPanel.transform:DOScale(CS.UnityEngine.Vector3(1.0, 1.0, 1.0), 0.01))
    actionSequence:Append(ZUINoticeText.rootPanel.transform:DOMoveY(1300, 0.35))
    actionSequence:AppendInterval(0.1)
    actionSequence:AppendCallback(
        function()
            CS.UnityEngine.GameObject.Destroy(luaRootGameObject)
	        CS.UnityEngine.GameObject.Destroy(prefabGameObject)
        end
    )
end

function ZUINoticeText.Awake(luaRoot)
    ZUINoticeText.luaRoot = luaRoot

	local canvas = CS.UnityEngine.GameObject.Find("Canvas")
	ZUINoticeText._rootCanvas = canvas

	local prefabPanel = LoadResource("Prefabs/UI/Public/ZUINoticeText.prefab")
	local rootPanel = CS.UnityEngine.GameObject.Instantiate(prefabPanel, ZUINoticeText._rootCanvas.transform)
    ZUINoticeText.rootPanel = rootPanel
end

function ZUINoticeText.Start(luaRoot)
end

function ZUINoticeText.OnDestroy()
    --!!! Don't Remove Anything Here. Because The DOTWeen Callback maybe has multi instance.
    --print("ZUINoticeText.OnDestroy ... ...")
end

return ZUINoticeText