/// <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); }
// 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; }
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); }
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")); } }
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")); } }
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")); } }
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")); } }
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)); } }
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")); } }
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")); } }
public void TweenComplete() { TweenProperty por = TweenProperty.BeginTween(m_Slider.gameObject, "UISlider", "value", m_Slider.value, 1, 1); }
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; }