ZUITextNotice.lua.txt 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. local ZUINoticeText = {}
  2. function ZUINoticeText.NoticeInfo(noticeInfo)
  3. print("ZUINoticeText.NoticeInfo -> ", noticeInfo)
  4. local luaRootGameObject = ZUINoticeText.luaRoot
  5. local prefabGameObject = ZUINoticeText.rootPanel
  6. local textConnect = ZUINoticeText.rootPanel.transform:Find("Text").gameObject
  7. ZUINoticeText.rootPanel:GetComponent("Text").text = noticeInfo
  8. textConnect.transform:GetComponent("Text").text = noticeInfo
  9. local actionSequence = CS.DG.Tweening.DOTween.Sequence()
  10. actionSequence:AppendInterval(0.5)
  11. actionSequence:Append(ZUINoticeText.rootPanel.transform:DOScale(CS.UnityEngine.Vector3(2.0, 2.0, 2.0), 0.3))
  12. actionSequence:Append(ZUINoticeText.rootPanel.transform:DOScale(CS.UnityEngine.Vector3(1.0, 1.0, 1.0), 0.01))
  13. actionSequence:Append(ZUINoticeText.rootPanel.transform:DOMoveY(1300, 0.35))
  14. actionSequence:AppendInterval(0.1)
  15. actionSequence:AppendCallback(
  16. function()
  17. CS.UnityEngine.GameObject.Destroy(luaRootGameObject)
  18. CS.UnityEngine.GameObject.Destroy(prefabGameObject)
  19. end
  20. )
  21. end
  22. function ZUINoticeText.Awake(luaRoot)
  23. ZUINoticeText.luaRoot = luaRoot
  24. local canvas = CS.UnityEngine.GameObject.Find("Canvas")
  25. ZUINoticeText._rootCanvas = canvas
  26. local prefabPanel = LoadResource("Prefabs/UI/Public/ZUINoticeText.prefab")
  27. local rootPanel = CS.UnityEngine.GameObject.Instantiate(prefabPanel, ZUINoticeText._rootCanvas.transform)
  28. ZUINoticeText.rootPanel = rootPanel
  29. end
  30. function ZUINoticeText.Start(luaRoot)
  31. end
  32. function ZUINoticeText.OnDestroy()
  33. --!!! Don't Remove Anything Here. Because The DOTWeen Callback maybe has multi instance.
  34. --print("ZUINoticeText.OnDestroy ... ...")
  35. end
  36. return ZUINoticeText