uTweenFinishEventLua.cs 809 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.Events;
  4. namespace uTools
  5. {
  6. public class uTweenFinishEventLua : MonoBehaviour
  7. {
  8. string m_callBack = "";
  9. uTweener tweener;
  10. void Awake()
  11. {
  12. tweener = GetComponent<uTweener>();
  13. }
  14. public void SetOnFinishCallBack(string callBack)
  15. {
  16. m_callBack = callBack;
  17. tweener.AddOnFinishEvent(OnFinish);
  18. }
  19. void OnFinish()
  20. {
  21. if (!string.IsNullOrEmpty(m_callBack))
  22. {
  23. //G.LuaManager.CallLuaFunction(m_callBack);
  24. }
  25. }
  26. public void RemoveOnFinishCallBack()
  27. {
  28. m_callBack = string.Empty;
  29. tweener.RemoveFinishEvent(OnFinish);
  30. }
  31. }
  32. }