Пример #1
0
    /// <summary>
    ///
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="go"></param>
    /// <param name="property">属性名称</param>
    /// <param name="duration">修改数据需要的时间</param>
    /// <param name="from">开始修改的数据</param>
    /// <param name="to">最后修改的数据</param>
    public static TweenProperty Begin <T>(GameObject go, Hashtable table) where T : MonoBehaviour
    {
        TweenProperty comp = UITweener.Begin <TweenProperty>(go, (float)table["duration"]);

        comp.Property = (string)table["property"];
        comp.From     = (float)table["from"];
        comp.To       = (float)table["to"];
        comp.Duration = (float)table["duration"];
        comp.Target   = go.GetComponent <T>();

        return(comp);
    }
Пример #2
0
    // Use this for initialization
    public void Init()
    {
        if (LuaToCSFunction.IsIphoneX())
        {
            Camera cam = AppConst.UIRoot.Find("Camera").GetComponent <Camera>();
            LuaToCSFunction.SetUICameraRect(cam, 0, 0.04f, 1, 0.92f);
        }
        ui = ObjectPoolManager.Instance.LoadObjectByName("Prefabs/Common/LoadingView", AppConst.UIRoot);
        ui.transform.localPosition = Vector3.zero;
        ui.transform.localScale    = Vector3.one;

        m_Slider = ui.transform.Find("Slider").GetComponent <UISlider>();
        TweenProperty por = TweenProperty.BeginTween(m_Slider.gameObject, "UISlider", "value", 0.01, 1, 10);

        por.ignoreTimeScale = false;
    }
Пример #3
0
    public static TweenProperty BeginTween(GameObject go, string className, params object[] args)
    {
        string        property = (string)args[0];
        float         from     = Convert.ToSingle(args[1]);
        float         to       = Convert.ToSingle(args[2]);
        float         duration = Convert.ToSingle(args[3]);
        TweenProperty comp     = UITweener.Begin <TweenProperty>(go, duration);

        comp.Property = property;
        comp.From     = from;
        comp.To       = to;
        comp.Duration = duration;
        comp.Target   = go.GetComponent(className) as MonoBehaviour;

        return(comp);
    }
Пример #4
0
    static int get_To(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            TweenProperty obj = (TweenProperty)o;
            float         ret = obj.To;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index To on a nil value"));
        }
    }
Пример #5
0
    static int get_Property(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            TweenProperty obj = (TweenProperty)o;
            string        ret = obj.Property;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Property on a nil value"));
        }
    }
Пример #6
0
    static int set_value(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            TweenProperty obj  = (TweenProperty)o;
            float         arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.value = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index value on a nil value"));
        }
    }
Пример #7
0
    static int set_Target(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            TweenProperty             obj  = (TweenProperty)o;
            UnityEngine.MonoBehaviour arg0 = (UnityEngine.MonoBehaviour)ToLua.CheckObject <UnityEngine.MonoBehaviour>(L, 2);
            obj.Target = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Target on a nil value"));
        }
    }
Пример #8
0
 static int BeginTween(IntPtr L)
 {
     try
     {
         int count = LuaDLL.lua_gettop(L);
         UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
         string        arg1          = ToLua.CheckString(L, 2);
         object[]      arg2          = ToLua.ToParamsObject(L, 3, count - 2);
         TweenProperty o             = TweenProperty.BeginTween(arg0, arg1, arg2);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #9
0
    static int set_Property(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            TweenProperty obj  = (TweenProperty)o;
            string        arg0 = ToLua.CheckString(L, 2);
            obj.Property = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Property on a nil value"));
        }
    }
Пример #10
0
    static int get_Target(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            TweenProperty             obj = (TweenProperty)o;
            UnityEngine.MonoBehaviour ret = obj.Target;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Target on a nil value"));
        }
    }
Пример #11
0
 public void TweenComplete()
 {
     TweenProperty por = TweenProperty.BeginTween(m_Slider.gameObject, "UISlider", "value", m_Slider.value, 1, 1);
 }
Пример #12
0
 public Tween(TweenMode mode, TweenProperty property, float value, EaseFunction.Ease easer, float millisecondsDuration, Action onStart = null, Action onFinish = null) :
     this(mode, value, easer, millisecondsDuration, onStart, onFinish)
 {
     Property = property;
 }