using UnityEngine;
using System.Collections;
using UnityEngine.Events;

namespace uTools
{
    public class uTweenFinishEventLua : MonoBehaviour
    {
        string m_callBack = "";

        uTweener tweener;

        void Awake()
        {
            tweener = GetComponent<uTweener>();
        }

        public void SetOnFinishCallBack(string callBack)
        {
            m_callBack = callBack;
            tweener.AddOnFinishEvent(OnFinish);
        }

        void OnFinish()
        {
            if (!string.IsNullOrEmpty(m_callBack))
            {
                //G.LuaManager.CallLuaFunction(m_callBack);
            }
        }

        public void RemoveOnFinishCallBack()
        {
            m_callBack = string.Empty;
            tweener.RemoveFinishEvent(OnFinish);
        }
    }
}